ctdb-tests: Move use of show_progress() into ctdb_test_run()
authorMartin Schwenke <martin@meltin.net>
Wed, 18 Sep 2019 02:25:06 +0000 (12:25 +1000)
committerAmitay Isaacs <amitay@samba.org>
Fri, 4 Oct 2019 09:41:28 +0000 (09:41 +0000)
This allows more variables to be set in this function because they are
no longer in a sub-shell.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/run_tests.sh

index 1d5b7f3318b36afe8725d0f95d304cac66ac8b0f..a5775ca0814e5d3e58c9c172bb2128607b3300cb 100755 (executable)
@@ -135,7 +135,8 @@ ctdb_test_run ()
 
        local status=0
        if [ -x "$f" ] ; then
-               timeout "$test_time_limit" "$f" || status=$?
+               timeout "$test_time_limit" "$f" | show_progress
+               status=$?
        else
                echo "TEST IS NOT EXECUTABLE"
                status=1
@@ -202,7 +203,7 @@ run_one_test ()
 
     tests_total=$((tests_total + 1))
 
-    ctdb_test_run "$f" | show_progress
+    ctdb_test_run "$f"
     status=$?
     if [ $status -eq 0 ] ; then
        tests_passed=$((tests_passed + 1))