diff options
author | Ryan Gonzalez <rymg19@gmail.com> | 2019-01-06 18:13:13 -0600 |
---|---|---|
committer | Ryan Gonzalez <rymg19@gmail.com> | 2019-01-08 14:30:15 -0600 |
commit | 55b25c43ff1224728aa51f90d599a6843dd27543 (patch) | |
tree | d68ec9997738a28e930e9612fc6956b4920625cf /test | |
parent | a6f4464571f516c44af731b033e557671bcf8ca5 (diff) | |
download | systemd-55b25c43ff1224728aa51f90d599a6843dd27543.tar.gz |
test: Add tests for tmpfiles C behavior
Diffstat (limited to 'test')
-rwxr-xr-x | test/TEST-22-TMPFILES/test-02.sh | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/test/TEST-22-TMPFILES/test-02.sh b/test/TEST-22-TMPFILES/test-02.sh index fe8b903298..d1bf1ea04b 100755 --- a/test/TEST-22-TMPFILES/test-02.sh +++ b/test/TEST-22-TMPFILES/test-02.sh @@ -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" |