From: Zbigniew Jędrzejewski-Szmek Date: Thu, 1 Oct 2020 12:55:22 +0000 (+0200) Subject: tests: when creating temp dirs, include test name in path X-Git-Tag: v247-rc1~134^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a3709e3709ae1afae39e69058a7cc2ac81f1ae78;p=thirdparty%2Fsystemd.git tests: when creating temp dirs, include test name in path This makes it easier to figure out which directory we want to look at when tests fail, and also which test left behind a directory when it shouldn't. --- diff --git a/src/partition/test-repart.sh b/src/partition/test-repart.sh index 5765978290c..9af3049b6b2 100755 --- a/src/partition/test-repart.sh +++ b/src/partition/test-repart.sh @@ -6,7 +6,7 @@ set -ex repart=$1 test -x $repart -D=$(mktemp --directory) +D=$(mktemp --tmpdir --directory "test-repart.XXXXXXXXXX") trap "rm -rf '$D'" EXIT INT QUIT PIPE mkdir -p $D/definitions diff --git a/test/hwdb-test.sh b/test/hwdb-test.sh index d12f82fa2d7..8b909f7d809 100755 --- a/test/hwdb-test.sh +++ b/test/hwdb-test.sh @@ -18,7 +18,7 @@ if [ ! -x "$SYSTEMD_HWDB" ]; then exit 1 fi -D=$(mktemp --directory) +D=$(mktemp --tmpdir --directory "hwdb-test.XXXXXXXXXX") trap "rm -rf '$D'" EXIT INT QUIT PIPE mkdir -p "$D/etc/udev" ln -s "$ROOTDIR/hwdb.d" "$D/etc/udev/hwdb.d" diff --git a/test/test-network-generator-conversion.sh b/test/test-network-generator-conversion.sh index d0d08345182..50df69f1b01 100755 --- a/test/test-network-generator-conversion.sh +++ b/test/test-network-generator-conversion.sh @@ -17,7 +17,7 @@ for f in "$src"/test-*.input; do echo "*** Running $f" ( - out=$(mktemp --directory) + out=$(mktemp --tmpdir --directory "test-network-generator-conversion.XXXXXXXXXX") trap "rm -rf '$out'" EXIT INT QUIT PIPE $generator --root "$out" -- $(cat $f)