From: Martin Schwenke Date: Thu, 5 Sep 2019 03:42:26 +0000 (+1000) Subject: ctdb-tests: Add new variable CTDB_TEST_TMP_DIR X-Git-Tag: talloc-2.3.1~733 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cec8f3907ef7b324035b59f9a965c198b5d03de6;p=thirdparty%2Fsamba.git ctdb-tests: Add new variable CTDB_TEST_TMP_DIR This is a subdirectory of TEST_VAR_DIR that is unique to the current test suite. It is recreated for each individual test. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/tests/run_tests.sh b/ctdb/tests/run_tests.sh index 5cca297fd64..367f9388c41 100755 --- a/ctdb/tests/run_tests.sh +++ b/ctdb/tests/run_tests.sh @@ -188,6 +188,20 @@ run_one_test () CTDB_TEST_SUITE_DIR=$(cd "$CTDB_TEST_SUITE_DIR" && pwd) fi + # Set CTDB_TEST_TMP_DIR + # + # Determine the relative test suite subdirectory. The top-level + # test directory needs to be a prefix of the test suite directory, + # so make absolute versions of both. + local test_dir test_suite_dir reldir + test_dir=$(cd "$CTDB_TEST_DIR" && pwd) + test_suite_dir=$(cd "$CTDB_TEST_SUITE_DIR" && pwd) + reldir="${test_suite_dir#${test_dir}/}" + + export CTDB_TEST_TMP_DIR="${TEST_VAR_DIR}/${reldir}" + rm -rf "$CTDB_TEST_TMP_DIR" + mkdir -p "$CTDB_TEST_TMP_DIR" + tests_total=$((tests_total + 1)) ctdb_test_run "$f" | show_progress