From: Martin Schwenke Date: Wed, 4 Sep 2019 05:04:05 +0000 (+1000) Subject: ctdb-tests: Put the summary file inside $TEST_VAR_DIR X-Git-Tag: talloc-2.3.1~839 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2b37d99a5fbb08954dc4c0ff20867e9fd9dd5712;p=thirdparty%2Fsamba.git ctdb-tests: Put the summary file inside $TEST_VAR_DIR This means less random files dropped in /tmp or similar. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/tests/run_tests.sh b/ctdb/tests/run_tests.sh index a0c6dee7588..b74d7c5f193 100755 --- a/ctdb/tests/run_tests.sh +++ b/ctdb/tests/run_tests.sh @@ -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