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