From 2335e23b27f0e7f17f3762326b9cc1dd7916d951 Mon Sep 17 00:00:00 2001 From: Jozef Pupava Date: Thu, 16 Nov 2023 15:15:42 +0100 Subject: [PATCH] SLE 12 conflict workaround with expect --- tests/qam-updinstall/update_install.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/qam-updinstall/update_install.pm b/tests/qam-updinstall/update_install.pm index d30c58513ec8..fcc4a531026f 100644 --- a/tests/qam-updinstall/update_install.pm +++ b/tests/qam-updinstall/update_install.pm @@ -300,7 +300,9 @@ sub run { if (scalar(keys %installable)) { record_info 'Preinstall', 'Install affected packages before update repo is enabled'; - zypper_call("in -l " . join(' ', keys %installable), exitcode => [0, 102, 103], log => "prepare_$patch.log", timeout => 1500); + my $command = "zypper in -l " . join(' ', keys %installable); + enter_cmd "expect -c 'set timeout 60; spawn $command; sleep 20; expect \"Choose from\" { send 1\\r; exp_continue }; expect \"Continue\" { send y\\r; exp_continue }; expect \"# \"; interact'"; + #zypper_call("in -l " . join(' ', keys %installable), exitcode => [0, 102, 103], log => "prepare_$patch.log", timeout => 1500); } # Store the version of the installed binaries before the update. @@ -366,7 +368,8 @@ sub run { zypper_call("rm $_", exitcode => [0, 104], timeout => 500); } # update repos are disabled, zypper dup will downgrade packages from patch - zypper_call('dup --replacefiles -l', exitcode => [0, 8, 107]); + enter_cmd "expect -c 'set timeout 60; spawn zypper dup --replacefiles -l; expect \"Choose from\" { send 1\\r; exp_continue }; expect \"Continue\" { send y\\r; exp_continue }; expect \"# \"; interact'"; + #zypper_call('dup --replacefiles -l', exitcode => [0, 8, 107]); # remove patched packages with multiple versions installed e.g. kernel-source foreach (@patch_l3, @patch_l2) { zypper_call("rm $_-\$(zypper se -si $_|awk 'END{print\$7}')", exitcode => [0, 104]) if script_output("rpm -q $_|wc -l", proceed_on_failure => 1) >= 2;