ctdb-event: Force script directory to be absolute
authorMartin Schwenke <martin@meltin.net>
Fri, 7 Sep 2018 03:39:49 +0000 (13:39 +1000)
committerAmitay Isaacs <amitay@samba.org>
Tue, 18 Dec 2018 01:02:03 +0000 (02:02 +0100)
If TEST_VAR_DIR is relative then symbolic link targets will be
incorrect.

Don't force TEST_VAR_DIR to be absolute because this can result in
Unix domain socket names that are too long.

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

index 9a264122e9a8734f57a4fe926fa50a2cc270d6a7..0ef93653dc7f77bb5e8a9b4709b6eccdd1621ef1 100755 (executable)
@@ -5,6 +5,8 @@
 scriptdir="${TEST_VAR_DIR}/cunit/scriptdir"
 mkdir -p "${scriptdir}"
 
+scriptdir=$(cd "$scriptdir" && echo "$PWD")
+
 test_cleanup "rm -rf ${scriptdir}"
 
 # Invalid path