]> git.ipfire.org Git - thirdparty/systemd.git/blob - test/units/testsuite-22.06.sh
Merge pull request #18863 from keszybz/cmdline-escaping
[thirdparty/systemd.git] / test / units / testsuite-22.06.sh
1 #!/bin/bash
2 #
3 # Inspired by https://github.com/systemd/systemd/issues/9508
4 #
5
6 set -eux
7 set -o pipefail
8
9 test_snippet() {
10 systemd-tmpfiles "$@" - <<EOF
11 d /var/tmp/foobar-test-06
12 d /var/tmp/foobar-test-06/important
13 R /var/tmp/foobar-test-06
14 EOF
15 }
16
17 test_snippet --create --remove
18 test -d /var/tmp/foobar-test-06
19 test -d /var/tmp/foobar-test-06/important
20
21 test_snippet --remove
22 test ! -f /var/tmp/foobar-test-06
23 test ! -f /var/tmp/foobar-test-06/important
24
25 test_snippet --create
26 test -d /var/tmp/foobar-test-06
27 test -d /var/tmp/foobar-test-06/important
28
29 touch /var/tmp/foobar-test-06/something-else
30
31 test_snippet --create
32 test -d /var/tmp/foobar-test-06
33 test -d /var/tmp/foobar-test-06/important
34 test -f /var/tmp/foobar-test-06/something-else
35
36 test_snippet --create --remove
37 test -d /var/tmp/foobar-test-06
38 test -d /var/tmp/foobar-test-06/important
39 test ! -f /var/tmp/foobar-test-06/something-else