Skip to content

Commit

Permalink
Scope package installation in container
Browse files Browse the repository at this point in the history
If proxy scc is used and the container is based on different version of
SLE the repo URLs inside of container are invalid.

HyperV does not has `/dev/bus` as xen pv.
  • Loading branch information
mloviska committed Oct 26, 2023
1 parent 68dc6d7 commit bc2dcbe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/containers/privileged_mode.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use serial_terminal 'select_serial_terminal';
use utils qw(validate_script_output_retry);
use containers::utils qw(reset_container_network_if_needed);
use Utils::Architectures;
use Utils::Backends qw(is_xen_pv);
use Utils::Backends qw(is_xen_pv is_hyperv);
use version_utils qw(is_public_cloud is_sle);
use utils qw(script_retry);

Expand All @@ -35,7 +35,7 @@ sub run {
# xen-pv does not define USB passthrough in the xml as of now
# this feature has to be added -> https://progress.opensuse.org/issues/138410
assert_script_run("$runtime run --rm $image bash -c '! test -d /dev/bus'");
assert_script_run("$runtime run --rm --privileged $image ls /dev/bus") unless (is_s390x || is_public_cloud || is_xen_pv);
assert_script_run("$runtime run --rm --privileged $image ls /dev/bus") unless (is_s390x || is_public_cloud || is_xen_pv || is_hyperv);

# Mounting tmpfs only works in privileged mode because the read-only protection in the default mode
assert_script_run("$runtime run --rm --privileged $image mount -t tmpfs none /mnt");
Expand All @@ -46,7 +46,7 @@ sub run {

# Podman inside the container
assert_script_run("$runtime run -d --privileged --name outer-container $image sleep 100000");
assert_script_run("$runtime exec outer-container zypper in -y podman");
assert_script_run("$runtime exec outer-container zypper in -r SLE_BCI -y podman");
# overlayfs can be used starting with kernel 4.18 by unprivileged users in an user namespace
assert_script_run("$runtime exec outer-container podman run -it $image ls") unless is_sle('=15-SP1');
}
Expand Down

0 comments on commit bc2dcbe

Please sign in to comment.