summaryrefslogtreecommitdiff
path: root/test/units/testsuite-43.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/units/testsuite-43.sh')
-rwxr-xr-xtest/units/testsuite-43.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/units/testsuite-43.sh b/test/units/testsuite-43.sh
index 3efe419377..cda1fe1fda 100755
--- a/test/units/testsuite-43.sh
+++ b/test/units/testsuite-43.sh
@@ -68,6 +68,24 @@ runas testuser systemd-run --wait --user --unit=test-group-fail \
-P true \
&& { echo 'unexpected success'; exit 1; }
+# Check that with a new user namespace we can bind mount
+# files and use a different root directory
+runas testuser systemd-run --wait --user --unit=test-bind-mount \
+ -p PrivateUsers=yes -p BindPaths=/dev/null:/etc/os-release \
+ test ! -s /etc/os-release
+
+unsquashfs -no-xattrs -d /tmp/img /usr/share/minimal_0.raw
+runas testuser systemd-run --wait --user --unit=test-root-dir \
+ -p PrivateUsers=yes -p RootDirectory=/tmp/img \
+ grep MARKER=1 /etc/os-release
+
+mkdir /tmp/img_bind
+mount --bind /tmp/img /tmp/img_bind
+runas testuser systemd-run --wait --user --unit=test-root-dir-bind \
+ -p PrivateUsers=yes -p RootDirectory=/tmp/img_bind \
+ grep MARKER=1 /etc/os-release
+umount /tmp/img_bind
+
systemd-analyze log-level info
echo OK >/testok