Skip to content

Commit

Permalink
virt_autotest: enhancement for 15sp6 s390x kvm tests
Browse files Browse the repository at this point in the history
  • Loading branch information
guoxuguang authored and alice-suse committed Jan 12, 2024
1 parent cc4a10d commit 4e6695c
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 28 deletions.
6 changes: 4 additions & 2 deletions products/sle/main.pm
Original file line number Diff line number Diff line change
Expand Up @@ -863,8 +863,10 @@ elsif (get_var("VIRT_AUTOTEST")) {
loadtest "virt_autotest/login_console";
loadtest "virt_autotest/install_package";
loadtest "virt_autotest/update_package";
loadtest "virt_autotest/reset_partition";
loadtest "virt_autotest/reboot_and_wait_up_normal" if (!get_var('AUTOYAST') && get_var('REPO_0_TO_INSTALL'));
# Skip reset_partition for s390x due to there just be 42Gib disk space for each s390x LPAR
loadtest "virt_autotest/reset_partition" if (!is_s390x);
# Skip reboot_and_wait_up_normal for s390x due to new changes from svirt backend for power_action_utils::power_action (see poo#151786)
loadtest "virt_autotest/reboot_and_wait_up_normal" if (!get_var('AUTOYAST') && get_var('REPO_0_TO_INSTALL') && (!is_s390x));
loadtest "virt_autotest/download_guest_assets" if get_var("SKIP_GUEST_INSTALL") && is_x86_64;
}
if (get_var("VIRT_PRJ1_GUEST_INSTALL")) {
Expand Down
13 changes: 11 additions & 2 deletions tests/virt_autotest/guest_installation_run.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SUSE's openQA tests
#
# Copyright 2012-2016 SUSE LLC
# Copyright 2012-2024 SUSE LLC
# SPDX-License-Identifier: FSFAP
#
# Summary: guest_installation_run: This test is used to verify if different products can be installed successfully as guest on specify host.
Expand All @@ -16,7 +16,9 @@ use virt_utils;
sub get_script_run {
my $pre_test_cmd = "";
if (is_s390x) {
$pre_test_cmd = "/usr/share/qa/tools/test_virtualization-virt_install_withopt-run";
#Use pipefail to keep the correct returns from test_virtualization-virt_install_withopt-run
$pre_test_cmd = "set -o pipefail;";
$pre_test_cmd .= "/usr/share/qa/tools/test_virtualization-virt_install_withopt-run";
}
else {
my $prd_version = script_output("cat /etc/issue");
Expand All @@ -33,6 +35,7 @@ sub get_script_run {
my $parallel_num = get_var("PARALLEL_NUM", "2");

$pre_test_cmd = $pre_test_cmd . " -f " . $guest_pattern . " -n " . $parallel_num . " -r ";
$pre_test_cmd .= " 2>&1 | tee /tmp/s390x_guest_install_test.log" if (is_s390x);

return $pre_test_cmd;
}
Expand Down Expand Up @@ -87,6 +90,12 @@ sub run {
}

$self->run_test(7600, "", "yes", "yes", "/var/log/qa/", "guest-installation-logs", $upload_guest_assets_flag);
#upload testing logs for s390x guest installation test
if (is_s390x) {
#upload s390x_guest_install_test.log
upload_asset("/tmp/s390x_guest_install_test.log", 1, 1);
lpar_cmd("rm -r /tmp/s390x_guest_install_test.log");
}
}

1;
Expand Down
21 changes: 9 additions & 12 deletions tests/virt_autotest/guest_upgrade_run.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SUSE's openQA tests
#
# Copyright 2016 SUSE LLC
# Copyright 2016-2024 SUSE LLC
# SPDX-License-Identifier: FSFAP
#
# Summary: This test verifies whether on host installed with specific product, the guests can successfully upgrade to the target upgrade product.
Expand Down Expand Up @@ -44,6 +44,12 @@ sub get_script_run {
my $guest_list = get_required_var("GUEST_LIST");

$pre_test_cmd = "$pre_test_cmd -p $product_upgrade -r $product_upgrade_repo -g \"$guest_list\"";
my $do_registration = check_var('GUEST_SCC_REGISTER', 'installation') ? "true" : "false";
my $registration_server = get_var('SCC_URL', 'https://scc.suse.com');
my $registration_code = get_var('SCC_REGCODE', 'INVALID_REGCODE');
$pre_test_cmd .= " -e $do_registration";
$pre_test_cmd .= " -s $registration_server";
$pre_test_cmd .= " -c $registration_code";
if (is_s390x) {
$pre_test_cmd .= " 2>&1 | tee /tmp/s390x_guest_upgrade_test.log";
} else {
Expand All @@ -53,13 +59,6 @@ sub get_script_run {
$pre_test_cmd .= " -k $vm_xml_dir";
}

my $do_registration = check_var('GUEST_SCC_REGISTER', 'installation') ? "true" : "false";
my $registration_server = get_var('SCC_URL', 'https://scc.suse.com');
my $registration_code = get_var('SCC_REGCODE', 'INVALID_REGCODE');
$pre_test_cmd .= " -e $do_registration";
$pre_test_cmd .= " -s $registration_server";
$pre_test_cmd .= " -c $registration_code";

return $pre_test_cmd;
}

Expand Down Expand Up @@ -140,8 +139,7 @@ sub run {
if (is_s390x) {
#upload s390x_guest_upgrade_test.log
upload_asset("/tmp/s390x_guest_upgrade_test.log", 1, 1);
#ues die_on_timeout=> 0 as workaround for s390x test during call script_run, refer to poo#106765
script_run "rm -rf /tmp/s390x_guest_upgrade_test.log", die_on_timeout => 0;
lpar_cmd("rm -rf /tmp/s390x_guest_upgrade_test.log");
}

}
Expand All @@ -154,8 +152,7 @@ sub post_fail_hook {
if (is_s390x) {
#upload s390x_guest_upgrade_test.log
upload_asset("/tmp/s390x_guest_upgrade_test.log", 1, 1);
#ues die_on_timeout=> 0 as workaround for s390x test during call script_run, refer to poo#106765
script_run "rm -rf /tmp/s390x_guest_upgrade_test.log", die_on_timeout => 0;
lpar_cmd("rm -rf /tmp/s390x_guest_upgrade_test.log");
}
}

Expand Down
23 changes: 11 additions & 12 deletions tests/virt_autotest/update_package.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SUSE's openQA tests
#
# Copyright 2016 SUSE LLC
# Copyright 2016-2024 SUSE LLC
# SPDX-License-Identifier: FSFAP
#
package update_package;
Expand Down Expand Up @@ -49,12 +49,12 @@ sub run {
my $self = shift;
#workaroud: skip update package for registered aarch64 tests and because there are conflicts on sles15sp2 XEN
$self->update_package() unless (!!get_var('AUTOYAST') || is_registered_sles && is_aarch64);
unless (!!get_var('AUTOYAST') || (is_registered_sles && is_aarch64) || is_s390x) {
set_grub_on_vh('', '', 'xen') if is_xen_host;
set_grub_on_vh('', '', 'kvm') if is_kvm_host;
} else {
if (!!get_var('AUTOYAST') || (is_registered_sles && is_aarch64)) {
my @files_to_upload = ("/boot/grub2/grub.cfg", "/etc/default/grub");
upload_logs($_, failok => 1) foreach (@files_to_upload);
} elsif (!is_s390x) {
set_grub_on_vh('', '', 'xen') if is_xen_host;
set_grub_on_vh('', '', 'kvm') if is_kvm_host;
}
update_guest_configurations_with_daily_build();

Expand All @@ -64,16 +64,15 @@ sub run {
#workaround of bsc#1177790
#disable DNSSEC validation as it is turned on by default but the forwarders donnot support it, refer to bsc#1177790
if (is_sle('>=12-sp5')) {
#ues die_on_timeout=> 0 as workaround for s390x test during call script_run, refer to poo#106765
my %args = ();
if (is_s390x) {
$args{die_on_timeout} = 0;
lpar_cmd("sed -i 's/#dnssec-validation auto;/dnssec-validation no;/g' /etc/named.conf");
lpar_cmd("grep 'dnssec-validation' /etc/named.conf");
lpar_cmd("systemctl restart named");
} else {
$args{die_on_timeout} = 1;
script_run "sed -i 's/#dnssec-validation auto;/dnssec-validation no;/g' /etc/named.conf";
script_run "grep 'dnssec-validation' /etc/named.conf";
script_run "systemctl restart named";
}
script_run "sed -i 's/#dnssec-validation auto;/dnssec-validation no;/g' /etc/named.conf", %args;
script_run "grep 'dnssec-validation' /etc/named.conf", %args;
script_run "systemctl restart named", %args;
save_screenshot;
}

Expand Down

0 comments on commit 4e6695c

Please sign in to comment.