ctdb-tests: Use known install paths in local daemon tests
authorMartin Schwenke <martin@meltin.net>
Wed, 29 Aug 2018 23:37:53 +0000 (09:37 +1000)
committerAmitay Isaacs <amitay@samba.org>
Mon, 3 Sep 2018 08:52:12 +0000 (10:52 +0200)
The in-tree local daemons tests don't work from a top-level Samba
compile.  The simple test suite was the first test suite and things
have generally worked, so it has been slow to adopt general test
infrastructure changes.

Instead of re-calculating script and helper locations, use the paths
from script_install_paths.sh.  The bin/ directory is already added to
PATH in common.sh, so don't add it here.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/simple/scripts/local_daemons.bash

index c7a5ee05fc62a1fb9fd331a716aa3fd636108e95..f4a32aa5289f24c0ed39b622fc49888ede6eed4f 100644 (file)
@@ -1,19 +1,16 @@
 # If we're not running on a real cluster then we need a local copy of
 # ctdb (and other stuff) in $PATH and we will use local daemons.
 
-# Use in-tree binaries if running against local daemons.
-# Otherwise CTDB need to be installed on all nodes.
-if [ -n "$ctdb_dir" -a -d "${ctdb_dir}/bin" ] ; then
-       # ctdbd_wrapper is in config/ directory
-       PATH="${ctdb_dir}/bin:${ctdb_dir}/config:${PATH}"
-       hdir="${ctdb_dir}/bin"
-       export CTDB_EVENTD="${hdir}/ctdb-eventd"
-       export CTDB_EVENT_HELPER="${hdir}/ctdb-event"
-       export CTDB_LOCK_HELPER="${hdir}/ctdb_lock_helper"
-       export CTDB_RECOVERY_HELPER="${hdir}/ctdb_recovery_helper"
-       export CTDB_TAKEOVER_HELPER="${hdir}/ctdb_takeover_helper"
-       export CTDB_CLUSTER_MUTEX_HELPER="${hdir}/ctdb_mutex_fcntl_helper"
-fi
+# For ctdbd_wrapper
+PATH="${CTDB_SCRIPTS_BASE}:${PATH}"
+
+hdir="$CTDB_SCRIPTS_HELPER_BINDIR"
+export CTDB_EVENTD="${hdir}/ctdb-eventd"
+export CTDB_EVENT_HELPER="${hdir}/ctdb-event"
+export CTDB_LOCK_HELPER="${hdir}/ctdb_lock_helper"
+export CTDB_RECOVERY_HELPER="${hdir}/ctdb_recovery_helper"
+export CTDB_TAKEOVER_HELPER="${hdir}/ctdb_takeover_helper"
+export CTDB_CLUSTER_MUTEX_HELPER="${hdir}/ctdb_mutex_fcntl_helper"
 
 if [ -n "$TEST_SOCKET_WRAPPER_SO_PATH" ] ; then
        export LD_PRELOAD="$TEST_SOCKET_WRAPPER_SO_PATH"