]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-tests: Move setting of ctdb_dir and top_dir
authorMartin Schwenke <martin@meltin.net>
Tue, 9 Oct 2018 05:37:11 +0000 (16:37 +1100)
committerAmitay Isaacs <amitay@samba.org>
Tue, 6 Nov 2018 06:16:17 +0000 (07:16 +0100)
These are only used in script_install_paths.sh.

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

index 0e961cf24a54903dc67a54f6e67a25f3a2ee6bf7..41464abe5d50605114216408ae1187e58b94b0c5 100644 (file)
@@ -14,23 +14,6 @@ if [ $(dirname "$TEST_SUBDIR") = "." ] ; then
        TEST_SUBDIR=$(cd "$TEST_SUBDIR" ; pwd)
 fi
 
-# If we are running from within the source tree then, depending on the
-# tests that we're running, we may need to add the top level bin/ and
-# tools/ subdirectories to $PATH.  In this case, sanity check that
-# run_tests.sh is in the expected place.
-if ! $CTDB_TESTS_ARE_INSTALLED ; then
-       if [ ! -f "${CTDB_TEST_DIR}/run_tests.sh" ] ; then
-               die "Tests not installed but can't find run_tests.sh"
-       fi
-
-       ctdb_dir=$(dirname "$CTDB_TEST_DIR")
-
-       top_dir=$(cd -P "$ctdb_dir" && echo "$PWD") # real path
-       if [ ! -d "${top_dir}/bin" ] ; then
-               top_dir=$(dirname "$top_dir")
-       fi
-fi
-
 . "${TEST_SCRIPTS_DIR}/script_install_paths.sh"
 
 if [ -d "$CTDB_SCRIPTS_TOOLS_BIN_DIR" ] ; then
index 5d7c74df8ac3a9fd90af008b65328fd3cdbe84d8..a75abda248a148a7007712a98e300c1d47c97823 100644 (file)
@@ -1,8 +1,17 @@
 # Hey Emacs, this is a -*- shell-script -*- !!!  :-)
 
-# $ctdb_dir is set in common.sh
-if [  -n "$ctdb_dir" ] ; then
-       # Running in-tree
+if ! $CTDB_TESTS_ARE_INSTALLED ; then
+       if [ ! -f "${CTDB_TEST_DIR}/run_tests.sh" ] ; then
+               die "Tests not installed but can't find run_tests.sh"
+       fi
+
+       ctdb_dir=$(dirname "$CTDB_TEST_DIR")
+
+       top_dir=$(cd -P "$ctdb_dir" && echo "$PWD") # real path
+       if [ ! -d "${top_dir}/bin" ] ; then
+               top_dir=$(dirname "$top_dir")
+       fi
+
        CTDB_SCRIPTS_BASE="${ctdb_dir}/config"
        CTDB_SCRIPTS_INIT_SCRIPT="${ctdb_dir}/config/ctdb.init"
        CTDB_SCRIPTS_SBIN_DIR="${ctdb_dir}/config"