]> granicus.if.org Git - zfs/commitdiff
Print fail messages before callbacks in test suite
authorGiuseppe Di Natale <dinatale2@users.noreply.github.com>
Fri, 30 Jun 2017 18:12:29 +0000 (11:12 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 30 Jun 2017 18:12:29 +0000 (11:12 -0700)
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

tests/test-runner/include/logapi.shlib

index d9f276e0e7ea9c2117c3b279b4e1182cbb512c31..fabfc42b1dfccc06855892b2b67f51172c1a4c1e 100644 (file)
@@ -418,7 +418,11 @@ function _endlog
        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
 
@@ -428,9 +432,7 @@ function _endlog
                log_note "Performing local cleanup via log_onexit ($cleanup)"
                $cleanup
        fi
-       typeset exitcode=$1
-       shift
-       (( ${#@} > 0 )) && _printline "$@"
+
        exit $exitcode
 }