]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-tests: Clean up PATH setting for stubs/ subdirectory
authorMartin Schwenke <martin@meltin.net>
Tue, 6 Feb 2018 05:41:36 +0000 (16:41 +1100)
committerMartin Schwenke <martins@samba.org>
Thu, 1 Mar 2018 18:39:14 +0000 (19:39 +0100)
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>
ctdb/tests/eventscripts/etc-ctdb/rc.local
ctdb/tests/eventscripts/scripts/local.sh

index 541474a8b7377fbc701dc2ebad61008d50979b75..72a79bc66ac2a9da22988476ca75e46d9ce8d087 100755 (executable)
@@ -59,4 +59,3 @@ background_with_logging ()
 }
 
 CTDB_INIT_STYLE="${EVENTSCRIPT_TESTS_INIT_STYLE:-redhat}"
-PATH="${EVENTSCRIPTS_PATH}:$PATH"
index adaad08a9b1e1348acdfcb2bd9e8829e11bfd02b..708733713d316d1cbbeed80e8c808da17f02a299 100644 (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.
-
-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"