run_xfstests.sh: ensure cleanup on errors

Because we exit on any error (due to 'set -e'), the cleanup call was
never getting made in the event of an error.  The net effect of that
was that a filesystem could be left mounted, and rbd cleanup then
couldn't complete because the module was in use.

Fix the trap call so it calls cleanup on exit as well as error.
Switch to using the capitalized signal names in the call.

Signed-off-by: Alex Elder <elder@dreamhost.com>
This commit is contained in:
Alex Elder 2012-04-14 11:43:15 -05:00 committed by Alex Elder
parent 3d187db501
commit a40fe5bdad

View File

@ -395,7 +395,7 @@ function cleanup() {
remove_xfstests
cleanup_host_options
}
trap cleanup hup int quit
trap cleanup EXIT ERR HUP INT QUIT
# ################################################################
@ -410,7 +410,7 @@ pushd "${XFSTESTS_DIR}"
status=$?
popd
cleanup
# cleanup is called via the trap call, above
echo "This xfstests run started at: ${start_date}"
echo "xfstests run completed at: $(date)"