tests/grub_cmd_cryptomount: Cleanup the cryptsetup script unless debug is enabled

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>
This commit is contained in:
Glenn Washburn 2025-03-03 02:12:03 -06:00 committed by Daniel Kiper
parent c188ca5d5e
commit 32b02bb92e

View 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