test: make sure that {readonly|inaccessible|readwrite}paths disconnect mount propagation

Better safe.
This commit is contained in:
Djalal Harouni
2016-09-25 19:50:25 +02:00
parent f78b36f016
commit cdfbd1fb26
5 changed files with 35 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
[Unit]
Description=Test to make sure that InaccessiblePaths= disconnect mount propagation
[Service]
InaccessiblePaths=-/i-dont-exist
ExecStart=/bin/sh -x -c 'mkdir -p /TEST; mount -t tmpfs tmpfs /TEST; grep TEST /proc/self/mountinfo && ! grep TEST /proc/$${PPID}/mountinfo && ! grep TEST /proc/1/mountinfo'
Type=oneshot

View File

@@ -0,0 +1,7 @@
[Unit]
Description=Test to make sure that passing ReadOnlyPaths= disconnect mount propagation
[Service]
ReadOnlyPaths=-/i-dont-exist
ExecStart=/bin/sh -x -c 'mkdir -p /TEST; mount -t tmpfs tmpfs /TEST; grep TEST /proc/self/mountinfo && ! grep TEST /proc/$${PPID}/mountinfo && ! grep TEST /proc/1/mountinfo'
Type=oneshot

View File

@@ -0,0 +1,7 @@
[Unit]
Description=Test to make sure that passing ReadWritePaths= disconnect mount propagation
[Service]
ReadWritePaths=-/i-dont-exist
ExecStart=/bin/sh -x -c 'mkdir -p /TEST; mount -t tmpfs tmpfs /TEST; grep TEST /proc/self/mountinfo && ! grep TEST /proc/$${PPID}/mountinfo && ! grep TEST /proc/1/mountinfo'
Type=oneshot