]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: Add tests for tmpfiles C behavior 11345/head
authorRyan Gonzalez <rymg19@gmail.com>
Mon, 7 Jan 2019 00:13:13 +0000 (18:13 -0600)
committerRyan Gonzalez <rymg19@gmail.com>
Tue, 8 Jan 2019 20:30:15 +0000 (14:30 -0600)
test/TEST-22-TMPFILES/test-02.sh

index fe8b90329838a831edfa0bd3aafa84ae4257638f..d1bf1ea04b9d77c8a12b54443c524a3c45cd3c0e 100755 (executable)
@@ -6,8 +6,8 @@
 set -e
 set -x
 
-rm -fr /tmp/{d,D,e}
-mkdir  /tmp/{d,D,e}
+rm -fr /tmp/{C,d,D,e}
+mkdir  /tmp/{C,d,D,e}
 
 #
 # 'd'
@@ -93,3 +93,30 @@ test $(stat -c %U:%G:%a /tmp/e/3/d2) = "daemon:daemon:755"
 
 test -f /tmp/e/3/f1
 test $(stat -c %U:%G:%a /tmp/e/3/f1) = "root:root:644"
+
+#
+# 'C'
+#
+
+mkdir /tmp/C/{1,2,3}-origin
+touch /tmp/C/{1,2,3}-origin/f1
+chmod 755 /tmp/C/{1,2,3}-origin/f1
+
+mkdir /tmp/C/{2,3}
+touch /tmp/C/3/f1
+
+systemd-tmpfiles --create - <<EOF
+C     /tmp/C/1    0755 daemon daemon - /tmp/C/1-origin
+C     /tmp/C/2    0755 daemon daemon - /tmp/C/2-origin
+EOF
+
+test -d /tmp/C/1
+test $(stat -c %U:%G:%a /tmp/C/1/f1) = "daemon:daemon:755"
+test -d /tmp/C/2
+test $(stat -c %U:%G:%a /tmp/C/2/f1) = "daemon:daemon:755"
+
+! systemd-tmpfiles --create - <<EOF
+C     /tmp/C/3    0755 daemon daemon - /tmp/C/3-origin
+EOF
+
+test $(stat -c %U:%G:%a /tmp/C/3/f1) = "root:root:644"