#!/bin/sh # Verify which tmpfiles.d files are read, in what order, and that the # first entry for a path is the one that counts set -eu TEST_DIR=$(dirname "$0") DIR=/tmp/files CONF=/tmp/files.conf LIB=/usr/lib/tmpfiles.d ETC=/etc/tmpfiles.d test_teardown() { say "Running test teardown." run "rm -rf $DIR $CONF $LIB/[0-9]0-test.conf $ETC/[0-9]0-test.conf" } # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" run "mkdir -p $LIB $ETC" run "cat > $LIB/50-test.conf" < $ETC/50-test.conf" < $LIB/10-test.conf" < $ETC/20-test.conf" <&1 | grep -c 'already has an entry'")" = "1" sep say 'With --replace a file on the command line is read as if it was the one named' run "cat > $CONF" <