#!/bin/sh # Verify that tmpfiles removes before it creates when asked to do both set -eu TEST_DIR=$(dirname "$0") DIR=/tmp/order CONF=/tmp/order.conf test_teardown() { say "Running test teardown." run "rm -rf $DIR $CONF" } # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" run "cat > $CONF" < $DIR/file" run "/libexec/finit/tmpfiles --create --remove $CONF" assert "The old file is removed, a new one created" "$(texec cat $DIR/file)" = "new"