From bb040f27985245449771a68606f0da2440ba1e7c Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Thu, 5 Sep 2019 15:51:08 +1000 Subject: [PATCH] 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 --- ctdb/tests/local_daemons.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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" -- 2.47.3