#!/bin/sh # Verify the t and T entries of tmpfiles, extended attributes. On the # file system of the sysroot, not all of this works on tmpfs. set -eu TEST_DIR=$(dirname "$0") DIR=/attr-test CONF=/tmp/attr.conf tmpfiles() { run "cat > $CONF" run "/libexec/finit/tmpfiles --create $CONF" } # The sysroot has setfattr but no getfattr, removing one that is not # set fails assert_xattr() { assert "$1 has $2" "$(texec sh -c "setfattr -x $2 $1 && echo yes || echo no")" = "yes" } test_teardown() { say "Running test teardown." run "rm -rf $DIR $CONF" } # shellcheck source=/dev/null . "$TEST_DIR/lib/setup.sh" run "mkdir -p $DIR/tree/sub; touch $DIR/file $DIR/tree/sub/file" sep say 't sets extended attributes, T on everything below the path too' tmpfiles <