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 SLE15 installation version when SLE12 previously present #3936

Merged

Conversation

jknphy
Copy link
Contributor

@jknphy jknphy commented Nov 23, 2017

Fix sle version on SLE15 Installation with previous SLE12 installed. We need to change sle version at the middle of the test, due to two products are being under test.
We also need the following parameters added to jobs gnome+do_not_import_ssh_keys & gnome+import_ssh_keys to make it work:

SCC_REGISTER=installation
VERSION=12-SP1
VERSION_ACTUAL=15

@jknphy jknphy changed the title Fix sle version on SLE15 Installation with previous SLE12 installed Fix SLE15 Installation version when SLE12 previosly present Nov 23, 2017
@@ -686,6 +690,7 @@ sub load_inst_tests {
loadtest "installation/user_settings";
}
loadtest "installation/user_settings_root";

Copy link
Member

Choose a reason for hiding this comment

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

please don't. I understand everyone has a different style preference but we should not change back and forth single lines

@@ -553,6 +553,10 @@ sub install_this_version {
}

sub load_inst_tests {

Copy link
Member

Choose a reason for hiding this comment

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

please delete

@@ -553,6 +553,10 @@ sub install_this_version {
}

sub load_inst_tests {

#Switch to TARGET_DEVELOPING_VERSION (for SLE-15 installation when SLE12-SPx is present in the same test)
set_var('VERSION', get_var('TARGET_DEVELOPING_VERSION')) if get_var('TARGET_DEVELOPING_VERSION');
Copy link
Member

Choose a reason for hiding this comment

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

This looks like a good idea but I think we should additionally set the reload_needles => 1 parameter and actually I guess it should be the other way around. For a SLE 15 test the version will be 15 and we can not trigger the test any different but of course we can set any other version as we like. Maybe "TARGET_DEVELOPING_VERSION" is not the right name here as it was introduced for virtualization tests where we start e.g. a SLE15 hypervisor but a SLE 12-SP1 machine. Also, we need to call this within test modules and not in the context of main.pm (but I am not sure on this one). I assume we need to set the version to 12-SP1 at the beginning of the test and set it back to 15 here again so two set_var calls.

I am basically thinking out loud imagining something like this:

## main.pm
if (get_var('SSH_KEY_IMPORT')) {
    loadtest 'other/switch_version';
    loadtest 'boot/boot_to_desktop';
    …
    loadtest 'other/switch_version_back';
}

## other/switch_version.pm
sub run {
    my $version_orig = get_required_var('VERSION');
    set_var('VERSION_ORIG', $version_orig);
    set_var('VERSION', get_var('VERSION_LAYERED') // $version_orig, reload_needles => 1);

## other/switch_version_back.pm
sub run {
    set_var('VERSION', get_required_var('VERSION_ORIG'), reload_needles => 1);

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 tried this solution, creating separated tests as you proposed, the problem is that the tty is only assigned at the beginning before any test is running (I tried to use the init method of this class to re-initialize but no luck with that) https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/master/lib/susedistribution.pm#L302, so the only thing we can do is to change the version to the 'real' one to avoid conditional logic with the needles, but the initial one needs to be SLE-12, is a limitation of the framework until we can find some hack or a better solution in the api would be provided.
Verification is successful but if in the test was added something related with tty it will fail in the future, we need to be aware of that, but at least with VERSION set to a incorrect value, we can remember of this limitation.
http://dhcp227/tests/419#

Copy link
Member

Choose a reason for hiding this comment

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

sorry, I don't think we want to try to set the version differently in openQA settings directly. However we can update the VERSION in the tests, e.g. in main.pm if we must. You could try that.

@jknphy jknphy force-pushed the fix_tty_12-SPx_and_15_on_installation branch 2 times, most recently from d0f29f5 to cbfd036 Compare November 23, 2017 13:59
@okurz
Copy link
Member

okurz commented Nov 24, 2017

In subject line of PR s/previosly/previously/ and also write "installation" in lower case

@jknphy jknphy changed the title Fix SLE15 Installation version when SLE12 previosly present Fix SLE15 installation version when SLE12 previously present Nov 24, 2017
@jknphy jknphy changed the title Fix SLE15 installation version when SLE12 previously present [WIP] Fix SLE15 installation version when SLE12 previously present Nov 24, 2017
@jknphy jknphy force-pushed the fix_tty_12-SPx_and_15_on_installation branch from cbfd036 to 77ea145 Compare November 24, 2017 07:18
@jknphy jknphy force-pushed the fix_tty_12-SPx_and_15_on_installation branch from 77ea145 to 8a14276 Compare November 24, 2017 07:27
@jknphy
Copy link
Contributor Author

jknphy commented Nov 24, 2017

I understand your concerns about changing the version on the settings. I have a cleaner solution which does not involve to change the version at all, just need to add one flag VERSION_LAYERED=1 to solve the problem that we have with this two jobs. Anyway there was no problem with needles when we stamp SLE-15 from the beginning (except the missing needles contained in this PR needed because the original error was hiding it). These are the result of the testing:

@jknphy jknphy changed the title [WIP] Fix SLE15 installation version when SLE12 previously present Fix SLE15 installation version when SLE12 previously present Nov 24, 2017
@okurz
Copy link
Member

okurz commented Nov 25, 2017

That looks better :)

@okurz okurz merged commit 1faa028 into os-autoinst:master Nov 25, 2017
@jknphy jknphy deleted the fix_tty_12-SPx_and_15_on_installation branch March 7, 2018 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants