From 19f4f86bfed21c5326ed2acebe1163f3a83e832b Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 6 May 2024 04:25:50 +0200 Subject: Adding upstream version 241. Signed-off-by: Daniel Baumann --- test/TEST-22-TMPFILES/Makefile | 1 + test/TEST-22-TMPFILES/run-tmpfiles-tests.sh | 13 ++ test/TEST-22-TMPFILES/test-01.sh | 13 ++ test/TEST-22-TMPFILES/test-02.sh | 122 ++++++++++++++ test/TEST-22-TMPFILES/test-03.sh | 236 ++++++++++++++++++++++++++++ test/TEST-22-TMPFILES/test-04.sh | 44 ++++++ test/TEST-22-TMPFILES/test-05.sh | 45 ++++++ test/TEST-22-TMPFILES/test-06.sh | 38 +++++ test/TEST-22-TMPFILES/test-07.sh | 31 ++++ test/TEST-22-TMPFILES/test.sh | 40 +++++ test/TEST-22-TMPFILES/testsuite.service | 10 ++ 11 files changed, 593 insertions(+) create mode 120000 test/TEST-22-TMPFILES/Makefile create mode 100755 test/TEST-22-TMPFILES/run-tmpfiles-tests.sh create mode 100755 test/TEST-22-TMPFILES/test-01.sh create mode 100755 test/TEST-22-TMPFILES/test-02.sh create mode 100755 test/TEST-22-TMPFILES/test-03.sh create mode 100755 test/TEST-22-TMPFILES/test-04.sh create mode 100755 test/TEST-22-TMPFILES/test-05.sh create mode 100755 test/TEST-22-TMPFILES/test-06.sh create mode 100755 test/TEST-22-TMPFILES/test-07.sh create mode 100755 test/TEST-22-TMPFILES/test.sh create mode 100644 test/TEST-22-TMPFILES/testsuite.service (limited to 'test/TEST-22-TMPFILES') diff --git a/test/TEST-22-TMPFILES/Makefile b/test/TEST-22-TMPFILES/Makefile new file mode 120000 index 0000000..e9f93b1 --- /dev/null +++ b/test/TEST-22-TMPFILES/Makefile @@ -0,0 +1 @@ +../TEST-01-BASIC/Makefile \ No newline at end of file diff --git a/test/TEST-22-TMPFILES/run-tmpfiles-tests.sh b/test/TEST-22-TMPFILES/run-tmpfiles-tests.sh new file mode 100755 index 0000000..3ad652f --- /dev/null +++ b/test/TEST-22-TMPFILES/run-tmpfiles-tests.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -x +set -e + +>/failed + +for t in test-*.sh; do + echo "Running $t"; ./$t +done + +touch /testok +rm /failed diff --git a/test/TEST-22-TMPFILES/test-01.sh b/test/TEST-22-TMPFILES/test-01.sh new file mode 100755 index 0000000..d233e37 --- /dev/null +++ b/test/TEST-22-TMPFILES/test-01.sh @@ -0,0 +1,13 @@ +#! /bin/bash +# +# With "e" don't attempt to set permissions when file doesn't exist, see +# https://github.com/systemd/systemd/pull/6682. +# + +set -e + +rm -fr /tmp/test + +echo "e /tmp/test - root root 1d" | systemd-tmpfiles --create - + +! test -e /tmp/test diff --git a/test/TEST-22-TMPFILES/test-02.sh b/test/TEST-22-TMPFILES/test-02.sh new file mode 100755 index 0000000..d1bf1ea --- /dev/null +++ b/test/TEST-22-TMPFILES/test-02.sh @@ -0,0 +1,122 @@ +#! /bin/bash +# +# Basic tests for types creating directories +# + +set -e +set -x + +rm -fr /tmp/{C,d,D,e} +mkdir /tmp/{C,d,D,e} + +# +# 'd' +# +mkdir /tmp/d/2 +chmod 777 /tmp/d/2 + +systemd-tmpfiles --create - </tmp/F/truncated +echo "This should be truncated" >/tmp/F/truncated-with-content + +systemd-tmpfiles --create - </tmp/F/rw-fs/foo +! systemd-tmpfiles --create - </tmp/F/rw-fs/foo +! systemd-tmpfiles --create - < fails. +! systemd-tmpfiles --create - <