Merge pull request #9977 from sourcejedi/no-remount-superblock3
Namespace fixes
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
Description=Test for ReadOnlyPaths=
|
||||
|
||||
[Service]
|
||||
ReadOnlyPaths=/etc -/i-dont-exist /usr
|
||||
ExecStart=/bin/sh -x -c 'test ! -w /etc && test ! -w /usr && test ! -e /i-dont-exist && test -w /var'
|
||||
ReadOnlyPaths=/usr /etc /sys /dev -/i-dont-exist
|
||||
PrivateDevices=yes
|
||||
ExecStart=/bin/sh -x -c 'test ! -w /usr && test ! -w /etc && test ! -w /sys && test ! -w /sys/fs/cgroup'
|
||||
ExecStart=/bin/sh -x -c 'test ! -w /dev && test ! -w /dev/shm && test ! -e /i-dont-exist && test -w /var'
|
||||
Type=oneshot
|
||||
|
||||
@@ -5,11 +5,10 @@ Description=Test for TemporaryFileSystem with mount options
|
||||
Type=oneshot
|
||||
|
||||
# The mount options default to "mode=0755,nodev,strictatime".
|
||||
# Let's override some of them, and test the behaviour of "ro".
|
||||
# Let's override some of them, and test "ro".
|
||||
TemporaryFileSystem=/var:ro,mode=0700,nostrictatime
|
||||
|
||||
# Check /proc/self/mountinfo
|
||||
ExecStart=/bin/sh -x -c 'test "$$(awk \'$$5 == "/var" && $$11 !~ /(^|,)ro(,|$$)/ { print $$6 }\' /proc/self/mountinfo)" = ""'
|
||||
ExecStart=/bin/sh -x -c 'test "$$(awk \'$$5 == "/var" && $$11 !~ /(^|,)mode=700(,|$$)/ { print $$6 }\' /proc/self/mountinfo)" = ""'
|
||||
|
||||
ExecStart=/bin/sh -x -c 'test "$$(awk \'$$5 == "/var" && $$6 !~ /(^|,)ro(,|$$)/ { print $$6 }\' /proc/self/mountinfo)" = ""'
|
||||
|
||||
@@ -10,6 +10,9 @@ ExecStart=/bin/sh -c 'test -d /var/test-exec-temporaryfilesystem/rw && test -d /
|
||||
# Check TemporaryFileSystem= are empty
|
||||
ExecStart=/bin/sh -c 'for i in $$(ls -A /var); do test $$i = test-exec-temporaryfilesystem || false; done'
|
||||
|
||||
# Check default mode
|
||||
ExecStart=sh -x -c 'test "$$(stat -c %%a /var)" = "755"'
|
||||
|
||||
# Cannot create a file in /var
|
||||
ExecStart=/bin/sh -c '! touch /var/hoge'
|
||||
|
||||
|
||||
@@ -10,6 +10,9 @@ ExecStart=test -d /var/test-exec-temporaryfilesystem/rw -a -d /var/test-exec-tem
|
||||
# Check TemporaryFileSystem= are empty
|
||||
ExecStart=sh -c 'for i in $$(ls -A /var); do test $$i = test-exec-temporaryfilesystem || false; done'
|
||||
|
||||
# Check default mode
|
||||
ExecStart=sh -x -c 'test "$$(stat -c %%a /var)" = "755"'
|
||||
|
||||
# Create a file in /var
|
||||
ExecStart=touch /var/hoge
|
||||
|
||||
|
||||
Reference in New Issue
Block a user