From 68183b07d634622bce28a06e068e0e6f595b3d36 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Fri, 9 Jun 2023 12:45:23 +0200 Subject: [PATCH] test/upgrade: correctly share mounts between host and container A c/storage PR[1] chnage the behavior to correctly report umount errors. This is causing problem in the updgrade tests. The problem is that a cotnainer is mounted inside another container and then unmounted on the host. Therefore both operations happen in different mount namespaces. this is expcted but we want to share the mounts between them. This is the default but c/stroage make the root private by default thus the mounts were not shared. To fix this use the `skip_mount_home` storage option so the mount is kept shared. [1] https://github.com/containers/storage/pull/1607 Signed-off-by: Paul Holzinger --- test/upgrade/test-upgrade.bats | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/upgrade/test-upgrade.bats b/test/upgrade/test-upgrade.bats index 2b44a77b6e..2b625eb19e 100644 --- a/test/upgrade/test-upgrade.bats +++ b/test/upgrade/test-upgrade.bats @@ -43,7 +43,9 @@ setup() { fi # cgroup-manager=systemd does not work inside a container - export _PODMAN_TEST_OPTS="--cgroup-manager=cgroupfs --root=$PODMAN_UPGRADE_WORKDIR/root --runroot=$PODMAN_UPGRADE_WORKDIR/runroot --tmpdir=$PODMAN_UPGRADE_WORKDIR/tmp" + # skip_mount_home=true is required so we can share the storage mounts between host and container, + # the default c/storage behavior is to make the mount propagation private. + export _PODMAN_TEST_OPTS="--storage-opt=skip_mount_home=true --cgroup-manager=cgroupfs --root=$PODMAN_UPGRADE_WORKDIR/root --runroot=$PODMAN_UPGRADE_WORKDIR/runroot --tmpdir=$PODMAN_UPGRADE_WORKDIR/tmp" } ############################################################################### @@ -180,7 +182,7 @@ EOF -v /var/lib/cni:/var/lib/cni \ -v /etc/cni/net.d:/etc/cni/net.d \ -v /dev/shm:/dev/shm \ - -v $pmroot:$pmroot \ + -v $pmroot:$pmroot:rshared \ $OLD_PODMAN $pmroot/setup _PODMAN_TEST_OPTS= wait_for_ready podman_parent