]>
git.ipfire.org Git - thirdparty/systemd.git/blob - test/units/testsuite-22.02.sh
3 # Basic tests for types creating directories
18 systemd-tmpfiles
--create - <<EOF
19 d /tmp/d/1 0755 daemon daemon - -
20 d /tmp/d/2 0755 daemon daemon - -
24 test "$(stat -c %U:%G:%a /tmp/d/1)" = "daemon:daemon:755"
27 test "$(stat -c %U:%G:%a /tmp/d/2)" = "daemon:daemon:755"
36 systemd-tmpfiles
--create - <<EOF
37 D /tmp/D/1 0755 daemon daemon - -
38 D /tmp/D/2 0755 daemon daemon - -
42 test "$(stat -c %U:%G:%a /tmp/D/1)" = "daemon:daemon:755"
45 test "$(stat -c %U:%G:%a /tmp/D/2)" = "daemon:daemon:755"
47 systemd-tmpfiles
--remove - <<EOF
48 D /tmp/D/2 0755 daemon daemon - -
51 # the content of '2' should be removed
52 test "$(echo /tmp/D/2/*)" = "/tmp/D/2/*"
57 mkdir
-p /tmp
/e
/2/{d1
,d2
}
61 systemd-tmpfiles
--create - <<EOF
62 e /tmp/e/1 0755 daemon daemon - -
63 e /tmp/e/2/* 0755 daemon daemon - -
69 test "$(stat -c %U:%G:%a /tmp/e/2)" = "root:root:777"
72 test "$(stat -c %U:%G:%a /tmp/e/2/d1)" = "daemon:daemon:755"
74 test "$(stat -c %U:%G:%a /tmp/e/2/d2)" = "daemon:daemon:755"
76 # 'e' operates on directories only
77 mkdir
-p /tmp
/e
/3/{d1
,d2
}
83 systemd-tmpfiles
--create - <<EOF
84 e /tmp/e/3/* 0755 daemon daemon - -
87 # the directories should have been processed although systemd-tmpfiles failed
88 # previously due to the presence of a file.
90 test "$(stat -c %U:%G:%a /tmp/e/3/d1)" = "daemon:daemon:755"
92 test "$(stat -c %U:%G:%a /tmp/e/3/d2)" = "daemon:daemon:755"
95 test "$(stat -c %U:%G:%a /tmp/e/3/f1)" = "root:root:644"
101 mkdir
/tmp
/C
/{1,2,3}-origin
102 touch /tmp
/C
/{1,2,3}-origin/f1
103 chmod 755 /tmp
/C
/{1,2,3}-origin/f1
108 systemd-tmpfiles
--create - <<EOF
109 C /tmp/C/1 0755 daemon daemon - /tmp/C/1-origin
110 C /tmp/C/2 0755 daemon daemon - /tmp/C/2-origin
114 test "$(stat -c %U:%G:%a /tmp/C/1/f1)" = "daemon:daemon:755"
116 test "$(stat -c %U:%G:%a /tmp/C/2/f1)" = "daemon:daemon:755"
118 systemd-tmpfiles
--create - <<EOF
119 C /tmp/C/3 0755 daemon daemon - /tmp/C/3-origin
122 test "$(stat -c %U:%G:%a /tmp/C/3/f1)" = "root:root:644"