Skip to content

Commit

Permalink
Toolbox: run zypper commands when running toolbox as rootfull os-auto…
Browse files Browse the repository at this point in the history
…inst#18767

If we run it in rootless mode, it will only work if it contains
any default repository (like SLE_BCI for SLE Micro <=5.5 rootles containers).
Otherwise, this call will fail because rootless user can't inherit repos
from the host.
  • Loading branch information
jlausuch committed Feb 28, 2024
1 parent 90f1e26 commit 7174ead
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/microos/toolbox.pm
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,13 @@ sub run {
assert_script_run 'toolbox -r touch /etc/passwd', fail_message => 'Root should have access to /etc/passwd!';
assert_script_run 'podman ps -a';

# toolbox will only inherit repos from the host when run as rootfull (or root)
# rootless user doesn't have access to /etc/zypp/credentials.d/SCCcredentials
record_info 'Test', "Update toolbox";
assert_script_run('set -o pipefail');
assert_script_run('toolbox -- zypper -n ref', timeout => 300);
assert_script_run('toolbox -r -- zypper -n ref', timeout => 300);
# Test for bsc#1210587
if (script_run('toolbox -- zypper -n up 2>&1 > /var/tmp/toolbox_zypper_up.txt', timeout => 300) != 0) {
if (script_run('toolbox -r -- zypper -n up 2>&1 > /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 7174ead

Please sign in to comment.