Reorder operations in _endlog so failure messages get
printed prior to performing callbacks and cleanup. This
helps clarify why a test failed and places the message
closer to the point of incident in the resulting logs.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Closes #6281
typeset logfile="/tmp/log.$$"
_recursive_output $logfile
- if [[ $1 == $STF_FAIL ]] ; then
+ typeset exitcode=$1
+ shift
+ (( ${#@} > 0 )) && _printline "$@"
+
+ if [[ $exitcode == $STF_FAIL ]] ; then
_execute_testfail_callbacks
fi
log_note "Performing local cleanup via log_onexit ($cleanup)"
$cleanup
fi
- typeset exitcode=$1
- shift
- (( ${#@} > 0 )) && _printline "$@"
+
exit $exitcode
}