-
Notifications
You must be signed in to change notification settings - Fork 270
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
Conversation
tests/x11/yast2_lan_restart.pm
Outdated
send_key 'alt-o'; | ||
} | ||
else { | ||
assert_screen 'yast2_closed_xterm_visible', 120; |
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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') {...}
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
tests/x11/yast2_lan_restart.pm
Outdated
@@ -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 |
There was a problem hiding this comment.
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
tests/x11/yast2_lan_restart.pm
Outdated
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; |
There was a problem hiding this comment.
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
tests/x11/yast2_lan_restart.pm
Outdated
assert_screen 'yast2_closed_xterm_visible', 120; | ||
} | ||
# for sure that it comes back to root console | ||
wait_still_screen; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 :)
updated again. |
@okurz record_soft_failure added, please check, thanks! |
Could you please rerun your verification run so we can see the soft-fail working? The rest looks good to me. |
or this is better: http://e13.suse.de/tests/52 |
why my commit message didn't get updated with my update of commit ? |
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. |
needle PR: |
|
@okurz PR updated, please check and merge, thanks! |
tests/x11/yast2_lan_restart.pm
Outdated
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"; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
Causes failure on TW (not on firewalld yet): https://openqa.opensuse.org/tests/552697#step/yast2_lan_restart/14 |
Fix firewall activation warning, add softfail for yast2_lan_restart.pm
https://openqa.suse.de/tests/1274792#step/yast2_lan_restart/30
http://e13.suse.de/tests/318
Fix issue with warning about firewall activation for yast2_lan_restart.pm os-autoinst-needles-opensuse#292