diff options
author | Martin Schwenke <martin@meltin.net> | 2019-09-09 16:19:52 +1000 |
---|---|---|
committer | Amitay Isaacs <amitay@samba.org> | 2019-09-24 02:27:29 +0000 |
commit | e9ce035c2d2ef6fd177a3bb10031162586b696bd (patch) | |
tree | 8ec4a88a1bd5bf59377ea3d4f92adefe9633534d /ctdb | |
parent | 02edfb0f199fb7206df1f725aee56826d65716c1 (diff) | |
download | samba-e9ce035c2d2ef6fd177a3bb10031162586b696bd.tar.gz |
ctdb-tests: Move setting of CTDB_TEST_SUITE_DIR to run_tests.sh
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb')
-rwxr-xr-x | ctdb/tests/local_daemons.sh | 9 | ||||
-rwxr-xr-x | ctdb/tests/run_tests.sh | 7 | ||||
-rw-r--r-- | ctdb/tests/scripts/common.sh | 6 |
3 files changed, 10 insertions, 12 deletions
diff --git a/ctdb/tests/local_daemons.sh b/ctdb/tests/local_daemons.sh index 2efa91f76f4..6217e54332d 100755 --- a/ctdb/tests/local_daemons.sh +++ b/ctdb/tests/local_daemons.sh @@ -197,12 +197,9 @@ local_daemons_setup () fi for _n in $(seq 0 $((_num_nodes - 1))) ; do - # common.sh will set CTDB_TEST_SUITE_DIR to a stupid - # value when installed because common.sh is usually - # sourced by a test. CTDB_TEST_SUITE_DIR needs to be - # correctly set so setup_ctdb_base() finds the - # etc-ctdb/ subdirectory and the test event script is - # correctly installed, so fix it. + # CTDB_TEST_SUITE_DIR needs to be correctly set so + # setup_ctdb_base() finds the etc-ctdb/ subdirectory + # and the test event script is correctly installed # shellcheck disable=SC2034 CTDB_TEST_SUITE_DIR="$CTDB_TEST_DIR" \ setup_ctdb_base "$directory" "node.${_n}" \ diff --git a/ctdb/tests/run_tests.sh b/ctdb/tests/run_tests.sh index b74d7c5f193..5cca297fd64 100755 --- a/ctdb/tests/run_tests.sh +++ b/ctdb/tests/run_tests.sh @@ -181,6 +181,13 @@ run_one_test () { local f="$1" + CTDB_TEST_SUITE_DIR=$(dirname "$f") + export CTDB_TEST_SUITE_DIR + # This expands the most probable problem cases like "." and "..". + if [ "$(dirname "$CTDB_TEST_SUITE_DIR")" = "." ] ; then + CTDB_TEST_SUITE_DIR=$(cd "$CTDB_TEST_SUITE_DIR" && pwd) + fi + tests_total=$((tests_total + 1)) ctdb_test_run "$f" | show_progress diff --git a/ctdb/tests/scripts/common.sh b/ctdb/tests/scripts/common.sh index 2998df3cb98..de117e90caa 100644 --- a/ctdb/tests/scripts/common.sh +++ b/ctdb/tests/scripts/common.sh @@ -13,12 +13,6 @@ die () echo "$1" >&2 ; exit "${2:-1}" } -# This expands the most probable problem cases like "." and "..". -CTDB_TEST_SUITE_DIR=$(dirname "$0") -if [ "$(dirname "$CTDB_TEST_SUITE_DIR")" = "." ] ; then - CTDB_TEST_SUITE_DIR=$(cd "$CTDB_TEST_SUITE_DIR" && pwd) -fi - . "${TEST_SCRIPTS_DIR}/script_install_paths.sh" if [ -d "$CTDB_SCRIPTS_TOOLS_BIN_DIR" ] ; then |