summaryrefslogtreecommitdiff
path: root/test/units/testsuite-22.04.sh
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-04-08 00:48:35 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-04-08 20:16:37 +0200
commitb88ba6c76116b6e03e202b1bdffd37933f748f03 (patch)
tree28b28517f14008f3e8303a7c8da181d0d1e876a5 /test/units/testsuite-22.04.sh
parentb065dfc8ed7b0465be113a0d739f153ca0230ee6 (diff)
downloadsystemd-b88ba6c76116b6e03e202b1bdffd37933f748f03.tar.gz
tmpfiles: make handling of existing-but-different targets more consistent
create_fifo() was added in a2fc2f8dd30c17ad1e23a31fc6ff2aeba4c6fa27, and would always ignore failure. The test was trying to fail in this case, but we actually don't fail, which seems to be correct. We didn't notice before because the test was ineffective. To make things consistent, generally log at warning level, but don't propagate the error. For symlinks, log at debug level, as before. For 'e', failure is not propagated now. The test is adjusted to match. I think warning is appropriate in most cases: we do not expect a device node to be replaced by a different device node or even a non-device file. This would most likely be an error somewhere. An exception is made for symlinks, which are mismatched on purpose, for example /etc/resolv.conf. With this patch, we don't get any warnings with the any of the 74 tmpfiles.d files, which suggests that increasing the warning levels will not cause too many unexpected warnings. If it turns out that there are valid cases where people have expected mismatches for non-symlink types, we can always decrease the log levels again.
Diffstat (limited to 'test/units/testsuite-22.04.sh')
-rwxr-xr-xtest/units/testsuite-22.04.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/units/testsuite-22.04.sh b/test/units/testsuite-22.04.sh
index f916086b1e..fc90ab4dc7 100755
--- a/test/units/testsuite-22.04.sh
+++ b/test/units/testsuite-22.04.sh
@@ -17,8 +17,8 @@ EOF
test -p /tmp/p/fifo1
test $(stat -c %U:%G:%a /tmp/p/fifo1) = "root:root:666"
-# it should refuse to overwrite an existing file
-! systemd-tmpfiles --create - <<EOF
+# Refuse to overwrite an existing file. Error is not propagated.
+systemd-tmpfiles --create - <<EOF
p /tmp/p/f1 0666 - - - -
EOF