Skip to content

Commit

Permalink
Use zypper ref -s on LeapMicro 6.0 toolbox
Browse files Browse the repository at this point in the history
* Repos are managed by a local RIS, you need to use ref -s for the
  first time refresh
  • Loading branch information
lkocman committed Jun 11, 2024
1 parent 115e3ac commit dbbdd57
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/microos/toolbox.pm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ use strict;
use warnings;
use testapi;
use containers::common;
use version_utils 'is_sle_micro';
use version_utils qw(is_sle_micro is_leap_micro);


our $user = $testapi::username;
our $password = $testapi::password;
Expand Down Expand Up @@ -41,6 +42,11 @@ sub create_user {
}

sub toolbox_has_repos {
# Leap Micro 6.0 is using a local service managed repos.
# Service needs to get refreshed (ref -s) for a first time use
if (is_leap_micro('>=6.0')) {
assert_script_run 'toolbox -r -- zypper -n --gpg-auto-import-keys ref -s', timeout => 300;
}
my $output = script_output 'toolbox -r -- zypper lr -u', timeout => 180, proceed_on_failure => 1;
if ($output =~ m/No repositories defined/ && is_sle_micro('=6.0')) {
record_soft_failure 'bsc#1220648 - Toolbox container for SLE Micro 6.0 has limited functionality given that there are no repositories available';
Expand Down Expand Up @@ -109,7 +115,11 @@ sub run {
assert_script_run 'zypper lr -u', timeout => 300;
my $toolbox_has_repos = toolbox_has_repos();
if ($toolbox_has_repos) {
assert_script_run 'toolbox -r -- zypper -n ref', timeout => 300;
if (is_leap_micro('>=6.0')) {
assert_script_run 'toolbox -r -- zypper -n ref -s', timeout => 300;
} else {
assert_script_run 'toolbox -r -- zypper -n ref', timeout => 300;
}
if (script_run('toolbox -- zypper -n up 2>&1 | tee /var/tmp/toolbox_zypper_up.txt', timeout => 300) != 0) {
upload_logs('/var/tmp/toolbox_zypper_up.txt');
die "zypper up failed within toolbox";
Expand Down

0 comments on commit dbbdd57

Please sign in to comment.