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

Fix firewall activation warning in yast2_lan_restart.pm #3956

Merged
merged 1 commit into from
Dec 6, 2017
Merged

Fix firewall activation warning in yast2_lan_restart.pm #3956

merged 1 commit into from
Dec 6, 2017

Conversation

Zaoliang
Copy link
Contributor

@Zaoliang Zaoliang commented Nov 28, 2017

Fix firewall activation warning, add softfail for yast2_lan_restart.pm

send_key 'alt-o';
}
else {
assert_screen 'yast2_closed_xterm_visible', 120;
Copy link
Member

Choose a reason for hiding this comment

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

It's not really a comment on the code but more a question: is assert_screen 'yast2_closed_xterm_visible', 120; really useful?
As if the this code is executed it should has been already did with assert_screen ([qw(yast2-lan-restart_firewall_active_warning yast2_closed_xterm_visible)], 120);, no?

And so it could be executed two times. But maybe I'm wrong :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know. I just try to fix the code here ;)
Actually we want to re-work the code according to changes from sles 15/leap 15.0.
yast2_closed_xterm_visible', 120; -- is needed here so we can be sure that lan got closed correctly and it is ready for following tests.

assert_screen checks only needles and has nothing to do with closing xterm.

Copy link
Member

Choose a reason for hiding this comment

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

Could you try to remove the else { assert_screen ... } and test if it still works?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

well, yast2_closed_xterm_visible is needed anyway, for sles 12 and leap lower than 15.0
Just want to avoid to use check_screen here like if (check_screen 'yast2-lan-restart_firewall_active_warning') {...}

Copy link
Member

Choose a reason for hiding this comment

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

Agreed that it is needed for older version, but assert_screen([qw(yast2-lan-restart_firewall_active_warning yast2_closed_xterm_visible)], 120); is not intended to test both? As I understand the code, it tests if one of yast2-lan-restart_firewall_active_warning or yast2_closed_xterm_visible is found. If yast2-lan-restart_firewall_active_warning is found it does specific stuff, and it it's the other it does assert_screen again, which may not be needed for me, as it has already been checked (on all sle/opensuse version).

But again, it's more for me to understand better how openQA works :-) This is why I asked if a test without it was possible or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is needed for both cases. so I added this yast2_closed_xterm_visible now. It looks better:
http://e13.suse.de/tests/26#step/yast2_lan_restart/39

@@ -42,7 +42,20 @@ sub check_network {
$status //= 'no_restart';
wait_still_screen;
send_key 'alt-o'; # OK
assert_screen 'yast2_closed_xterm_visible', 120;
# new: warning pops up for firewall, alt-y for assign it to zone
Copy link
Member

Choose a reason for hiding this comment

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

Better add a blank line in before so that the comment is not placed in this weird location

assert_screen([qw(yast2-lan-restart_firewall_active_warning yast2_closed_xterm_visible)], 120);
if (match_has_tag 'yast2-lan-restart_firewall_active_warning') {
send_key 'alt-y';
wait_still_screen;
Copy link
Member

Choose a reason for hiding this comment

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

That means at least 7 seconds of waiting, better use something else, at least a reduced stilltime

assert_screen 'yast2_closed_xterm_visible', 120;
}
# for sure that it comes back to root console
wait_still_screen;
Copy link
Member

Choose a reason for hiding this comment

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

The above assert_screen 'yast2_closed_xterm_visible', 120; outside of the if-else should do that job. I don't see the need for this wait_still_screen

Copy link
Member

Choose a reason for hiding this comment

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

@okurz it's more for my personal knowledge, but could you explain me why the assert_screen 'yast2_closed_xterm_visible', 120; after the else is needed? The assert_screen ([qw(yast2-lan-restart_firewall_active_warning yast2_closed_xterm_visible)], 120);1 should not do the job already?

I don't want to insist ;-) I just want to understand :)

@Zaoliang
Copy link
Contributor Author

updated again.
@okurz let's talk about this offline.

@Zaoliang
Copy link
Contributor Author

Zaoliang commented Dec 1, 2017

@okurz record_soft_failure added, please check, thanks!

@nicksinger
Copy link
Member

Could you please rerun your verification run so we can see the soft-fail working? The rest looks good to me.

@Zaoliang
Copy link
Contributor Author

Zaoliang commented Dec 1, 2017

or this is better: http://e13.suse.de/tests/52

@Zaoliang
Copy link
Contributor Author

Zaoliang commented Dec 1, 2017

why my commit message didn't get updated with my update of commit ?

@okurz
Copy link
Member

okurz commented Dec 3, 2017

code change looks ok but I think you introduced a new needle check and therefore we are missing the corresponding needle PRs/MRs. Also regarding your last question: It seems like your commit was updated but maybe you mean your PR description? That is not the same so you need to update your PR description within github.

@Zaoliang
Copy link
Contributor Author

Zaoliang commented Dec 4, 2017

@okurz
Copy link
Member

okurz commented Dec 4, 2017

@Zaoliang
Copy link
Contributor Author

Zaoliang commented Dec 4, 2017

@okurz PR updated, please check and merge, thanks!

check_network('restart');
}

sub run {
select_console 'x11';
x11_start_program("xterm -geometry 155x50+5+5", target_match => 'xterm');
become_root;
# make sure that firewalld is stopped, or we have later pops for firewall activation warning
# or timeout for command 'ip a' later
script_run "systemctl stop firewalld";
Copy link
Member

@okurz okurz Dec 5, 2017

Choose a reason for hiding this comment

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

Please don't add a script_run without checking the return value. Can you simply call assert_script_run or can the "stop" command fail here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was assert_script_run, then I change it into script_run. But it is fine with assert_script_run. Please check, thanks!

- fix issue with warning shows up at:
  https://openqa.suse.de/tests/1274792#step/yast2_lan_restart/30
- add record_soft_failure bsc#1070578
- see poo#25676 and poo#28501 for details
- verification run:
  http://e13.suse.de/tests/52
- needles PR:
  os-autoinst/os-autoinst-needles-opensuse#292
@okurz okurz merged commit 227c8a6 into os-autoinst:master Dec 6, 2017
@DimStar77
Copy link
Contributor

Causes failure on TW (not on firewalld yet):

https://openqa.opensuse.org/tests/552697#step/yast2_lan_restart/14

okurz added a commit to okurz/os-autoinst-distri-opensuse that referenced this pull request Dec 7, 2017
okurz added a commit to okurz/os-autoinst-distri-opensuse that referenced this pull request Dec 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants