]> git.ipfire.org Git - thirdparty/systemd.git/blob - test/test-execute/exec-temporaryfilesystem-ro.service
Merge pull request #8235 from keszybz/skip-nobody-test
[thirdparty/systemd.git] / test / test-execute / exec-temporaryfilesystem-ro.service
1 [Unit]
2 Description=Test for TemporaryFileSystem with read-only mode
3
4 [Service]
5 Type=oneshot
6
7 # Check directories exist
8 ExecStart=/bin/sh -c 'test -d /var/test-exec-temporaryfilesystem/rw && test -d /var/test-exec-temporaryfilesystem/ro'
9
10 # Check TemporaryFileSystem= are empty
11 ExecStart=/bin/sh -c 'for i in $$(ls -A /var); do test $$i = test-exec-temporaryfilesystem || false; done'
12
13 # Cannot create a file in /var
14 ExecStart=/bin/sh -c '! touch /var/hoge'
15
16 # Create a file in /var/test-exec-temporaryfilesystem/rw
17 ExecStart=/bin/sh -c 'touch /var/test-exec-temporaryfilesystem/rw/thisisasimpletest-temporaryfilesystem'
18
19 # Then, the file can be access through /tmp
20 ExecStart=/bin/sh -c 'test -f /tmp/thisisasimpletest-temporaryfilesystem'
21
22 # Also, through /var/test-exec-temporaryfilesystem/ro
23 ExecStart=/bin/sh -c 'test -f /var/test-exec-temporaryfilesystem/ro/thisisasimpletest-temporaryfilesystem'
24
25 # The file cannot modify through /var/test-exec-temporaryfilesystem/ro
26 ExecStart=/bin/sh -c '! touch /var/test-exec-temporaryfilesystem/ro/thisisasimpletest-temporaryfilesystem'
27
28 # Cleanup
29 ExecStart=/bin/sh -c 'rm /tmp/thisisasimpletest-temporaryfilesystem'
30
31 TemporaryFileSystem=/var:ro
32 BindPaths=/tmp:/var/test-exec-temporaryfilesystem/rw
33 BindReadOnlyPaths=/tmp:/var/test-exec-temporaryfilesystem/ro