test: Actually run cleanup function

We install a cleanup() function with 'trap' in order to clean up temporary
files we generate during the tests.  However, we deinstall it after
run_term, which means it won't run in most of the cases where it would be
useful.  Even if "run from_term" exits with an error, that error will be
hidden from the run_term wrapper because it's within a tmux session, so we
will return from run_term normally, uninstall the trap and never clean up.

In fact there's no reason to uninstall the trap at all, it works just as
well on the success exit path as an error exit path.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
David Gibson 2022-09-13 14:35:18 +10:00 committed by Stefano Brivio
parent a9b18300b4
commit 1e4a15398f

View file

@ -178,7 +178,6 @@ else
:> "${LOGFILE}"
trap "cleanup" EXIT
run_term
trap "" EXIT
fi
[ ${DEMO} -eq 1 ] && exit 0