Skip to content

Commit

Permalink
Run yast ui test with ncurse for pvm backend
Browse files Browse the repository at this point in the history
  • Loading branch information
coolgw committed Dec 6, 2022
1 parent 8463ac9 commit 8af2c50
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 9 deletions.
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" : "";
my $module_name = y2_module_consoletest::yast2_console_exec(yast2_module => 'nfs-server', yast2_opts => $y2_opts);

yast2_server_initial();

Expand Down
14 changes: 11 additions & 3 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 @@ -407,9 +408,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 = @_;
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();

$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

0 comments on commit 8af2c50

Please sign in to comment.