mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-21 18:03:41 +03:00
test-execute: add tests for $RUNTIME_DIRECTORY= or friends
This commit is contained in:
parent
fb2042dd55
commit
6088662d57
@ -10,6 +10,7 @@ ExecStart=test -d /var/lib/test-dynamicuser-migrate
|
||||
ExecStart=test -d /var/lib/test-dynamicuser-migrate2/hoge
|
||||
ExecStart=touch /var/lib/test-dynamicuser-migrate/yay
|
||||
ExecStart=touch /var/lib/test-dynamicuser-migrate2/hoge/yayyay
|
||||
ExecStart=/bin/sh -x -c 'test "$$STATE_DIRECTORY" = "%S/test-dynamicuser-migrate:%S/test-dynamicuser-migrate2/hoge"'
|
||||
|
||||
Type=oneshot
|
||||
DynamicUser=no
|
||||
|
@ -18,6 +18,7 @@ ExecStart=touch /var/lib/test-dynamicuser-migrate/yay
|
||||
ExecStart=touch /var/lib/test-dynamicuser-migrate2/hoge/yayyay
|
||||
ExecStart=touch /var/lib/private/test-dynamicuser-migrate/yay
|
||||
ExecStart=touch /var/lib/private/test-dynamicuser-migrate2/hoge/yayyay
|
||||
ExecStart=/bin/sh -x -c 'test "$$STATE_DIRECTORY" = "%S/test-dynamicuser-migrate:%S/test-dynamicuser-migrate2/hoge"'
|
||||
|
||||
Type=oneshot
|
||||
DynamicUser=yes
|
||||
|
@ -10,6 +10,7 @@ ExecStart=test -f /var/lib/waldo/yay
|
||||
ExecStart=test -f /var/lib/quux/pief/yayyay
|
||||
ExecStart=test -f /var/lib/private/waldo/yay
|
||||
ExecStart=test -f /var/lib/private/quux/pief/yayyay
|
||||
ExecStart=/bin/sh -x -c 'test "$$STATE_DIRECTORY" = "%S/waldo:%S/quux/pief"'
|
||||
|
||||
# Make sure that /var/lib/private/waldo is really the only writable directory besides the obvious candidates
|
||||
ExecStart=sh -x -c 'test $$(find / \( -path /var/tmp -o -path /tmp -o -path /proc -o -path /dev/mqueue -o -path /dev/shm -o -path /sys/fs/bpf \) -prune -o -type d -writable -print 2>/dev/null | sort -u | tr -d '\\\\n') = /var/lib/private/quux/pief/var/lib/private/waldo'
|
||||
|
@ -3,6 +3,7 @@ Description=Test for RuntimeDirectoryMode
|
||||
|
||||
[Service]
|
||||
ExecStart=/bin/sh -x -c 'mode=$$(stat -c %%a %t/test-exec_runtimedirectory-mode); test "$$mode" = "750"'
|
||||
ExecStart=/bin/sh -x -c 'test "$$RUNTIME_DIRECTORY" = "%t/test-exec_runtimedirectory-mode"'
|
||||
Type=oneshot
|
||||
RuntimeDirectory=test-exec_runtimedirectory-mode
|
||||
RuntimeDirectoryMode=0750
|
||||
|
@ -4,6 +4,7 @@ Description=Test for RuntimeDirectory
|
||||
[Service]
|
||||
ExecStart=/bin/sh -x -c 'test -d %t/test-exec_runtimedirectory'
|
||||
ExecStart=/bin/sh -x -c 'test -d %t/test-exec_runtimedirectory2/hogehoge'
|
||||
ExecStart=/bin/sh -x -c 'test "$$RUNTIME_DIRECTORY" = "%t/test-exec_runtimedirectory:%t/test-exec_runtimedirectory2/hogehoge"'
|
||||
Type=oneshot
|
||||
RuntimeDirectory=test-exec_runtimedirectory
|
||||
RuntimeDirectory=./test-exec_runtimedirectory2///./hogehoge/.
|
||||
|
Loading…
x
Reference in New Issue
Block a user