mirror of
https://github.com/troglobit/finit.git
synced 2026-11-23 20:11:44 +00:00
An entry with a % in the path was skipped, and files from
distributions have them:
d /run/log/journal/%m 2755 root systemd-journal - -
Expand the specifiers that do not need the OS release or the
architecture: %b, %m, %H, %l, %v, the directories %t, %T, %V, %S, %C,
%L, %h, and the user ones %u, %U, %g, %G. tmpfiles runs as root, so
the last ones are fixed. An entry with any other specifier is still
skipped.
The argument of C, f, F, L, and w entries is expanded too, as in
tmpfiles.d(5). A literal % in such an argument must from now on be
written %%.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
37 lines
904 B
Bash
Executable File
37 lines
904 B
Bash
Executable File
#!/bin/sh
|
|
# Verify that tmpfiles skips an entry it does not support, and goes on
|
|
# with the rest
|
|
set -eu
|
|
|
|
TEST_DIR=$(dirname "$0")
|
|
|
|
DIR=/tmp/unsupported
|
|
CONF=/tmp/unsupported.conf
|
|
|
|
test_teardown()
|
|
{
|
|
say "Running test teardown."
|
|
run "rm -rf $DIR $CONF"
|
|
}
|
|
|
|
# shellcheck source=/dev/null
|
|
. "$TEST_DIR/lib/setup.sh"
|
|
|
|
run "cat > $CONF" <<CONF
|
|
d $DIR
|
|
h $DIR - - - - +i
|
|
f $DIR/%!
|
|
f $DIR/after
|
|
CONF
|
|
|
|
say 'Create only'
|
|
msg=$(texec sh -c "/libexec/finit/tmpfiles --create $CONF 2>&1")
|
|
assert "The entry after is created" "$(texec ls $DIR)" = "after"
|
|
assert "Each is reported once" "$(echo "$msg" | grep -c skipping)" -eq 2
|
|
|
|
say 'Remove and create, two passes'
|
|
run "rm $DIR/after"
|
|
msg=$(texec sh -c "/libexec/finit/tmpfiles --create --remove $CONF 2>&1")
|
|
assert "The entry after is created" "$(texec ls $DIR)" = "after"
|
|
assert "Each is reported once" "$(echo "$msg" | grep -c skipping)" -eq 2
|