diff options
author | Alan Jenkins <alan.christopher.jenkins@gmail.com> | 2018-08-29 23:36:37 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-09-01 10:22:14 +0200 |
commit | ad8e66dcc485425da925a9ef99e911c6e9d8ee5b (patch) | |
tree | b0b8a61dd5f778e27e9e77e29b05366581883391 /test/test-execute | |
parent | namespace: don't try to remount superblocks (diff) | |
download | systemd-ad8e66dcc485425da925a9ef99e911c6e9d8ee5b.tar.xz systemd-ad8e66dcc485425da925a9ef99e911c6e9d8ee5b.zip |
namespace: fix mode for TemporaryFileSystem=
... when no mount options are passed.
Change the code, to avoid the following failure in the newly added tests:
exec-temporaryfilesystem-rw.service: Executing: /usr/bin/sh -x -c
'[ "$(stat -c %a /var)" == 755 ]'
++ stat -c %a /var
+ '[' 1777 == 755 ']'
Received SIGCHLD from PID 30364 (sh).
Child 30364 (sh) died (code=exited, status=1/FAILURE)
(And I spotted an opportunity to use TAKE_PTR() at the end).
Diffstat (limited to 'test/test-execute')
-rw-r--r-- | test/test-execute/exec-temporaryfilesystem-ro.service | 3 | ||||
-rw-r--r-- | test/test-execute/exec-temporaryfilesystem-rw.service | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/test/test-execute/exec-temporaryfilesystem-ro.service b/test/test-execute/exec-temporaryfilesystem-ro.service index c0e3721a01..c161aecc30 100644 --- a/test/test-execute/exec-temporaryfilesystem-ro.service +++ b/test/test-execute/exec-temporaryfilesystem-ro.service @@ -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' diff --git a/test/test-execute/exec-temporaryfilesystem-rw.service b/test/test-execute/exec-temporaryfilesystem-rw.service index 379ad066fb..bb830595bc 100644 --- a/test/test-execute/exec-temporaryfilesystem-rw.service +++ b/test/test-execute/exec-temporaryfilesystem-rw.service @@ -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 |