tests/util/grub-shell-luks-tester: Do not remove generated files when test fails to allow debugging

Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
Glenn Washburn 2023-08-14 15:00:10 -05:00 committed by Daniel Kiper
parent a63ef8c78c
commit ee2349ef65

View File

@ -145,7 +145,9 @@ cleanup() {
if [ -e "$luksdev" ]; then
cryptsetup close "$luksdev"
fi
[ -z "$debug" ] && rm -rf "$lukstestdir" || :
if [ -z "$debug" ] && [ "${RET:-1}" -eq 0 ]; then
rm -rf "$lukstestdir" || :
fi
}
trap cleanup EXIT INT TERM KILL QUIT