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 staging and adjust tests for new welcome screen #3522

Merged
merged 1 commit into from
Sep 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions cpanfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ requires 'XML::Writer';
requires 'XML::Simple';
requires 'IO::File';
requires 'List::Util';
requires 'LWP::Simple';

on 'test' => sub {
requires 'Code::DRY';
Expand Down
77 changes: 51 additions & 26 deletions products/sle/main.pm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use needle;
use utils qw(is_hyperv_in_gui sle_version_at_least);
use File::Find;
use File::Basename;
use LWP::Simple 'head';

BEGIN {
unshift @INC, dirname(__FILE__) . '/../../lib';
Expand Down Expand Up @@ -287,30 +288,54 @@ if (get_var('DEV_IMAGE')) {

# This is workaround setting which will be removed once SCC add repos and allows adding modules
# TODO: remove when not used anymore
if (get_var('ALL_MODULES') && sle_version_at_least('15')) {
my $arch = get_required_var("ARCH");
my $build = get_required_var("BUILD");
my $version = get_required_var("VERSION");
# We already have needles with names which are different we would use here
# As it's only workaround, better not to create another set of needles.
my %modules = (
base => 'Basesystem',
sdk => 'Development-Tools',
desktop => 'DESKTOP-Applications',
legacy => 'Legacy',
script => 'Scripting',
serverapp => 'SERVER-Applications'
);
my $addonurl;

while (my ($short_name, $full_name) = each %modules) {
$addonurl .= "$short_name,";
my $module_repo_name = get_var("REPO_SLE${version}_MODULE_" . uc $full_name, "SLE-$version-Module-$full_name-POOL-$arch-Build$build-Media1/");
set_var('ADDONURL_' . uc $short_name, "$utils::OPENQA_FTP_URL/$module_repo_name");
}
#remove last comma from ADDONURL setting value
$addonurl =~ s/,$//;
set_var("ADDONURL", $addonurl);
if (sle_version_at_least('15')) {
my @modules;
if (get_var('ALL_MODULES')) {
# By default add all modules
@modules = qw(base sdk desktop legacy script serverapp);
}
# If WORKAROUND_MODULES contains a list of modules, add only them
if (get_var('WORKAROUND_MODULES')) {
@modules = split(/,/, get_var('WORKAROUND_MODULES'));
}
if (@modules) {
my $arch = get_required_var("ARCH");
my $build = get_required_var("BUILD");
my $version = get_required_var("VERSION");
# We already have needles with names which are different we would use here
# As it's only workaround, better not to create another set of needles.
my %modules = (
base => 'Basesystem',
sdk => 'Development-Tools',
desktop => 'DESKTOP-Applications',
legacy => 'Legacy',
script => 'Scripting',
serverapp => 'SERVER-Applications'
);
my $addonurl;

for my $short_name (@modules) {
my $full_name = $modules{$short_name};
my $repo_name = uc $full_name;
# Replace dashes with underscore symbols
$repo_name =~ s/-/_/;
my $prefix = "SLE-$version";
# Add staging prefix
if (is_staging()) {
$prefix .= "-Staging:" . get_var("STAGING");
}
my $module_repo_name = get_var("REPO_SLE${version}_MODULE_${repo_name}", "$prefix-Module-$full_name-POOL-$arch-Build$build-Media1");
my $url = "$utils::OPENQA_FTP_URL/$module_repo_name";
# Verify if url exists before adding
if (head($url)) {
set_var('ADDONURL_' . uc $short_name, "$utils::OPENQA_FTP_URL/$module_repo_name");
$addonurl .= "$short_name,";
}
}
#remove last comma from ADDONURL setting value
$addonurl =~ s/,$//;
set_var("ADDONURL", $addonurl);
}
}

if (get_var('ENABLE_ALL_SCC_MODULES') && !get_var('SCC_MODULES')) {
Expand Down Expand Up @@ -566,8 +591,8 @@ sub load_inst_tests {
loadtest "installation/disk_space_fill";
}
}
if (sle_version_at_least('15') && !is_staging()) {
loadtest "installation/select_products_sle";
if (sle_version_at_least('15')) {
loadtest "installation/select_products_sle" unless is_staging();
loadtest "installation/accept_license" if get_var('HASLICENSE');
}
if (check_var('SCC_REGISTER', 'installation')) {
Expand Down
19 changes: 16 additions & 3 deletions tests/installation/welcome.pm
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,22 @@ sub run {
mouse_hide;
wait_still_screen(3);

# license+lang
# On sle 15 license is on different screen
if (!sle_version_at_least('15') || is_staging()) {
# license+lang +product (on sle15)
# On sle 15 license is on different screen, here select the product
if (sle_version_at_least('15')) {
if (check_var('STAGING', 'Y')) {
assert_screen('select-product');
my %hotkey = (
sles => 'u',
sled => 'i',
leanos => 's'
);
my $product = get_required_var('SLE_PRODUCT');
send_key 'alt-' . $hotkey{$product};
assert_screen('select-product-' . $product);
}
}
else {
$self->verify_license_has_to_be_accepted;
}

Expand Down