]>
git.ipfire.org Git - thirdparty/systemd.git/blob - test/TEST-22-TMPFILES/test-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"