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'
13 # Cannot create a file in /var
14 ExecStart=/bin/sh -c '! touch /var/hoge'
16 # Create a file in /var/test-exec-temporaryfilesystem/rw
17 ExecStart=/bin/sh -c 'touch /var/test-exec-temporaryfilesystem/rw/thisisasimpletest-temporaryfilesystem'
19 # Then, the file can be access through /tmp
20 ExecStart=/bin/sh -c 'test -f /tmp/thisisasimpletest-temporaryfilesystem'
22 # Also, through /var/test-exec-temporaryfilesystem/ro
23 ExecStart=/bin/sh -c 'test -f /var/test-exec-temporaryfilesystem/ro/thisisasimpletest-temporaryfilesystem'
25 # The file cannot modify through /var/test-exec-temporaryfilesystem/ro
26 ExecStart=/bin/sh -c '! touch /var/test-exec-temporaryfilesystem/ro/thisisasimpletest-temporaryfilesystem'
29 ExecStart=/bin/sh -c 'rm /tmp/thisisasimpletest-temporaryfilesystem'
31 TemporaryFileSystem=/var:ro
32 BindPaths=/tmp:/var/test-exec-temporaryfilesystem/rw
33 BindReadOnlyPaths=/tmp:/var/test-exec-temporaryfilesystem/ro