From f37deb02b89aff448d61c8a3eb913a32fc07716a Mon Sep 17 00:00:00 2001 From: Rodion Iafarov Date: Wed, 2 Aug 2017 10:54:44 +0200 Subject: [PATCH 1/2] Adjust boot image creation with repos on sle 15 We already have a method to workaround broken patterns, whereas in some scenarios we have installation_overview_before where we just assert overview screen. As a temporary solution we will add repos manually before we get scc. Whereas, it should not affect test code, as this part is done using test suite configuration. This PR mainly contains changes to workaround known installation issues. We also exclude release notes test on sle 15 as it doesn't work properly with addons and there will be no such a thing visible in future. See poo#20984 --- lib/y2logsstep.pm | 16 ++++++++-- products/sle/main.pm | 5 +-- tests/installation/installation_overview.pm | 15 +++------ .../installation_overview_before.pm | 4 ++- .../select_patterns_and_packages.pm | 32 +++++++++---------- 5 files changed, 40 insertions(+), 32 deletions(-) diff --git a/lib/y2logsstep.pm b/lib/y2logsstep.pm index 04ba10144565..2b58b49d2aee 100644 --- a/lib/y2logsstep.pm +++ b/lib/y2logsstep.pm @@ -2,6 +2,7 @@ package y2logsstep; use base "installbasetest"; use testapi; use strict; +use utils 'sle_version_at_least'; sub use_wicked { script_run "cd /proc/sys/net/ipv4/conf"; @@ -103,11 +104,21 @@ sub break_dependency { } } +sub sle15_workaround_broken_patterns { + return unless sle_version_at_least('15'); + # SLE 15 has pattern errors, workaround them - rbrown 04/07/2017 + while (check_screen('sle-15-failed-to-select-pattern', 2)) { + record_soft_failure 'bsc#1047327'; + send_key 'alt-o'; + } +} + # to deal with dependency issues, either work around it, or break dependency to continue with installation sub deal_with_dependency_issues { my ($self) = @_; - assert_screen 'manual-intervention'; + return unless check_screen 'manual-intervention', 10; + record_soft_failure 'dependency warning'; if (check_var('VIDEOMODE', 'text')) { @@ -143,10 +154,11 @@ sub deal_with_dependency_issues { while (check_screen('unsupported-packages', 2)) { send_key 'alt-o'; # Continue } - while (check_screen([qw(error-with-patterns sle-15-failed-to-select-pattern)], 2)) { + while (check_screen('error-with-patterns', 2)) { record_soft_failure 'bsc#1047337'; send_key 'alt-o'; # OK } + sle15_workaround_broken_patterns; sleep 2; if (check_screen('dependency-issue-fixed', 0)) { diff --git a/products/sle/main.pm b/products/sle/main.pm index f1f1c165fbdd..788e96ebbe6a 100644 --- a/products/sle/main.pm +++ b/products/sle/main.pm @@ -12,7 +12,7 @@ use warnings; use testapi qw(check_var get_var get_required_var set_var check_var_array); use lockapi; use needle; -use utils 'is_hyperv_in_gui'; +use utils qw(is_hyperv_in_gui sle_version_at_least); use File::Find; use File::Basename; @@ -603,7 +603,8 @@ sub load_inst_tests { # the VNC gadget is too unreliable to click, but we # need to be able to do installations on it. The release notes # functionality needs to be covered by other backends - if (!check_var('BACKEND', 'generalhw')) { + # Skip release notes test on sle 15 if have addons + if (!check_var('BACKEND', 'generalhw') && !(sle_version_at_least('15') && get_var('ADDONURL'))) { loadtest "installation/releasenotes"; } if (noupdatestep_is_applicable()) { diff --git a/tests/installation/installation_overview.pm b/tests/installation/installation_overview.pm index b4efce5cb62c..d37742dd186a 100644 --- a/tests/installation/installation_overview.pm +++ b/tests/installation/installation_overview.pm @@ -17,23 +17,16 @@ use base "y2logsstep"; use testapi; use utils 'sle_version_at_least'; -sub sle15_workaround_broken_patterns { - if (sle_version_at_least('15')) { # SLE 15 has pattern errors, workaround them - rbrown 04/07/2017 - while (check_screen('sle-15-failed-to-select-pattern', 2)) { - record_soft_failure 'bsc#1047327'; - send_key 'alt-o'; - } - } -} sub run { my ($self) = shift; + $self->sle15_workaround_broken_patterns; # overview-generation # this is almost impossible to check for real assert_screen "installation-settings-overview-loaded"; - sle15_workaround_broken_patterns; + $self->sle15_workaround_broken_patterns; if (get_var("XEN")) { assert_screen "inst-xen-pattern"; @@ -57,9 +50,9 @@ sub run { $self->deal_with_dependency_issues; } - sle15_workaround_broken_patterns; # Pattern warnings appear after dependancy resolution also; + $self->sle15_workaround_broken_patterns; # Pattern warnings appear after dependancy resolution also; - my $need_ssh = check_var('ARCH', 's390x'); # s390x always needs SSH + my $need_ssh = check_var('ARCH', 's390x'); # s390x always needs SSH $need_ssh = 1 if check_var('BACKEND', 'ipmi'); # we better be able to login if (!get_var('UPGRADE') && $need_ssh) { diff --git a/tests/installation/installation_overview_before.pm b/tests/installation/installation_overview_before.pm index bc361fff980e..b281e745f862 100644 --- a/tests/installation/installation_overview_before.pm +++ b/tests/installation/installation_overview_before.pm @@ -18,7 +18,7 @@ use testapi; sub run { my ($self) = @_; - + $self->sle15_workaround_broken_patterns; # overview-generation # this is almost impossible to check for real # See poo#12322. Prevent checks before overview is fully loaded @@ -27,6 +27,8 @@ sub run { # performed only once, as state of buttons can be different assert_screen "installation-settings-overview-loaded"; + $self->sle15_workaround_broken_patterns; + if (match_has_tag 'manual-intervention') { $self->deal_with_dependency_issues; } diff --git a/tests/installation/select_patterns_and_packages.pm b/tests/installation/select_patterns_and_packages.pm index 5f2bfe7348bc..9adef98e1d1e 100644 --- a/tests/installation/select_patterns_and_packages.pm +++ b/tests/installation/select_patterns_and_packages.pm @@ -53,7 +53,10 @@ sub check12qtbug { } sub gotopatterns { - my $self = @_; + my ($self) = @_; + + $self->deal_with_dependency_issues; + if (check_var('VIDEOMODE', 'text')) { wait_still_screen; send_key 'alt-c'; @@ -65,13 +68,6 @@ sub gotopatterns { send_key 'ret'; } - if (check_screen('dependency-issue', 5) && get_var("WORKAROUND_DEPS")) { - $self->workaround_dependency_issues; - } - if (check_screen('dependency-issue', 0) && get_var("BREAK_DEPS")) { - $self->break_dependency; - } - assert_screen 'pattern_selector'; if (check_var('VIDEOMODE', 'text')) { send_key 'alt-f'; @@ -87,9 +83,11 @@ sub gotopatterns { } sub package_action { - my $unblock = @_; + my ($self, $unblock) = @_; my $operation; my $packages = $unblock ? get_var('INSTALLATION_BLOCKED') : get_var('PACKAGES'); + # Workaround for sle 15. Version check is performed inside of the method + $self->sle15_workaround_broken_patterns; if (get_var('PACKAGES')) { if (check_var('VIDEOMODE', 'text')) { send_key 'alt-f'; @@ -143,6 +141,8 @@ sub package_action { send_key 'alt-o'; accept3rdparty; } + # Workaround for sle 15. Version check is performed inside of the method + $self->sle15_workaround_broken_patterns; if (get_var('INSTALLATION_BLOCKED') && $secondrun) { record_soft_failure 'bsc#1029660'; assert_screen 'inst-overview-blocked'; @@ -157,9 +157,9 @@ sub package_action { } sub run { - my $self = shift; + my ($self) = @_; - gotopatterns; + $self->gotopatterns; if (get_var('PATTERNS')) { my %wanted_patterns; for my $p (split(/,/, get_var('PATTERNS'))) { @@ -207,13 +207,13 @@ sub run { check12qtbug; } } - package_action; + $self->package_action; $secondrun++; - gotopatterns; - package_action; + $self->gotopatterns; + $self->package_action; $secondrun--; - gotopatterns; - package_action('unblock'); + $self->gotopatterns; + $self->package_action('unblock'); } 1; From 4aa9a404fa407c456dffba521f5a9936041d3652 Mon Sep 17 00:00:00 2001 From: Rodion Iafarov Date: Fri, 4 Aug 2017 17:41:42 +0200 Subject: [PATCH 2/2] Fix text mode hdd creation --- lib/installsummarystep.pm | 5 +++++ lib/y2logsstep.pm | 8 ++++++-- products/sle/main.pm | 6 ++++-- tests/installation/addon_products_sle.pm | 3 ++- tests/installation/installation_overview.pm | 2 +- tests/installation/installation_overview_before.pm | 5 ++--- tests/installation/select_patterns_and_packages.pm | 2 +- 7 files changed, 21 insertions(+), 10 deletions(-) diff --git a/lib/installsummarystep.pm b/lib/installsummarystep.pm index 6475f261fde2..3f2641234e2e 100644 --- a/lib/installsummarystep.pm +++ b/lib/installsummarystep.pm @@ -2,6 +2,7 @@ package installsummarystep; use base "y2logsstep"; use testapi; use strict; +use utils 'sle_version_at_least'; sub accept3rdparty { @@ -16,6 +17,7 @@ sub accept3rdparty { } sub accept_changes_with_3rd_party_repos { + my ($self) = @_; if (check_var('VIDEOMODE', 'text')) { send_key $cmd{accept}; accept3rdparty; @@ -26,6 +28,9 @@ sub accept_changes_with_3rd_party_repos { send_key $cmd{ok}; accept3rdparty; } + if (sle_version_at_least '15') { + $self->sle15_workaround_broken_patterns; + } assert_screen 'inst-overview'; } diff --git a/lib/y2logsstep.pm b/lib/y2logsstep.pm index 2b58b49d2aee..fda3bde35f80 100644 --- a/lib/y2logsstep.pm +++ b/lib/y2logsstep.pm @@ -57,7 +57,7 @@ sub get_to_console { # to workaround dependency issues sub workaround_dependency_issues { - assert_screen 'dependency-issue'; + return unless sle_version_at_least('15') && check_screen 'dependency-issue', 10; if (check_var('VIDEOMODE', 'text')) { while (check_screen('dependency-issue', 5)) { @@ -80,7 +80,7 @@ sub workaround_dependency_issues { # to break dependency issues sub break_dependency { - assert_screen 'dependency-issue'; + return unless sle_version_at_least('15') && check_screen 'dependency-issue', 10; if (check_var('VIDEOMODE', 'text')) { while (check_screen('dependency-issue-text', 5)) { # repeat it untill all dependency issues are resolved @@ -174,6 +174,10 @@ sub deal_with_dependency_issues { if (check_screen([qw(accept-licence automatic-changes unsupported-packages error-with-patterns sle-15-failed-to-select-pattern)], 2)) { goto DO_CHECKS; } + # In text mode dependency issues may occur again after resolving them + if (check_screen 'manual-intervention') { + $self->deal_with_dependency_issues; + } } sub save_upload_y2logs { diff --git a/products/sle/main.pm b/products/sle/main.pm index 788e96ebbe6a..9566e324d688 100644 --- a/products/sle/main.pm +++ b/products/sle/main.pm @@ -85,9 +85,11 @@ sub default_desktop { if (get_var('BASE_VERSION', '') =~ /^12/) { return 'gnome'; } - else { - return 'textmode'; + # In sle15 we add repos manually to make a workaround of missing SCC, gnome will be installed as default system. + if (get_var('ADDONURL') =~ /(desktop|server)/) { + return 'gnome'; } + return 'textmode'; } } diff --git a/tests/installation/addon_products_sle.pm b/tests/installation/addon_products_sle.pm index ce06670dfe65..b2ec94b9926d 100644 --- a/tests/installation/addon_products_sle.pm +++ b/tests/installation/addon_products_sle.pm @@ -51,7 +51,7 @@ sub run { # might involve some network lookup of products, licenses, etc. assert_screen 'addon-products', 90; send_key "tab"; # select addon-products-$addon - wait_still_screen 2; + wait_still_screen 10; if (check_var('VIDEOMODE', 'text')) { # textmode need more tabs, depends on add-on count send_key_until_needlematch "addon-list-selected", 'tab'; } @@ -96,6 +96,7 @@ sub run { send_key 'alt-t'; } send_key "tab"; # select addon-products-$addon + wait_still_screen 10; # wait until repo is added and list is initialized if (check_var('VIDEOMODE', 'text')) { # textmode need more tabs, depends on add-on count send_key_until_needlematch "addon-list-selected", 'tab'; } diff --git a/tests/installation/installation_overview.pm b/tests/installation/installation_overview.pm index d37742dd186a..53a9227d5a17 100644 --- a/tests/installation/installation_overview.pm +++ b/tests/installation/installation_overview.pm @@ -26,7 +26,7 @@ sub run { # this is almost impossible to check for real assert_screen "installation-settings-overview-loaded"; - $self->sle15_workaround_broken_patterns; + $self->deal_with_dependency_issues; if (get_var("XEN")) { assert_screen "inst-xen-pattern"; diff --git a/tests/installation/installation_overview_before.pm b/tests/installation/installation_overview_before.pm index b281e745f862..a8e6be1c3001 100644 --- a/tests/installation/installation_overview_before.pm +++ b/tests/installation/installation_overview_before.pm @@ -19,6 +19,7 @@ use testapi; sub run { my ($self) = @_; $self->sle15_workaround_broken_patterns; + # overview-generation # this is almost impossible to check for real # See poo#12322. Prevent checks before overview is fully loaded @@ -27,9 +28,7 @@ sub run { # performed only once, as state of buttons can be different assert_screen "installation-settings-overview-loaded"; - $self->sle15_workaround_broken_patterns; - - if (match_has_tag 'manual-intervention') { + if (check_screen 'manual-intervention') { $self->deal_with_dependency_issues; } } diff --git a/tests/installation/select_patterns_and_packages.pm b/tests/installation/select_patterns_and_packages.pm index 9adef98e1d1e..862a9335c9ae 100644 --- a/tests/installation/select_patterns_and_packages.pm +++ b/tests/installation/select_patterns_and_packages.pm @@ -194,7 +194,7 @@ sub run { }; assert_screen 'current-pattern-selected', 5; } - + $self->workaround_dependency_issues; # stick to the default patterns if (get_var('PATTERNS', '') =~ /default/) { $needs_to_be_selected = $selected;