1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-27 10:25:37 +03:00

test: ensure ProtectProc=invisible retains host submounts

This commit is contained in:
Lennart Poettering 2023-06-23 18:27:45 +02:00
parent fb0e106f8e
commit 5ca8d2474c

View File

@ -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"