From a3709e3709ae1afae39e69058a7cc2ac81f1ae78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 1 Oct 2020 14:55:22 +0200 Subject: [PATCH] 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. --- src/partition/test-repart.sh | 2 +- test/hwdb-test.sh | 2 +- test/test-network-generator-conversion.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/partition/test-repart.sh b/src/partition/test-repart.sh index 5765978290..9af3049b6b 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 d12f82fa2d..8b909f7d80 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 d0d0834518..50df69f1b0 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)