]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: ensure ProtectProc=invisible retains host submounts 28144/head
authorLennart Poettering <lennart@poettering.net>
Fri, 23 Jun 2023 16:27:45 +0000 (18:27 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 23 Jun 2023 16:32:40 +0000 (18:32 +0200)
test/units/testsuite-74.run.sh

index cab524a0e71ac71c3fe5bf456b1ad820f4d8c4ed..2caca7a5a2ac00cfbe72491433a757bb33b4a706 100755 (executable)
@@ -211,3 +211,21 @@ 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"
+
+umount /proc/version
+rm "$V"