Skip to content

Commit

Permalink
Merge pull request #3370 from rwx788/20582_sle_version_15
Browse files Browse the repository at this point in the history
Adjust boot image creation with repos on sle 15
  • Loading branch information
Soulofdestiny committed Aug 8, 2017
2 parents ac426d9 + 4aa9a40 commit 2dc7a69
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 38 deletions.
5 changes: 5 additions & 0 deletions lib/installsummarystep.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package installsummarystep;
use base "y2logsstep";
use testapi;
use strict;
use utils 'sle_version_at_least';


sub accept3rdparty {
Expand All @@ -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;
Expand All @@ -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';
}

Expand Down
24 changes: 20 additions & 4 deletions lib/y2logsstep.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -56,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)) {
Expand All @@ -79,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
Expand All @@ -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')) {
Expand Down Expand Up @@ -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)) {
Expand All @@ -162,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 {
Expand Down
11 changes: 7 additions & 4 deletions products/sle/main.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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';
}
}

Expand Down Expand Up @@ -603,7 +605,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()) {
Expand Down
3 changes: 2 additions & 1 deletion tests/installation/addon_products_sle.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
Expand Down Expand Up @@ -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';
}
Expand Down
15 changes: 4 additions & 11 deletions tests/installation/installation_overview.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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->deal_with_dependency_issues;

if (get_var("XEN")) {
assert_screen "inst-xen-pattern";
Expand All @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion tests/installation/installation_overview_before.pm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use testapi;

sub run {
my ($self) = @_;
$self->sle15_workaround_broken_patterns;

# overview-generation
# this is almost impossible to check for real
Expand All @@ -27,7 +28,7 @@ sub run {
# performed only once, as state of buttons can be different
assert_screen "installation-settings-overview-loaded";

if (match_has_tag 'manual-intervention') {
if (check_screen 'manual-intervention') {
$self->deal_with_dependency_issues;
}
}
Expand Down
34 changes: 17 additions & 17 deletions tests/installation/select_patterns_and_packages.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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';
Expand All @@ -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';
Expand Down Expand Up @@ -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';
Expand All @@ -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'))) {
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 2dc7a69

Please sign in to comment.