mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
ctdb-tests: Rename variable TEST_SUBDIR -> CTDB_TEST_SUITE_DIR
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
parent
f331f3f723
commit
02edfb0f19
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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}"
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user