Skip to content

Commit

Permalink
SLE 12 conflict workaround with expect
Browse files Browse the repository at this point in the history
  • Loading branch information
dzedro committed Nov 16, 2023
1 parent 76709b1 commit 2335e23
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/qam-updinstall/update_install.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 2335e23

Please sign in to comment.