From: Thomas Schmitt <scdbac...@gmx.net>

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: Glenn Washburn <developm...@efficientek.com>
---
 tests/grub_cmd_cryptomount.in | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tests/grub_cmd_cryptomount.in b/tests/grub_cmd_cryptomount.in
index 8dc99127d39e..eaa187efad0a 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
-- 
2.34.1


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to