From: Martin Schwenke Date: Thu, 5 Sep 2019 05:51:08 +0000 (+1000) Subject: ctdb-tests: Only set TEST_SUBDIR when needed X-Git-Tag: talloc-2.3.1~846 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bb040f27985245449771a68606f0da2440ba1e7c;p=thirdparty%2Fsamba.git ctdb-tests: Only set TEST_SUBDIR when needed This is only needed for setup_ctdb_base() so only set it when calling this function. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/tests/local_daemons.sh b/ctdb/tests/local_daemons.sh index 4934783ff9a..15c80713b3b 100755 --- a/ctdb/tests/local_daemons.sh +++ b/ctdb/tests/local_daemons.sh @@ -13,14 +13,6 @@ export TEST_SCRIPTS_DIR="${CTDB_TEST_DIR}/scripts" . "${TEST_SCRIPTS_DIR}/common.sh" -# common.sh will set TEST_SUBDIR to a stupid value when installed -# because common.sh is usually sourced by a test. TEST_SUBDIR 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. -# shellcheck disable=SC2034 -TEST_SUBDIR="$CTDB_TEST_DIR" - if ! $CTDB_TESTS_ARE_INSTALLED ; then hdir="$CTDB_SCRIPTS_HELPER_BINDIR" export CTDB_EVENTD="${hdir}/ctdb-eventd" @@ -205,7 +197,15 @@ local_daemons_setup () fi for _n in $(seq 0 $((_num_nodes - 1))) ; do - setup_ctdb_base "$directory" "node.${_n}" \ + # common.sh will set TEST_SUBDIR to a stupid value + # when installed because common.sh is usually sourced + # by a test. TEST_SUBDIR 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. + # shellcheck disable=SC2034 + TEST_SUBDIR="$CTDB_TEST_DIR" \ + setup_ctdb_base "$directory" "node.${_n}" \ functions notify.sh debug-hung-script.sh cp "$_nodes_all" "${CTDB_BASE}/nodes"