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

Complete workarounds for yast_proxy.pm and yast2_samba.pm #3881

Merged
merged 1 commit into from
Dec 3, 2017
Merged

Complete workarounds for yast_proxy.pm and yast2_samba.pm #3881

merged 1 commit into from
Dec 3, 2017

Conversation

Zaoliang
Copy link
Contributor

@Zaoliang Zaoliang commented Nov 7, 2017

Complete workarounds for yast_proxy.pm and yast2_samba.pm

send_key 'alt-a';
wait_screen_change { send_key 'alt-o' };

if (!is_sle && !sle_version_at_least('15')) {
Copy link
Member

Choose a reason for hiding this comment

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

Which distri are we aiming here? I believe we can use is_tumbleweed 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.

will re-write this: using sub ti splitt into: setup_ldap, samba_current, samba_new so that to have a clear structure :) thanks for review!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ops, this is about samba-server, not about proxy. will take a look at code for proxy.

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 should be:
if ((is_tumbleweed) || (is_sle && !sle_version_at_least('15'))

@rwx788
Copy link
Member

rwx788 commented Nov 8, 2017

Please, provide verification run on TW to prove that we don't break anything there. Ideally also one on SP3

if (is_sle && sle_version_at_least('15')) {
assert_screen 'yast2_samba-workgroup';
send_key 'alt-n';
if (check_screen 'yast2_still_susefirewall2') {
Copy link
Member

Choose a reason for hiding this comment

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

Please avoid check_screen with non-zero timeout

send_key 'alt-o';

wait_serial('yast2-samba-server-status-0', 60) || die "'yast2 samba-server' didn't finish";
# continue current workflow for sle 13 and current TW
Copy link
Member

Choose a reason for hiding this comment

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

There is no SLE 13


# check samba server status
assert_script_run("systemctl show -p ActiveState smb.service | grep ActiveState=active");
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Way too long for an else branch. Please extract into method

send_key 'alt-a';
wait_screen_change { send_key 'alt-o' };

if ((is_tumbleweed) || (is_sle && !sle_version_at_least('15'))) {
Copy link
Member

Choose a reason for hiding this comment

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

What's about leap? I believe we need even more ugly check here with "|| !leap_version_at_least('15')"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

leap 15.0 has been covered now: http://e13.suse.de/tests/4570#step/yast2_samba/32

Copy link
Member

Choose a reason for hiding this comment

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

Please try to avoid the explicit statement of is_tumbleweed as it should be considered our reference which we never need to check for. Rather turn the check around. Also you are not yet stating the Leap changes. Please make sure your code is always pushed in the most recent version before commenting back that it has been solved so that we know what to check for. On top I don't understand why (new) tumbleweed should behave the same as old-SLE? Is there a package submission gone missing for openSUSE:Factory?

Copy link
Member

Choose a reason for hiding this comment

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

this comment still applies

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed now.

if (match_has_tag 'yast2_still_susefirewall2') {
record_soft_failure 'bsc#1064405';
send_key 'alt-e';
if (!is_sle && !sle_version_at_least('15')) {
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if this is correct condition. sle_version_at_least always returns true if it's not sle distri (that's confusing part), so it will return false only if sle version is lower than 15, meaning, this condition will be never true. It's easier to get it if you flip it: !(is_sle || sle_version_at_least('15')). If it's not sle second condition gives true, if it's sle, then first one is already true. After negation, it's always false.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay, !(is_sle || sle_version_at_least('15')) is clear to me as well.

# start samba server configuration
script_run("yast2 samba-server; echo yast2-samba-server-status-\$? > /dev/$serialdev", 0);
# check Samba-Server Configuration got started
if ((is_tumbleweed) || (is_sle && sle_version_at_least('15'))) {
Copy link
Member

Choose a reason for hiding this comment

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

We use this ugly condition twice here, let's move it to the lib, and again we need to make it work on sle 15.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we do care new TW and sles 15, leap is not important atm. the whole yast2 test group is not activated for leap.

Copy link
Member

Choose a reason for hiding this comment

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

That's not true, we have leap tests running on o3. They are not in best shape, but it's mainly because we had no time to fix them. So I believe we have to at least define expected behavior, so only new set of needles is required in best case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

atm o3 is not testing leap for yast2 at all. do we have check var like "is_leap"?
if yes, I can add this however..

@@ -83,19 +83,23 @@ sub run {
if (check_screen 'yast2_proxy_firewall_enabled') {
send_key 'alt-p';
wait_still_screen 3;
# now we have a new popup to workaround for question about firewall settings
if (check_screen 'yast2_proxy_squid_cannot-open-interface') {
Copy link
Member

Choose a reason for hiding this comment

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

As you know we want to avoid check_screens with non-zero timeout

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay, add 10 sec then

sub gui_new {
assert_screen 'yast2_samba-workgroup';
send_key 'alt-n';
if (check_screen 'yast2_still_susefirewall2') {
Copy link
Member

Choose a reason for hiding this comment

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

as above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

change this as well

# now we have a new popup to workaround for question about firewall settings
if (check_screen 'yast2_proxy_squid_cannot-open-interface') {
send_key 'alt-y';
}
Copy link
Member

Choose a reason for hiding this comment

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

You already have experience with better ways, multi-tag assert_screen with match_has_tag. I don't see a reason why we should not use that 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.

this part is quite old, of course I can re-work this now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

checked this again, I don't think it is better to keep this because we don't need to check more than 2 needles here:
http://e13.suse.de/tests/4551#step/yast2_proxy/12

sub gui_new {
assert_screen 'yast2_samba-workgroup';
send_key 'alt-n';
if (check_screen 'yast2_still_susefirewall2', 10) {
Copy link
Member

Choose a reason for hiding this comment

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

see above

record_soft_failure 'bsc#1064405';
send_key 'alt-c';
}
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 default stilltime of 7 seconds is a big high, don't you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

reduce to 3

sub run {
setup_ldap;

# install samba stuffs at first
Copy link
Member

Choose a reason for hiding this comment

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

the comment is a bit redundant. Everyone should be able to understand the next line just as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay, removed

# install samba stuffs at first
zypper_call("in samba yast2-samba-server");

# start samba server configuration
Copy link
Member

Choose a reason for hiding this comment

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

here as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed now

# continue current workflow for sle 12
else {
gui_current;
}
Copy link
Member

Choose a reason for hiding this comment

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

Better use the same approach that you did further up by only looking for the specific older versions. This allows to not explicitly repeat the is_tumbleweed check

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay, will change like:

if (((is_leap) && !(leap_version_at_least('15.0'))) || (is_sle && !(sle_version_at_least('15')))) {
gui_current;
}
# continue current workflow for sle 12
else {
gui_new;
}

Copy link
Member

Choose a reason for hiding this comment

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

leap_version_at_least returns false in case it's not leap, so is_leap part is not really required

record_soft_failure 'bsc#1064405';
send_key 'alt-e';
# only older version like sles 12, tw, leap should still check the needle
if ((is_sle && !(sle_version_at_least('15'))) || (is_leap && !(leap_version_at_least('15.0')))) {
Copy link
Member

Choose a reason for hiding this comment

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

same here, do not need is_leap

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed

Copy link
Member

@okurz okurz left a comment

Choose a reason for hiding this comment

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

Please incorporate all suggestions including the one about check_screen. I think we should care about the sleep time because even if we only check for two needles a standard check_screen will waste 30 seconds when there is nothing to much. We know much better ways how to handle that.

It should be easier to separate the PRs for yast2_proxy and yast2_samba

@Zaoliang
Copy link
Contributor Author

checked this again for check_screen in proxy and samba. Only one place is not defined timeout.

Now I changed this as well.
if (check_screen 'yast2_proxy_squid_cannot-open-interface', 3) {
record_soft_failure 'bsc#1069458';
send_key 'alt-y';
}

@Zaoliang
Copy link
Contributor Author

again, for

if (check_screen 'yast2_proxy_squid_cannot-open-interface', 3) {
record_soft_failure 'bsc#1069458';
send_key 'alt-y';
}

there is atm no other option to workaround. Without check_screen here I don't think there is another way to handle it.

record_soft_failure 'bsc#1064405';
send_key 'alt-e';
# only older version like sles 12, tw, leap should still check the needle
if ((is_sle && !sle_version_at_least('15')) || is_leap && !leap_version_at_least('15.0')) {
Copy link
Member

Choose a reason for hiding this comment

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

Please, either remove wrapping parenthesis for both && conditions, or wrap is_leap && ....
Code will work, as logical AND has precedence on OR, but it's inconsistent from style perspective.

Copy link
Member

Choose a reason for hiding this comment

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

In the comment you mention "tw" but Tumbleweed should not activate that branch. I think that comment is wrong

send_key 'alt-p';
wait_still_screen 3;
# now we have a new popup to workaround for question about firewall settings
if (check_screen 'yast2_proxy_squid_cannot-open-interface', 3) {
Copy link
Member

Choose a reason for hiding this comment

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

I don't think that "3" seconds is a good choice. It should be either 0 seconds when the previous "wait_still_screen" made sure that the dialog shows up correctly in this case or the default when we can not ensure anything. But the best approach should be to use a multi-tag assert_screen with match_has_tag. Can you point me to an openQA test that detected this screen and recorded the following soft-failure?

send_key 'alt-a';
wait_screen_change { send_key 'alt-o' };

if ((is_tumbleweed) || (is_sle && !sle_version_at_least('15'))) {
Copy link
Member

Choose a reason for hiding this comment

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

Please try to avoid the explicit statement of is_tumbleweed as it should be considered our reference which we never need to check for. Rather turn the check around. Also you are not yet stating the Leap changes. Please make sure your code is always pushed in the most recent version before commenting back that it has been solved so that we know what to check for. On top I don't understand why (new) tumbleweed should behave the same as old-SLE? Is there a package submission gone missing for openSUSE:Factory?

record_soft_failure 'bsc#1064405';
send_key 'alt-e';
# only older version like sles 12, tw, leap should still check the needle
if ((is_sle && !sle_version_at_least('15')) || is_leap && !leap_version_at_least('15.0')) {
Copy link
Member

Choose a reason for hiding this comment

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

In the comment you mention "tw" but Tumbleweed should not activate that branch. I think that comment is wrong

if (match_has_tag 'yast2_still_susefirewall2') {
record_soft_failure 'bsc#1064405';
send_key 'alt-e';
# only older version like sles 12, tw, leap should still check the needle
Copy link
Member

Choose a reason for hiding this comment

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

s/sles/SLE/

zypper_call("in samba yast2-samba-server");
script_run("yast2 samba-server; echo yast2-samba-server-status-\$? > /dev/$serialdev", 0);
# check Samba-Server Configuration got started
if (is_leap && !leap_version_at_least('15.0') || (is_sle && !sle_version_at_least('15'))) {
Copy link
Member

Choose a reason for hiding this comment

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

I strongly recommend to surround both leap-checks with parentheses, i.e. write if ((is_leap && !leap_version_at_least('15.0')) || (is_sle && !sle_version_at_least('15'))) {

Zaoliang added a commit to Zaoliang/os-autoinst-needles-opensuse that referenced this pull request Nov 24, 2017
- add workaround needles for firewall port and needles for
    firewall port in samba server
- add workaround needle for open interface in proxy server
- see related ticket: https://progress.opensuse.org/issues/25478
- see PR:
  os-autoinst/os-autoinst-distri-opensuse#3881
- verification run (Leap): http://e13.suse.de/tests/4593
@Zaoliang
Copy link
Contributor Author

@okurz please check my updated PR if you have time, thanks!

- workaround with susefirewall2 for proxy server
- workaround with susefirewall2 for samba server
- record softfail for samba server, add new workflow for changes
- add record_soft_failure "bsc#1068900" for samba-server
- proxy server: add record_soft_failure bsc#1069458
- verification run TW: http://e13.suse.de/tests/31
	TW samba-server failed at early stage because of boo#1068938
- verification run Leap 15.0: http://e13.suse.de/tests/4593
    proxy failed because squid is missing
- verification run SLES 15: http://e13.suse.de/tests/30
- verification run SLES 12 SP3: http://e13.suse.de/tests/33
- add record_soft_failure "bsc#1068900" for samba-server
- Related ticket: https://progress.opensuse.org/issues/26998
@Zaoliang
Copy link
Contributor Author

Zaoliang commented Dec 1, 2017

@okurz please check and merge, thanks!

@okurz okurz merged commit f425b48 into os-autoinst:master Dec 3, 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
3 participants