From 8e3a6f68730d02b4744f90c7b351cb5cd19cb405 Mon Sep 17 00:00:00 2001 From: rfan1 Date: Mon, 29 Jul 2024 06:27:07 -0400 Subject: [PATCH] Handle patch installation with all new packages https://progress.opensuse.org/issues/164592 --- tests/console/install_packages.pm | 8 +++++++- tests/console/qam_zypper_patch.pm | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/console/install_packages.pm b/tests/console/install_packages.pm index 105ba3b0599e..9d48db5aebee 100644 --- a/tests/console/install_packages.pm +++ b/tests/console/install_packages.pm @@ -22,7 +22,13 @@ sub run { zypper_call('in -l perl-solv perl-Data-Dump'); my $ex = script_run("~$username/data/lsmfip --verbose $packages > \$XDG_RUNTIME_DIR/install_packages.txt 2> /tmp/lsmfip.log"); upload_logs '/tmp/lsmfip.log'; - die "lsmfip failed" if $ex; + if ($ex) { + if (script_output('tail -1 /tmp/lsmfip.log') =~ /was requested but nothing was installed/) { + record_info('The packages to be released are new ones', 'We do not need to install older packages before'); + return; + } + die "lsmfip failed"; + } # make sure we install at least one package - otherwise this test is pointless # better have it fail and let a reviewer check the reason assert_script_run("test -s \$XDG_RUNTIME_DIR/install_packages.txt"); diff --git a/tests/console/qam_zypper_patch.pm b/tests/console/qam_zypper_patch.pm index fe9a75a0a4ad..faf62aeb5700 100644 --- a/tests/console/qam_zypper_patch.pm +++ b/tests/console/qam_zypper_patch.pm @@ -14,6 +14,14 @@ use serial_terminal 'select_serial_terminal'; sub run { select_serial_terminal; + if (script_run("test -s \$XDG_RUNTIME_DIR/install_packages.txt") != 0) { + record_info('The packages to be released are new ones', 'We need to install them via zypper'); + my $packages = get_var("INSTALL_PACKAGES"); + script_run("echo $packages > \$XDG_RUNTIME_DIR/install_packages.txt"); + assert_script_run("xargs --no-run-if-empty zypper -n in -l < \$XDG_RUNTIME_DIR/install_packages.txt", 1400); + return; + } + # NVIDIA repo needs new signing key, see poo#163094 my $sign_key = get_var('BUILD') =~ /openSUSE-repos/ ? '--gpg-auto-import-keys' : ''; zypper_call("$sign_key in -l -t patch " . get_var('INCIDENT_PATCH'), exitcode => [0, 102, 103], timeout => 1400);