]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
tests: Give grub-fs-tester temp directory a better name
authorGlenn Washburn <development@efficientek.com>
Sat, 9 Apr 2022 02:44:47 +0000 (02:44 +0000)
committerDaniel Kiper <daniel.kiper@oracle.com>
Wed, 20 Apr 2022 16:29:01 +0000 (18:29 +0200)
Instead of "tmp" the name is prefixed by the name of the scripts (e.g.
grub-fs-tester). A timestamp is added in the name to allow for easily
seeing a chronological sorting of runs and the name of the filesystem
being tested. The random component is set to the minimal possible,
3 characters, because the timestamp should provide enough uniqueness.

Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
tests/util/grub-fs-tester.in

index 868199109fcecc6373a39fe0e37d9f2feb2f677d..02edcf897fc41d08a0ad29daf0fc18e5b7713a4e 100644 (file)
@@ -7,7 +7,7 @@ fs="$1"
 
 GRUBFSTEST="@builddir@/grub-fstest"
 
-tempdir=`mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` ||
+tempdir=`mktemp -d "${TMPDIR:-/tmp}/${0##*/}.$(date '+%Y%m%d%H%M%S%N').${fs}.XXX"` ||
 { echo "Failed to make temporary directory"; exit 99; }
 
 # xorriso -as mkisofs options to ignore locale when processing file names and