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