From: Martin Schwenke Date: Wed, 29 Aug 2018 23:35:58 +0000 (+1000) Subject: ctdb-tests: If bin/ isn't in ctdb/ then look one level higher X-Git-Tag: tdb-1.3.17~1891 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eed738a37a6f40ca259153979f364c17e77f52ea;p=thirdparty%2Fsamba.git ctdb-tests: If bin/ isn't in ctdb/ then look one level higher CTDB's test suite doesn't work from a top-level compile. The first step to fixing this is to correctly locate the bin/ directory. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/tests/scripts/common.sh b/ctdb/tests/scripts/common.sh index dfba6fd00e3..143ae088b1d 100644 --- a/ctdb/tests/scripts/common.sh +++ b/ctdb/tests/scripts/common.sh @@ -37,13 +37,15 @@ else PATH="${_tools_dir}:$PATH" fi - _test_bin_dir="${ctdb_dir}/bin" + top_dir=$(cd -P "$ctdb_dir" && echo "$PWD") # real path + + _test_bin_dir="${top_dir}/bin" + if [ ! -d "$_test_bin_dir" ] ; then + top_dir=$(dirname "$top_dir") + _test_bin_dir="${top_dir}/bin" + fi fi -case "$_test_bin_dir" in -/*) : ;; -*) _test_bin_dir="${PWD}/${_test_bin_dir}" ;; -esac if [ -d "$_test_bin_dir" ] ; then PATH="${_test_bin_dir}:$PATH" fi diff --git a/ctdb/tests/scripts/script_install_paths.sh b/ctdb/tests/scripts/script_install_paths.sh index c0777c9b7fe..5266ba409c4 100644 --- a/ctdb/tests/scripts/script_install_paths.sh +++ b/ctdb/tests/scripts/script_install_paths.sh @@ -8,7 +8,7 @@ if [ -n "$ctdb_dir" ] ; then CTDB_SCRIPTS_SBIN_DIR="${ctdb_dir}/config" CTDB_SCRIPTS_TOOLS_BIN_DIR="${ctdb_dir}/tools" CTDB_SCRIPTS_TOOLS_HELPER_DIR="${ctdb_dir}/tools" - CTDB_SCRIPTS_HELPER_BINDIR="${ctdb_dir}/bin" + CTDB_SCRIPTS_HELPER_BINDIR="${top_dir}/bin" CTDB_SCRIPTS_DATA_DIR="${ctdb_dir}/config" else # Installed