tests/grub_cmd_cryptomount: Remove temporary directories if successful and debug is not on

grub_cmd_cryptomount creates a directory per subtest. If a subtest is
successful and debugging is not on, the directory should be empty.
So, it can be deleted.

Signed-off-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:
Thomas Schmitt 2025-03-03 02:12:05 -06:00 committed by Daniel Kiper
parent e6e2b73db8
commit e0116f3bd5

View File

@ -54,6 +54,15 @@ _testcase() {
set -- "$@" $([ "${EXPECTEDRES}" -eq 1 ] && echo "--xfail")
output=`"$@" 2>&1` || res=$?
if [ -z "$debug" ]; then
if ! rmdir "$TMPDIR" >/dev/null 2>&1; then
echo
echo "Note: Temporary directory cannot be removed:"
echo " $TMPDIR"
echo " Please inspect and remove manually."
echo
fi
fi
TMPDIR=$_TMPDIR
if [ "$res" -eq "$EXPECTEDRES" ]; then