diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-02-21 16:43:35 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-02-21 16:43:35 +0100 |
commit | 932329865741054f52dee2e7fc9bd6159b791fee (patch) | |
tree | e4546e23d4e7c62b5cbe444d3ddcab67df602999 /test/test-execute/exec-temporaryfilesystem-options.service | |
parent | missing_syscall: when adding syscall replacements, use different names (#8229) (diff) | |
download | systemd-932329865741054f52dee2e7fc9bd6159b791fee.tar.xz systemd-932329865741054f52dee2e7fc9bd6159b791fee.zip |
test: fix test for TemporaryFileSystem= (#8241)
This makes test-execute work on SELinux enabled systems.
Fixes the issue reported at
https://github.com/systemd/systemd/pull/7908#discussion_r169583540
Diffstat (limited to 'test/test-execute/exec-temporaryfilesystem-options.service')
-rw-r--r-- | test/test-execute/exec-temporaryfilesystem-options.service | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/test/test-execute/exec-temporaryfilesystem-options.service b/test/test-execute/exec-temporaryfilesystem-options.service index 1d5d76c81c..7b4f48c66a 100644 --- a/test/test-execute/exec-temporaryfilesystem-options.service +++ b/test/test-execute/exec-temporaryfilesystem-options.service @@ -4,8 +4,14 @@ Description=Test for TemporaryFileSystem with mount options [Service] Type=oneshot +# The mount options default to "mode=0755,nodev,strictatime". +# Let's override some of them, and test the behaviour of "ro". +TemporaryFileSystem=/var:ro,mode=0700,nostrictatime + # Check /proc/self/mountinfo -ExecStart=/bin/sh -c 'test $$(awk \'$$5 == "/var" { print $$6 }\' /proc/self/mountinfo) = "ro,nodev,relatime"' -ExecStart=/bin/sh -c 'test $$(awk \'$$5 == "/var" { print $$11 }\' /proc/self/mountinfo) = "ro,mode=700"' +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)" = ""' -TemporaryFileSystem=/var:ro,mode=0700,nostrictatime +ExecStart=/bin/sh -x -c 'test "$$(awk \'$$5 == "/var" && $$6 !~ /(^|,)ro(,|$)/ { print $$6 }\' /proc/self/mountinfo)" = ""' +ExecStart=/bin/sh -x -c 'test "$$(awk \'$$5 == "/var" && $$6 !~ /(^|,)nodev(,|$)/ { print $$6 }\' /proc/self/mountinfo)" = ""' +ExecStart=/bin/sh -x -c 'test "$$(awk \'$$5 == "/var" && $$6 ~ /(^|,)strictatime(,|$)/ { print $$6 }\' /proc/self/mountinfo)" = ""' |