From: Glenn Washburn Date: Mon, 3 Mar 2025 08:12:04 +0000 (-0600) Subject: tests/grub_cmd_cryptomount: Default TMPDIR to /tmp X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e6e2b73db8004e122a06a253107cef2343b6e092;p=thirdparty%2Fgrub.git tests/grub_cmd_cryptomount: Default TMPDIR to /tmp This fixes behavior where grub_cmd_cryptomount temporary files, which are some times not cleaned up, are left in the / directory. Set TMPDIR if your system does not have /tmp or it can not be used for some reason. Reported-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 2fba8a8e0..8dc99127d 100644 --- a/tests/grub_cmd_cryptomount.in +++ b/tests/grub_cmd_cryptomount.in @@ -47,8 +47,9 @@ _testcase() { shift 2 # Create a subdir in TMPDIR for each testcase - _TMPDIR=$TMPDIR - TMPDIR=$TMPDIR/`echo -n "$(date +%s).$LOGPREFIX" | sed -e 's,[ /],_,g' -e 's,:$,,g'` + _TMPDIR=${TMPDIR:-/tmp} + TMPDIR=${_TMPDIR}/`echo -n "$(date +%s).${LOGPREFIX}" | sed -e 's,[ /],_,g' -e 's,:$,,g'` + export TMPDIR mkdir -p "$TMPDIR" set -- "$@" $([ "${EXPECTEDRES}" -eq 1 ] && echo "--xfail")