diff options
author | Martin Schwenke <martin@meltin.net> | 2018-02-06 16:41:36 +1100 |
---|---|---|
committer | Martin Schwenke <martins@samba.org> | 2018-03-01 19:39:14 +0100 |
commit | 99350c18aadb0345051f9a21111da1cae3eabe55 (patch) | |
tree | 4a3892cf67b3cc617a5120d756a492bfe62948b4 /ctdb | |
parent | 5537b36817925cb00ef142d5c7a17f5336133eed (diff) | |
download | samba-99350c18aadb0345051f9a21111da1cae3eabe55.tar.gz |
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>
Diffstat (limited to 'ctdb')
-rwxr-xr-x | ctdb/tests/eventscripts/etc-ctdb/rc.local | 1 | ||||
-rw-r--r-- | ctdb/tests/eventscripts/scripts/local.sh | 33 |
2 files changed, 16 insertions, 18 deletions
diff --git a/ctdb/tests/eventscripts/etc-ctdb/rc.local b/ctdb/tests/eventscripts/etc-ctdb/rc.local index 541474a8b73..72a79bc66ac 100755 --- a/ctdb/tests/eventscripts/etc-ctdb/rc.local +++ b/ctdb/tests/eventscripts/etc-ctdb/rc.local @@ -59,4 +59,3 @@ background_with_logging () } CTDB_INIT_STYLE="${EVENTSCRIPT_TESTS_INIT_STYLE:-redhat}" -PATH="${EVENTSCRIPTS_PATH}:$PATH" diff --git a/ctdb/tests/eventscripts/scripts/local.sh b/ctdb/tests/eventscripts/scripts/local.sh index adaad08a9b1..708733713d3 100644 --- a/ctdb/tests/eventscripts/scripts/local.sh +++ b/ctdb/tests/eventscripts/scripts/local.sh @@ -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. - -EVENTSCRIPTS_PATH="" - -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 +# +# Augment PATH with relevant stubs/ directories. +# + +stubs_dir="${TEST_SUBDIR}/stubs" +[ -d "${stubs_dir}" ] || die "Failed to locate stubs/ subdirectory" + +# Make the path absolute for tests that change directory +case "$stubs_dir" in +/*) : ;; +*) stubs_dir="${PWD}/${stubs_dir}" ;; +esac + +# Use stubs as helpers +export CTDB_HELPER_BINDIR="$stubs_dir" -export EVENTSCRIPTS_PATH +PATH="${stubs_dir}:${PATH}" -PATH="${EVENTSCRIPTS_PATH}:${PATH}" export CTDB="ctdb" |