From: Thomas Schmitt Date: Mon, 3 Mar 2025 08:12:05 +0000 (-0600) Subject: tests/grub_cmd_cryptomount: Remove temporary directories if successful and debug... X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=e0116f3bd515e5857844ac6c543c4bb90e6f5d70;p=thirdparty%2Fgrub.git 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 Signed-off-by: Glenn Washburn Tested-by: Thomas Schmitt Reviewed-by: Daniel Kiper --- diff --git a/tests/grub_cmd_cryptomount.in b/tests/grub_cmd_cryptomount.in index 8dc99127d..eaa187efa 100644 --- a/tests/grub_cmd_cryptomount.in +++ b/tests/grub_cmd_cryptomount.in @@ -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