]> git.ipfire.org Git - thirdparty/systemd.git/blob - test/units/testsuite-22.06.sh
Merge pull request #18701 from bugaevc/mdns-unicast
[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 -e
7
8 test_snippet() {
9 systemd-tmpfiles "$@" - <<EOF
10 d /var/tmp/foobar-test-06
11 d /var/tmp/foobar-test-06/important
12 R /var/tmp/foobar-test-06
13 EOF
14 }
15
16 test_snippet --create --remove
17 test -d /var/tmp/foobar-test-06
18 test -d /var/tmp/foobar-test-06/important
19
20 test_snippet --remove
21 test ! -f /var/tmp/foobar-test-06
22 test ! -f /var/tmp/foobar-test-06/important
23
24 test_snippet --create
25 test -d /var/tmp/foobar-test-06
26 test -d /var/tmp/foobar-test-06/important
27
28 touch /var/tmp/foobar-test-06/something-else
29
30 test_snippet --create
31 test -d /var/tmp/foobar-test-06
32 test -d /var/tmp/foobar-test-06/important
33 test -f /var/tmp/foobar-test-06/something-else
34
35 test_snippet --create --remove
36 test -d /var/tmp/foobar-test-06
37 test -d /var/tmp/foobar-test-06/important
38 test ! -f /var/tmp/foobar-test-06/something-else