summaryrefslogtreecommitdiffstats
path: root/test/units/testsuite-50.sh
diff options
context:
space:
mode:
authorLuca Boccassi <bluca@debian.org>2023-09-29 02:50:15 +0200
committerLuca Boccassi <luca.boccassi@gmail.com>2023-10-16 15:33:47 +0200
commit7c83d42ef8c875018918615599a4fecc3e4fbe6d (patch)
tree608b735c213a97d0548525ba068692071a03d610 /test/units/testsuite-50.sh
parentMerge pull request #29548 from poettering/sysext-varlink (diff)
downloadsystemd-7c83d42ef8c875018918615599a4fecc3e4fbe6d.tar.xz
systemd-7c83d42ef8c875018918615599a4fecc3e4fbe6d.zip
mount-util: use mount beneath to replace previous namespace mount
Instead of mounting over, do an atomic swap using mount beneath, if available. This way assets can be mounted again and again (e.g.: updates) without leaking mounts.
Diffstat (limited to '')
-rwxr-xr-xtest/units/testsuite-50.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/units/testsuite-50.sh b/test/units/testsuite-50.sh
index 3a719d2059..4142e1ebbc 100755
--- a/test/units/testsuite-50.sh
+++ b/test/units/testsuite-50.sh
@@ -363,6 +363,11 @@ ExecStart=/bin/sh -c ' \\
EOF
systemctl start testservice-50d.service
+# Mount twice to exercise mount-beneath (on kernel 6.5+, on older kernels it will just overmount)
+mkdir -p /tmp/wrong/foo
+mksquashfs /tmp/wrong/foo /tmp/wrong.raw
+systemctl mount-image --mkdir testservice-50d.service /tmp/wrong.raw /tmp/img
+test "$(systemctl show -P SubState testservice-50d.service)" = "running"
systemctl mount-image --mkdir testservice-50d.service "${image}.raw" /tmp/img root:nosuid
while systemctl show -P SubState testservice-50d.service | grep -q running