summaryrefslogtreecommitdiff
path: root/test/test-execute
diff options
context:
space:
mode:
authorAlan Jenkins <alan.christopher.jenkins@gmail.com>2018-08-29 22:36:37 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-09-01 17:22:14 +0900
commitad8e66dcc485425da925a9ef99e911c6e9d8ee5b (patch)
treeb0b8a61dd5f778e27e9e77e29b05366581883391 /test/test-execute
parent69338c3dfb13d5f5e2d8b7f66f785daab8cbe190 (diff)
downloadsystemd-ad8e66dcc485425da925a9ef99e911c6e9d8ee5b.tar.gz
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.service3
-rw-r--r--test/test-execute/exec-temporaryfilesystem-rw.service3
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