ctdb-tests: Rename variable TEST_SUBDIR -> CTDB_TEST_SUITE_DIR
authorMartin Schwenke <martin@meltin.net>
Fri, 6 Sep 2019 10:54:37 +0000 (20:54 +1000)
committerAmitay Isaacs <amitay@samba.org>
Tue, 24 Sep 2019 02:27:29 +0000 (02:27 +0000)
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/eventscripts/scripts/local.sh
ctdb/tests/local_daemons.sh
ctdb/tests/onnode/scripts/local.sh
ctdb/tests/scripts/common.sh
ctdb/tests/scripts/integration.bash
ctdb/tests/scripts/unit.sh
ctdb/tests/simple/scripts/local.bash

index c0eb72badd1d10f5cd99987ee61844cfcb18ce4d..16eeafd1050fc988950da411579121f4154b5247 100644 (file)
@@ -4,7 +4,7 @@
 # Augment PATH with relevant stubs/ directories.
 #
 
-stubs_dir="${TEST_SUBDIR}/stubs"
+stubs_dir="${CTDB_TEST_SUITE_DIR}/stubs"
 [ -d "${stubs_dir}" ] || die "Failed to locate stubs/ subdirectory"
 
 # Make the path absolute for tests that change directory
@@ -35,8 +35,8 @@ export CTDB_LOGGING="file:${EVENTSCRIPTS_TESTS_VAR_DIR}/log.ctdb"
 touch "${CTDB_LOGGING#file:}" || \
     die "Unable to setup logging for \"$CTDB_LOGGING\""
 
-if [ -d "${TEST_SUBDIR}/etc" ] ; then
-    cp -a "${TEST_SUBDIR}/etc" "$EVENTSCRIPTS_TESTS_VAR_DIR"
+if [ -d "${CTDB_TEST_SUITE_DIR}/etc" ] ; then
+    cp -a "${CTDB_TEST_SUITE_DIR}/etc" "$EVENTSCRIPTS_TESTS_VAR_DIR"
     export CTDB_SYS_ETCDIR="${EVENTSCRIPTS_TESTS_VAR_DIR}/etc"
 else
     die "Unable to setup \$CTDB_SYS_ETCDIR"
@@ -495,7 +495,7 @@ define_test ()
        printf "%-17s %-10s %-4s - %s\n\n" \
               "$script_short" "$event" "$_num" "$desc"
 
-       _f="${TEST_SUBDIR}/scripts/${script_short}.sh"
+       _f="${CTDB_TEST_SUITE_DIR}/scripts/${script_short}.sh"
        if [ -r "$_f" ] ; then
                . "$_f"
        fi
index 15c80713b3b32d4412bc097852344f07a4f01b90..2efa91f76f40d265d6f6ca3858e2a88e2b803e0b 100755 (executable)
@@ -197,14 +197,14 @@ local_daemons_setup ()
        fi
 
        for _n in $(seq 0 $((_num_nodes - 1))) ; do
-               # 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.
+               # 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.
                # shellcheck disable=SC2034
-               TEST_SUBDIR="$CTDB_TEST_DIR" \
+               CTDB_TEST_SUITE_DIR="$CTDB_TEST_DIR" \
                           setup_ctdb_base "$directory" "node.${_n}" \
                                functions notify.sh debug-hung-script.sh
 
index d5067f8cb6c25baca66cb827907bf05b9cd857b8..1236145e5bd84864df2d350a410bcd7590537163 100644 (file)
@@ -4,7 +4,7 @@
 : ${ONNODE:=onnode}
 
 # Augment PATH with relevant stubs/ directory
-stubs_dir="${TEST_SUBDIR}/stubs"
+stubs_dir="${CTDB_TEST_SUITE_DIR}/stubs"
 [ -d "${stubs_dir}" ] || die "Failed to locate stubs/ subdirectory"
 PATH="${stubs_dir}:${PATH}"
 
index 519219ca982a3d94436b9067c33e1abf3148ae90..2998df3cb98cd51bfdc3e595de6959ffc546fc18 100644 (file)
@@ -14,9 +14,9 @@ die ()
 }
 
 # This expands the most probable problem cases like "." and "..".
-TEST_SUBDIR=$(dirname "$0")
-if [ "$(dirname "$TEST_SUBDIR")" = "." ] ; then
-       TEST_SUBDIR=$(cd "$TEST_SUBDIR" && pwd)
+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"
@@ -102,11 +102,11 @@ setup_ctdb_base ()
 
        mkdir -p "${CTDB_BASE}/events/legacy"
 
-       if [ -z "$TEST_SUBDIR" ] ; then
+       if [ -z "$CTDB_TEST_SUITE_DIR" ] ; then
                return
        fi
 
-       for _i in "${TEST_SUBDIR}/etc-ctdb/"* ; do
+       for _i in "${CTDB_TEST_SUITE_DIR}/etc-ctdb/"* ; do
                # No/empty etc-ctdb directory
                [ -e "$_i" ] || break
 
index 0aaede98e8aacf30e4a438cce375000abc878108..966bce4f3f6a401eccc20670fd6a025ef6afbdf1 100644 (file)
@@ -723,7 +723,7 @@ ctdb_enable_cluster_test_event_scripts ()
 # Make sure that $CTDB is set.
 : ${CTDB:=ctdb}
 
-local="${TEST_SUBDIR}/scripts/local.bash"
+local="${CTDB_TEST_SUITE_DIR}/scripts/local.bash"
 if [ -r "$local" ] ; then
     . "$local"
 fi
index e9476aef07557e6bb11c0d8e2cf38387f9d26c41..7713496cf575acd5191719a8ce684ebb9d8f7120 100644 (file)
@@ -240,7 +240,7 @@ test_cleanup ()
 
 trap 'eval $test_cleanup_hooks' 0
 
-local="${TEST_SUBDIR}/scripts/local.sh"
+local="${CTDB_TEST_SUITE_DIR}/scripts/local.sh"
 if [ -r "$local" ] ; then
     . "$local"
 fi
index 5ffe2892c5c93b232379e7d33e9a4c69604acde1..eb91353ac79368fdc4673f081bd86318d5ec7444 100644 (file)
@@ -7,5 +7,5 @@ export SIMPLE_TESTS_VAR_DIR="${TEST_VAR_DIR}/simple"
 mkdir -p "$SIMPLE_TESTS_VAR_DIR"
 
 if [ -n "$TEST_LOCAL_DAEMONS" ] ; then
-       . "${TEST_SUBDIR}/scripts/local_daemons.bash"
+       . "${CTDB_TEST_SUITE_DIR}/scripts/local_daemons.bash"
 fi