]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-tests: Put the summary file inside $TEST_VAR_DIR
authorMartin Schwenke <martin@meltin.net>
Wed, 4 Sep 2019 05:04:05 +0000 (15:04 +1000)
committerAmitay Isaacs <amitay@samba.org>
Tue, 17 Sep 2019 04:35:26 +0000 (04:35 +0000)
This means less random files dropped in /tmp or similar.

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

index a0c6dee7588a8ebac8e18044e9a10602fab5ac70..b74d7c5f19369dc137ad61032cd1d2975afd319f 100755 (executable)
@@ -175,8 +175,6 @@ if ! type mktemp >/dev/null 2>&1 ; then
     }
 fi
 
-sf=$(mktemp) || die "mktemp failed for sf - is TMPDIR missing?"
-
 set -o pipefail
 
 run_one_test ()
@@ -199,7 +197,7 @@ run_one_test ()
        else
            t="*FAILED*"
        fi
-       echo "$t $f" >>"$sf"
+       echo "$t $f" >>"$summary_file"
     fi
 }
 
@@ -278,6 +276,9 @@ if [ -z "$TEST_VAR_DIR" ] ; then
 fi
 mkdir -p "$TEST_VAR_DIR"
 
+summary_file="${TEST_VAR_DIR}/.summary"
+: >"$summary_file"
+
 export TEST_SCRIPTS_DIR="${CTDB_TEST_DIR}/scripts"
 
 unit_tests="
@@ -349,13 +350,12 @@ done
 if $with_summary ; then
        if [ $status -eq 0 ] || ! $exit_on_fail ; then
                echo
-               cat "$sf"
+               cat "$summary_file"
                echo
                echo "${tests_passed}/${tests_total} tests passed"
        fi
 fi
-
-rm -f "$sf"
+rm -f "$summary_file"
 
 echo