mirror of
https://github.com/systemd/systemd
synced 2024-07-21 10:17:21 +00:00
parent
2c57597745
commit
f8ed99c845
38
test/TEST-22-TMPFILES/test-06.sh
Executable file
38
test/TEST-22-TMPFILES/test-06.sh
Executable file
|
@ -0,0 +1,38 @@
|
|||
#! /bin/bash
|
||||
#
|
||||
# Inspired by https://github.com/systemd/systemd/issues/9508
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
test_snippet() {
|
||||
systemd-tmpfiles "$@" - <<EOF
|
||||
d /var/tmp/foobar-test-06
|
||||
d /var/tmp/foobar-test-06/important
|
||||
R /var/tmp/foobar-test-06
|
||||
EOF
|
||||
}
|
||||
|
||||
test_snippet --create --remove
|
||||
test -d /var/tmp/foobar-test-06
|
||||
test -d /var/tmp/foobar-test-06/important
|
||||
|
||||
test_snippet --remove
|
||||
! test -f /var/tmp/foobar-test-06
|
||||
! test -f /var/tmp/foobar-test-06/important
|
||||
|
||||
test_snippet --create
|
||||
test -d /var/tmp/foobar-test-06
|
||||
test -d /var/tmp/foobar-test-06/important
|
||||
|
||||
touch /var/tmp/foobar-test-06/something-else
|
||||
|
||||
test_snippet --create
|
||||
test -d /var/tmp/foobar-test-06
|
||||
test -d /var/tmp/foobar-test-06/important
|
||||
test -f /var/tmp/foobar-test-06/something-else
|
||||
|
||||
test_snippet --create --remove
|
||||
test -d /var/tmp/foobar-test-06
|
||||
test -d /var/tmp/foobar-test-06/important
|
||||
! test -f /var/tmp/foobar-test-06/something-else
|
Loading…
Reference in a new issue