ctdb-tests: Support testing scripts that change directory
authorMartin Schwenke <martin@meltin.net>
Fri, 27 Feb 2015 04:17:30 +0000 (15:17 +1100)
committerAmitay Isaacs <amitay@samba.org>
Wed, 4 Mar 2015 09:42:26 +0000 (10:42 +0100)
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/eventscripts/scripts/local.sh
ctdb/tests/scripts/common.sh

index f044ef8ffb5012f4c69aac957bb7b51f84e3c295..54a065c76a3b87d564d6b1dc94785eca5dc1a9cf 100644 (file)
@@ -9,6 +9,10 @@ EVENTSCRIPTS_PATH=""
 
 if [ -d "${TEST_SUBDIR}/stubs" ] ; then
     EVENTSCRIPTS_PATH="${TEST_SUBDIR}/stubs"
+    case "$EVENTSCRIPTS_PATH" in
+       /*) : ;;
+       *) EVENTSCRIPTS_PATH="${PWD}/${EVENTSCRIPTS_PATH}" ;;
+    esac
 fi
 
 export EVENTSCRIPTS_PATH
index 754ea2e7e2d988b59d089afe34dc7d5fc57c9904..287fb71fd1d76e259e123d6a58117f4931691234 100644 (file)
@@ -30,6 +30,10 @@ if [ -f "${_test_dir}/run_tests.sh" ] ; then
 fi
 
 _test_bin_dir="${TEST_BIN_DIR:-${ctdb_dir}/bin}"
+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