ctdb-tests: Force symbolic link targets to be absolute
authorMartin Schwenke <martin@meltin.net>
Fri, 7 Sep 2018 04:45:00 +0000 (14:45 +1000)
committerAmitay Isaacs <amitay@gmail.com>
Tue, 18 Dec 2018 02:36:47 +0000 (13:36 +1100)
If CTDB_BASE is relative then the symbolic link target will be
incorrect.

Don't force CTDB_BASE 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/eventd/eventd_009.sh

index 1e3d86e..39e5cd6 100755 (executable)
@@ -66,7 +66,8 @@ simple_test script list data
 # Local/3rd-party link, not enabled
 touch "${CTDB_BASE}/foo"
 chmod 644 "${CTDB_BASE}/foo"
-ln -s "${CTDB_BASE}/foo" "${CTDB_BASE}/events/data/04.locallink.script"
+abs_base=$(cd "$CTDB_BASE" && echo "$PWD")
+ln -s "${abs_base}/foo" "${CTDB_BASE}/events/data/04.locallink.script"
 
 ok <<EOF
 * 01.dummy
@@ -99,7 +100,7 @@ simple_test script list data
 
 # Local/3rd-party link, enabled
 chmod +x "${CTDB_BASE}/foo"
-ln -s "${CTDB_BASE}/foo" "${CTDB_BASE}/events/data/04.locallink.script"
+ln -s "${abs_base}/foo" "${CTDB_BASE}/events/data/04.locallink.script"
 
 ok <<EOF
 * 01.dummy