]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - test/units/testsuite-74.run.sh
Merge pull request #30284 from YHNdnzj/fstab-wantedby-defaultdeps
[thirdparty/systemd.git] / test / units / testsuite-74.run.sh
index cab524a0e71ac71c3fe5bf456b1ad820f4d8c4ed..d43d17ca6124a05a77414da48db8ac691d61721d 100755 (executable)
@@ -211,3 +211,25 @@ for opt in nice on-{active,boot,calendar,startup,unit-active,unit-inactive} prop
     (! systemd-run "--$opt=" true)
     (! systemd-run "--$opt=''" true)
 done
+
+# Let's make sure that ProtectProc= properly moves submounts of the original /proc over to the new proc
+
+A=$(cat /proc/sys/kernel/random/boot_id)
+B=$(systemd-run -q --wait --pipe -p ProtectProc=invisible cat /proc/sys/kernel/random/boot_id)
+assert_eq "$A" "$B"
+
+V="/tmp/version.$RANDOM"
+A="$(cat /proc/version).piff"
+echo "$A" > "$V"
+mount --bind "$V" /proc/version
+
+B=$(systemd-run -q --wait --pipe -p ProtectProc=invisible cat /proc/version)
+
+assert_eq "$A" "$B"
+
+# Check that invoking the tool under the uid0 alias name works
+uid0 ls /
+echo "$(uid0 echo foo)" = "foo"
+
+umount /proc/version
+rm "$V"