]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
tests/grub_cmd_cryptomount: Cleanup the cryptsetup script unless debug is enabled
authorGlenn Washburn <development@efficientek.com>
Mon, 3 Mar 2025 08:12:03 +0000 (02:12 -0600)
committerDaniel Kiper <daniel.kiper@oracle.com>
Wed, 26 Mar 2025 13:22:29 +0000 (14:22 +0100)
This fixes an issue where the grub_cmd_cryptomount test leaves a file
with an ambiguous name in the / directory when TMPDIR is not set.

Reported-by: Thomas Schmitt <scdbackup@gmx.net>
Signed-off-by: Glenn Washburn <development@efficientek.com>
Tested-by: Thomas Schmitt <scdbackup@gmx.net>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
tests/grub_cmd_cryptomount.in

index 63ed8e51bec3fd9ecd8d3fdfa703b453be63737f..2fba8a8e0e3a25d1416a384402b3eb19aea30117 100644 (file)
@@ -37,6 +37,8 @@ fi
 
 COMMON_OPTS='${V:+--debug=$V} --cs-opts="--pbkdf-force-iterations 1000"'
 
+debug=${GRUB_SHELL_DEFAULT_DEBUG:-$GRUB_TEST_DEFAULT_DEBUG}
+
 _testcase() {
     local EXPECTEDRES=$1
     local LOGPREFIX=$2
@@ -183,4 +185,5 @@ eval testcase "'LUKS2 test with second key slot and first slot using different p
     @builddir@/grub-shell-luks-tester $LUKS2_COMMON_OPTS $COMMON_OPTS \
         "--cs-script='$csscript'"
 
+test -n "$debug" || rm "$csscript"
 exit 0