2 Description=Test for TemporaryFileSystem with read-only mode
7 # Check directories exist
8 ExecStart=/bin/sh -c 'test -d /var/test-exec-temporaryfilesystem/rw && test -d /var/test-exec-temporaryfilesystem/ro'
10 # Check TemporaryFileSystem= are empty
11 ExecStart=/bin/sh -c 'for i in $$(ls -A /var); do test $$i = test-exec-temporaryfilesystem || false; done'
14 ExecStart=sh -x -c 'test "$$(stat -c %%a /var)" = "755"'
16 # Cannot create a file in /var
17 ExecStart=/bin/sh -c '! touch /var/hoge'
19 # Create a file in /var/test-exec-temporaryfilesystem/rw
20 ExecStart=/bin/sh -c 'touch /var/test-exec-temporaryfilesystem/rw/thisisasimpletest-temporaryfilesystem'
22 # Then, the file can be access through /tmp
23 ExecStart=/bin/sh -c 'test -f /tmp/thisisasimpletest-temporaryfilesystem'
25 # Also, through /var/test-exec-temporaryfilesystem/ro
26 ExecStart=/bin/sh -c 'test -f /var/test-exec-temporaryfilesystem/ro/thisisasimpletest-temporaryfilesystem'
28 # The file cannot modify through /var/test-exec-temporaryfilesystem/ro
29 ExecStart=/bin/sh -c '! touch /var/test-exec-temporaryfilesystem/ro/thisisasimpletest-temporaryfilesystem'
32 ExecStart=/bin/sh -c 'rm /tmp/thisisasimpletest-temporaryfilesystem'
34 TemporaryFileSystem=/var:ro
35 BindPaths=/tmp:/var/test-exec-temporaryfilesystem/rw
36 BindReadOnlyPaths=/tmp:/var/test-exec-temporaryfilesystem/ro