Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run yast ui test with ncurse for pvm backend #16035

Merged
merged 1 commit into from
Dec 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/nfs_common.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use utils qw(systemctl file_content_replace clear_console zypper_call clear_cons
use Utils::Systemd 'disable_and_stop_service';
use mm_network;
use version_utils;
use Utils::Backends 'is_pvm_hmc';


our @ISA = qw(Exporter);
Expand Down Expand Up @@ -214,8 +215,8 @@ sub config_service {
try_nfsv2();

prepare_exports($rw, $ro);

my $module_name = y2_module_consoletest::yast2_console_exec(yast2_module => 'nfs-server');
my $y2_opts = is_pvm_hmc() ? "--ncurses" : "";
jknphy marked this conversation as resolved.
Show resolved Hide resolved
my $module_name = y2_module_consoletest::yast2_console_exec(yast2_module => 'nfs-server', yast2_opts => $y2_opts);

yast2_server_initial();

Expand Down
18 changes: 14 additions & 4 deletions lib/y2lan_restart_common.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use Exporter 'import';
use testapi;
use utils 'systemctl';
use version_utils qw(is_sle is_leap);
use Utils::Backends 'is_pvm_hmc';
use y2_module_basetest qw(accept_warning_network_manager_default is_network_manager_default);
use y2_module_consoletest;
use Test::Assert ':all';
Expand Down Expand Up @@ -398,7 +399,9 @@ sub change_ipforward {

=head2 open_yast2_lan

open_yast2_lan();
open_yast2_lan([$ui]);

C<$ui> ncurses/qt will used for set yast ui mode

Open yast2 lan, run handle_dhcp_popup() and install and check firewalld

Expand All @@ -407,9 +410,16 @@ If network is controlled by Networkmanager, don't change any network settings.
=cut

sub open_yast2_lan {
my $is_nm = !script_run('systemctl is-active NetworkManager'); # Revert boolean because of bash vs perl's return code.

$module_name = y2_module_consoletest::yast2_console_exec(yast2_module => 'lan');
my %options = @_;
jknphy marked this conversation as resolved.
Show resolved Hide resolved
my $is_nm
= !script_run('systemctl is-active NetworkManager'); # Revert boolean because of bash vs perl's return code.
my $y2_opts
= ($options{ui} =~ /ncurses/)
? "--" . $options{ui}
: "";
$y2_opts = "--ncurses" if is_pvm_hmc();
jknphy marked this conversation as resolved.
Show resolved Hide resolved

$module_name = y2_module_consoletest::yast2_console_exec(yast2_module => 'lan', yast2_opts => $y2_opts);

if ($is_nm) {
handle_Networkmanager_controlled; # don't change any settings
Expand Down
5 changes: 5 additions & 0 deletions schedule/yast/yast2_ncurses/yast2_ncurses_textmode_pvm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@ schedule:
- boot/boot_to_desktop
- console/prepare_test_data
- console/consoletest_setup
- console/yast2_lan
- console/yast2_i
- console/yast2_bootloader
- console/yast2_lan_device_settings
- console/yast2_nfs_server
- console/yast2_kdump
6 changes: 3 additions & 3 deletions tests/console/yast2_bootloader.pm
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ use warnings;
use testapi;
use Utils::Architectures;
use utils;
use Utils::Backends 'is_hyperv';
use Utils::Backends qw(is_hyperv is_pvm_hmc);

sub run {
my $self = shift;
select_console 'root-console';

# make sure yast2 bootloader module is installed
zypper_call 'in yast2-bootloader';

my $module_name = y2_module_consoletest::yast2_console_exec(yast2_module => 'bootloader');
my $y2_opts = is_pvm_hmc() ? "--ncurses" : "";
my $module_name = y2_module_consoletest::yast2_console_exec(yast2_module => 'bootloader', yast2_opts => $y2_opts);

# YaST2 prompts user to install missing packages found during storage probing.
# Otherwise YaST2 shows bootloader settings options
Expand Down
4 changes: 3 additions & 1 deletion tests/console/yast2_lan.pm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use testapi;
use utils;
use y2lan_restart_common;
use version_utils ':VERSION';
use Utils::Backends 'is_pvm_hmc';

my $module_name;

Expand All @@ -38,7 +39,8 @@ sub run {
script_run('ls -alF /etc/sysconfig/network/');
save_screenshot;

my $opened = open_yast2_lan();
my $y2_opts = is_pvm_hmc() ? "ncurses" : "";
my $opened = open_yast2_lan(ui => $y2_opts);
wait_still_screen(14);
if ($opened eq "Controlled by network manager") {
return;
Expand Down