1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

ctdb-tests: Clean up PATH setting for stubs/ subdirectory

Drop unnecessary PATH setting in rc.local. The functions file no
longer sets PATH so setting it here is unnecessary.  Fix a comment
referencing this PATH setting.

Given EVENTSCRIPTS_PATH is no longer used, use a more obvious variable
name and fail on missing stubs/ subdirectory.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
Martin Schwenke 2018-02-06 16:41:36 +11:00 committed by Martin Schwenke
parent 5537b36817
commit 99350c18aa
2 changed files with 14 additions and 16 deletions

View File

@ -59,4 +59,3 @@ background_with_logging ()
}
CTDB_INIT_STYLE="${EVENTSCRIPT_TESTS_INIT_STYLE:-redhat}"
PATH="${EVENTSCRIPTS_PATH}:$PATH"

View File

@ -1,24 +1,23 @@
# Hey Emacs, this is a -*- shell-script -*- !!! :-)
# Augment PATH with relevant stubs/ directories. We do this by actually
# setting PATH, and also by setting $EVENTSCRIPTS_PATH and then
# prepending that to $PATH in rc.local to avoid the PATH reset in
# functions.
#
# Augment PATH with relevant stubs/ directories.
#
EVENTSCRIPTS_PATH=""
stubs_dir="${TEST_SUBDIR}/stubs"
[ -d "${stubs_dir}" ] || die "Failed to locate stubs/ subdirectory"
if [ -d "${TEST_SUBDIR}/stubs" ] ; then
EVENTSCRIPTS_PATH="${TEST_SUBDIR}/stubs"
case "$EVENTSCRIPTS_PATH" in
/*) : ;;
*) EVENTSCRIPTS_PATH="${PWD}/${EVENTSCRIPTS_PATH}" ;;
esac
export CTDB_HELPER_BINDIR="$EVENTSCRIPTS_PATH"
fi
# Make the path absolute for tests that change directory
case "$stubs_dir" in
/*) : ;;
*) stubs_dir="${PWD}/${stubs_dir}" ;;
esac
export EVENTSCRIPTS_PATH
# Use stubs as helpers
export CTDB_HELPER_BINDIR="$stubs_dir"
PATH="${stubs_dir}:${PATH}"
PATH="${EVENTSCRIPTS_PATH}:${PATH}"
export CTDB="ctdb"