Skip to content

Commit

Permalink
Merge branch 'os-autoinst:master' into nanzhg/add_support_for_sle-mic…
Browse files Browse the repository at this point in the history
…ro_6.0
  • Loading branch information
nanzhg committed May 11, 2024
2 parents 792c5a4 + 5dc6439 commit 9827bc8
Show file tree
Hide file tree
Showing 20 changed files with 140 additions and 179 deletions.
5 changes: 2 additions & 3 deletions data/publiccloud/restart_instance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ wait_for_power_off()
tries=$((tries - 1))
[ "$tries" -lt 1 ] && return 1;
echo "waiting for power off"
sleep 1;
sleep 1
done
return 0;
}

wait_for_power_on()
Expand All @@ -32,7 +31,6 @@ wait_for_power_on()
echo "waiting for power on"
sleep 1;
done
return 0;
}

if [ $# -lt 3 ]; then
Expand Down Expand Up @@ -71,6 +69,7 @@ esac
wait_for_power_off "$HOST" "$CNT"
wait_for_power_on "$HOST" "$CNT"
echo "Instance $INSTANCE_ID restarted";
sleep 5 # need pause for slow SUT to fully initialize sshd
## Not needed, because the log_instance.sh does not depend on the running instance
## Leaving it here in case we need to revert it. If no issues arise, this can be
## removed after some time.
Expand Down
33 changes: 29 additions & 4 deletions lib/publiccloud/instance.pm
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,31 @@ sub upload_log {
assert_script_run("test -d '$tmpdir' && rm -rf '$tmpdir'");
}

=head2 upload_check_logs_tar
upload_check_logs_tar(@files);
Check remote log files status and upload tar.gz of only ok logs, to oqa UI.
Input: C<@files> full-path-files array;
Return C<1> true explicit, as stateless and never impact calling code.
=cut

sub upload_check_logs_tar {
my ($self, @files) = @_;
my $remote_tar = $autotest::current_test->{name};
$remote_tar = "/tmp/" . $remote_tar . "_logs.tar.gz";
my $res = $self->ssh_script_output(cmd => 'sudo ls ' . join(' ', @files) . ' 2>/dev/null', proceed_on_failure => 1);
return 1 unless ($res);

# Upload existing logs to openqa UI
$res = $self->ssh_script_run(cmd => "sudo tar -czvf $remote_tar $res", proceed_on_failure => 1);
$self->upload_log("$remote_tar", log_name => basename($remote_tar), failok => 1) if ($res);
return 1;
}

=head2 wait_for_guestregister
wait_for_guestregister([timeout => 300]);
Expand Down Expand Up @@ -616,12 +641,12 @@ sub measure_boottime() {
$ret->{kernel_release} = $instance->run_ssh_command(cmd => 'uname -r', proceed_on_failure => 1);
$ret->{kernel_version} = $instance->run_ssh_command(cmd => 'uname -v', proceed_on_failure => 1);

# Do logging to openqa UI
$Data::Dumper::Sortkeys = 1;
record_info("RESULTS", Dumper($ret));
my $dir = "/var/log";
my @logs = qw(cloudregister cloud-init.log cloud-init-output.log messages NetworkManager);
$instance->run_ssh_command(cmd => 'sudo chmod a+r ' . join(' ', map { "/var/log/$_" } @logs));
$instance->upload_log("/var/log/" . $_, log_name => 'measure_boottime_' . $_ . '.txt', failok => 1) foreach (@logs);
$instance->upload_check_logs_tar(map { "$dir/$_" } @logs);

record_info("RESULTS", Dumper($ret));
return $ret;
}

Expand Down
6 changes: 6 additions & 0 deletions schedule/microos/networkmanager.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
description: 'NetworkManager test suite for Micro-os'
name: 'microos_networkmanager@x86_64'
schedule:
- microos/disk_boot
- microos/networkmanager
6 changes: 6 additions & 0 deletions schedule/sles4sap/hana/pvm_hana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ conditional_schedule:
15-SP5:
- installation/system_role
- installation/sles4sap_product_installation_mode
15-SP6:
- installation/system_role
- installation/sles4sap_product_installation_mode
15-SP7:
- installation/system_role
- installation/sles4sap_product_installation_mode
sles4sap12_desktop:
VERSION:
12-SP2:
Expand Down
6 changes: 6 additions & 0 deletions schedule/sles4sap/hana/pvm_hana_cluster_node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ conditional_schedule:
15-SP5:
- installation/system_role
- installation/sles4sap_product_installation_mode
15-SP6:
- installation/system_role
- installation/sles4sap_product_installation_mode
15-SP7:
- installation/system_role
- installation/sles4sap_product_installation_mode
sles4sap12_desktop:
VERSION:
12-SP2:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ test_data:
- language: Czech
text: Licenční smlouva s koncovým uživatelem
- language: English (US)
text: End User License Agreement for SUSE Products
text: End User License Agreement for SUSE Software
- language: French
text: Contrat de licence utilisateur final
- language: German
Expand All @@ -57,13 +57,13 @@ test_data:
- language: Japanese
text: エンドユーザ使用許諾契約
- language: Korean
text: SUSE 제품에 관한
text: SUSE 소프트웨어
- language: Portuguese (Brazilian)
text: Contrato de Licença para Usuário Final
- language: Russian
text: Лицензионное соглашение
- language: Simplified Chinese
text: SUSE 产品
text: SUSE 软件
- language: Spanish
text: Acuerdo de licencia de usuario final
- language: Traditional Chinese
Expand Down
45 changes: 0 additions & 45 deletions schedule/yast/sle/flows/default_sle15sp4_beta_s390x_kvm.yaml

This file was deleted.

51 changes: 0 additions & 51 deletions schedule/yast/sle/flows/default_sle15sp4_beta_x86.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ license:
- language: Czech
text: Licenční smlouva s koncovým uživatelem
- language: English (US)
text: End User License Agreement for SUSE Products
text: End User License Agreement for SUSE Software
- language: French
text: Contrat de licence utilisateur final
- language: German
Expand All @@ -15,13 +15,13 @@ license:
- language: Japanese
text: エンドユーザ使用許諾契約
- language: Korean
text: SUSE 제품에 관한
text: SUSE 소프트웨어
- language: Portuguese (Brazilian)
text: Contrato de Licença para Usuário Final
- language: Russian
text: Лицензионное соглашение
- language: Simplified Chinese
text: SUSE 产品
text: SUSE 软件
- language: Spanish
text: Acuerdo de licencia de usuario final
- language: Traditional Chinese
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ license:
- language: Czech
text: Licenční smlouva s koncovým uživatelem
- language: English (US)
text: End User License Agreement for SUSE Products
text: End User License Agreement for SUSE Software
- language: French
text: Contrat de licence utilisateur final
- language: German
Expand All @@ -15,13 +15,13 @@ license:
- language: Japanese
text: エンドユーザ使用許諾契約
- language: Korean
text: SUSE 제품에 관한
text: SUSE 소프트웨어
- language: Portuguese (Brazilian)
text: Contrato de Licença para Usuário Final
- language: Russian
text: Лицензионное соглашение
- language: Simplified Chinese
text: SUSE 产品
text: SUSE 软件
- language: Spanish
text: Acuerdo de licencia de usuario final
- language: Traditional Chinese
Expand Down
7 changes: 4 additions & 3 deletions tests/console/bind.pm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use version_utils qw(package_version_cmp);

sub run {
select_serial_terminal;
add_suseconnect_product(get_addon_fullname('phub')) if is_sle('15-SP4+');
add_suseconnect_product(get_addon_fullname('phub')) if is_sle('15-SP2+');
if (is_sle('<=12-SP5')) {
# preinstall libopenssl-devel & libmysqlclient-devel because on 12* are multiple versions and zypper can't decide,
# perl-IO-Socket-INET6 for reclimit test
Expand Down Expand Up @@ -79,9 +79,9 @@ sub run {
assert_script_run 'runuser -u bernhard -- sh runall.sh -n', 7000;
};
if ($@) {
record_info 'Retry:', 'poo#71329';
for (1 .. 3) {
eval {
record_info 'Retry: poo#71329';
if (package_version_cmp($bind_version, '9.18.24') < 0) {
assert_script_run 'TFAIL=$(awk -F: -e \'/^R:.*:FAIL/ {print$2}\' systests.output)';
assert_script_run 'for t in $TFAIL; do runuser -u bernhard -- sh run.sh $t; done', 2000;
Expand All @@ -92,7 +92,8 @@ sub run {
}
};
last unless ($@);
record_info 'Retry', "Failed bind test retry: $_ of 3";
record_info "Retry $_", "Failed bind test retry: $_ of 3";
die 'bind testsuite failed, see log' if $@ && $_ == 3;
}
}
# remove loopback interfaces
Expand Down
4 changes: 2 additions & 2 deletions tests/containers/skopeo.pm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use Mojo::Base 'containers::basetest';
use testapi;
use serial_terminal 'select_serial_terminal'; # used in select_serial_terminal
use utils 'zypper_call'; # used in zypper_call
use version_utils 'is_transactional';
use version_utils qw(is_transactional is_vmware);
use transactional;
use containers::common qw(install_packages);

Expand All @@ -21,7 +21,7 @@ sub run {
# Required packages
my @packages = qw(skopeo jq);

select_serial_terminal(); # Select most suitable text console
select_serial_terminal() unless is_vmware; # Select most suitable text console

# Set a variable for my remote image
my $remote_image = 'registry.suse.com/bci/bci-busybox:latest';
Expand Down
8 changes: 4 additions & 4 deletions tests/nfs/generate_report.pm
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ use testapi;
use serial_terminal 'select_serial_terminal';
use upload_system_log;

sub display_results {
sub display_pynfs_results {
my $self = shift;
my $skip = "";
my $pass = "";
my $fail = 0;

my $folder = get_required_var('PYNFS');
my $version = get_required_var('NFSVERSION');

assert_script_run("cd ~/pynfs/$folder");
assert_script_run("cd ~/pynfs/nfs$version");
upload_logs('results.json', failok => 1);

my $content = script_output('cat results.json');
Expand Down Expand Up @@ -104,7 +104,7 @@ sub run {
select_serial_terminal;

if (get_var("PYNFS")) {
$self->display_results();
$self->display_pynfs_results();
}
elsif (get_var("CTHON04")) {
$self->upload_cthon04_log();
Expand Down

0 comments on commit 9827bc8

Please sign in to comment.