]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tests: when creating temp dirs, include test name in path
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 1 Oct 2020 12:55:22 +0000 (14:55 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 1 Oct 2020 17:53:45 +0000 (19:53 +0200)
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
test/hwdb-test.sh
test/test-network-generator-conversion.sh

index 5765978290c91d9ecdddc4f1c61d1081629ab19f..9af3049b6b2db5c40e57708c6039b59d8daa9b8a 100755 (executable)
@@ -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
 
index d12f82fa2d7997c0b3f215e477a373dd97e9888f..8b909f7d80996f17842c1d801d79779544a179cb 100755 (executable)
@@ -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"
index d0d083451821511d7e7c77b4f57dc3dc5f5c5ad1..50df69f1b01bcae8068e88addfa35330131ec926 100755 (executable)
@@ -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)