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

Enable yast2_lan_device_settings for svirt backend #10713

Merged
merged 1 commit into from
Jul 17, 2020
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
12 changes: 1 addition & 11 deletions schedule/yast/yast2_ncurses/yast2_ncurses_textmode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,9 @@ schedule:
- console/yast2_lan
- console/yast2_i
- console/yast2_bootloader
- "{{yast2_lan_device_settings}}"
- console/yast2_lan_device_settings
conditional_schedule:
bootloader_start:
BACKEND:
svirt:
- installation/bootloader_start
# The test module is temporary excluded on s390x due to the failures.
# https://progress.opensuse.org/issues/67603
yast2_lan_device_settings:
ARCH:
aarch64:
- console/yast2_lan_device_settings
ppc64le:
- console/yast2_lan_device_settings
x86_64:
- console/yast2_lan_device_settings
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ schedule:
- console/consoletest_setup
- console/yast2_i
- console/yast2_bootloader
- console/yast2_lan_device_settings
- console/coredump_collect
92 changes: 50 additions & 42 deletions tests/console/yast2_lan_device_settings.pm
Original file line number Diff line number Diff line change
Expand Up @@ -36,49 +36,57 @@ sub run {
script_run('ip a');
script_run('ls -alF /etc/sysconfig/network/');
save_screenshot;

my $opened = open_yast2_lan();
wait_still_screen;
if ($opened eq "Controlled by network manager") {
return;
unless (check_var("ARCH", "s390x")) {
my $opened = open_yast2_lan();
wait_still_screen;
if ($opened eq "Controlled by network manager") {
return;
}

send_key "alt-i"; # open edit device dialog
assert_screen 'edit-network-card';
send_key "alt-t"; # select static IP address option
send_key "tab";
type_string $static_ip;
send_key 'alt-o';
send_key_until_needlematch 'hostname-localhost-removed', 'backspace';
type_string $static_hostname;
send_key "alt-n"; # next
wait_still_screen;
assert_screen([qw(yast_lan_duplicate_ip static-ip-address-set)]);
if (match_has_tag 'yast_lan_duplicate_ip') {
send_key "alt-n";
send_key "alt-c";
close_yast2_lan();
record_soft_failure("Duplicate IP, $static_ip is currently unavailable. Skipping static IP assignment");
} elsif (match_has_tag 'static-ip-address-set') {
close_yast2_lan();

# verify that static IP has been set
assert_script_run "ip a | grep $static_ip";
# verify that hostname for static ip is recorded in /etc/hosts
$is_set_in_etc_host->($static_hostname) or die qq{Static hostname "$static_hostname" was not written to /etc/hosts file!\n};

open_yast2_lan();
for (1 .. 2) { send_key "tab" } # move to device list
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sofiasyria Can you run VR against non-s390x to observe the behaviour! i have the impression that this could be moved later in the code. i think you can move some part later in the test instead of open and close again the yast2_lan. But i would like to see a VR first.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But Sofia did not change that part of code, so it should work as before. Not sure that we need to change something here in scope of the PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About open and close I agree that it's not optimal, but this is not my code, it's green just because of the new indentation. I just added a condition that includes old code.

send_key "alt-i"; # open edit device dialog
wait_still_screen;
assert_screen 'edit-network-card';
send_key "alt-y"; # select dynamic address option
send_key "alt-n"; # next
assert_screen 'dynamic-ip-address-set';
close_yast2_lan();

# verify that dynamic IP address has been set
assert_script_run "ip r s | grep dhcp";
# verify that static ip is not recorded in /etc/hosts
if ($is_set_in_etc_host->($static_ip)) {
record_soft_failure 'bsc#1115644 yast2 lan does not update /etc/hosts after shifting from static ip to dynamic';
assert_script_run qq{sed -i '/$static_ip/d' /etc/hosts};
assert_script_run q{cat /etc/hosts};
}
}
}

send_key "alt-i"; # open edit device dialog
assert_screen 'edit-network-card';
send_key "alt-t"; # select static IP address option
send_key "tab";
type_string $static_ip;
send_key 'alt-o';
send_key_until_needlematch 'hostname-localhost-removed', 'backspace';
type_string $static_hostname;
send_key "alt-n"; # next
assert_screen 'static-ip-address-set';
close_yast2_lan();

# verify that static IP has been set
assert_script_run "ip a | grep $static_ip";
# verify that hostname for static ip is recorded in /etc/hosts
$is_set_in_etc_host->($static_hostname) or die qq{Static hostname "$static_hostname" was not written to /etc/hosts file!\n};

open_yast2_lan();
for (1 .. 2) { send_key "tab" } # move to device list
send_key "alt-i"; # open edit device dialog
wait_still_screen;
assert_screen 'edit-network-card';
send_key "alt-y"; # select dynamic address option
send_key "alt-n"; # next
assert_screen 'dynamic-ip-address-set';
close_yast2_lan();

# verify that dynamic IP address has been set
assert_script_run "ip r s | grep dhcp";
# verify that static ip is not recorded in /etc/hosts
if ($is_set_in_etc_host->($static_ip)) {
record_soft_failure 'bsc#1115644 yast2 lan does not update /etc/hosts after shifting from static ip to dynamic';
assert_script_run qq{sed -i '/$static_ip/d' /etc/hosts};
assert_script_run q{cat /etc/hosts};
}

# on SLE15-SP1+ / Leap 15.1+ the assign loopback checkbox has been dropped
if (is_sle('<=15') || is_leap('<=15.0')) {
open_yast2_lan();
Expand Down