]> www.infradead.org Git - users/hch/blktests.git/commitdiff
Fix the failure case which will exit with 0
authorYi Zhang <yi.zhang@redhat.com>
Tue, 5 Mar 2019 03:33:19 +0000 (11:33 +0800)
committerOmar Sandoval <osandov@fb.com>
Thu, 7 Mar 2019 19:25:58 +0000 (11:25 -0800)
The return value of a failing test was masked by the zoned test check.
Make sure to return either the original or zoned run failed value.

Fixes: e840e1537dc6 ("config: Introduce RUN_ZONED_TESTS variable and CAN_BE_ZONED flag")
Signed-off-by: Yi Zhang <yi.zhang@redhat.com>
check

diff --git a/check b/check
index 6d44bfb14e2abbcbf641f53b8cca9a5d66fa2759..f0ca3825ee62dfb2ce7cf4fd12035758520e1cd8 100755 (executable)
--- a/check
+++ b/check
@@ -431,11 +431,14 @@ _run_test() {
 
                RESULTS_DIR="$OUTPUT/nodev"
                _call_test test
+               local ret=$?
                if (( RUN_ZONED_TESTS && CAN_BE_ZONED )); then
                        RESULTS_DIR="$OUTPUT/nodev_zoned"
                        RUN_FOR_ZONED=1
                        _call_test test
+                       ret=$(( ret || $? ))
                fi
+               return $ret
        else
                if [[ ${#TEST_DEVS[@]} -eq 0 ]] && \
                        declare -fF fallback_device >/dev/null; then