ctdb-tests: Make $ctdb_dir absolute
authorMartin Schwenke <martin@meltin.net>
Wed, 5 Feb 2020 01:07:55 +0000 (12:07 +1100)
committerAmitay Isaacs <amitay@samba.org>
Mon, 10 Feb 2020 04:07:39 +0000 (04:07 +0000)
This is used to set several variables so it might as well be cd-proof.

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

index 2bd8542e4b77a348103fcb448d5da8b7e8c549a0..9e54f4b473acf7c4229e55da368d9a3726e000bb 100644 (file)
@@ -5,9 +5,9 @@ if ! $CTDB_TESTS_ARE_INSTALLED ; then
                die "Tests not installed but can't find run_tests.sh"
        fi
 
-       ctdb_dir=$(dirname "$CTDB_TEST_DIR")
+       ctdb_dir=$(cd -P "$(dirname "$CTDB_TEST_DIR")" && pwd) # real path
 
-       top_dir=$(cd -P "$ctdb_dir" && echo "$PWD") # real path
+       top_dir="$ctdb_dir"
        if [ ! -d "${top_dir}/bin" ] ; then
                top_dir=$(dirname "$top_dir")
        fi