ctdb-tests: Do not run ip command if running against local daemons
authorAmitay Isaacs <amitay@gmail.com>
Tue, 8 Jul 2014 06:31:21 +0000 (16:31 +1000)
committerAmitay Isaacs <amitay@samba.org>
Tue, 8 Jul 2014 10:48:06 +0000 (12:48 +0200)
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Tue Jul  8 12:48:06 CEST 2014 on sn-devel-104

ctdb/tests/simple/16_ctdb_config_add_ip.sh

index b770bd6a6a457a53d219d95bd353c3dcbf0b133f..dc28130a19bdbe579c40fcc1bfe1b63e3712740b 100755 (executable)
@@ -64,9 +64,12 @@ echo "Selected node ${test_node} with IPs: $test_node_ips"
 
 # Try to find a free IP adddress.  This is inefficient but should
 # succeed quickly.
-try_command_on_node $test_node "ip addr show"
-all_test_node_ips=$(echo "$out" | sed -rn -e 's@^[[:space:]]+inet[[:space:]]+([[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+/[[:digit:]]+).*[[:space:]]([^[:space:]]+)+$@\1:\2@p')
-
+if [ -z "$TEST_LOCAL_DAEMONS" ] ; then
+    try_command_on_node $test_node "ip addr show"
+    all_test_node_ips=$(echo "$out" | sed -rn -e 's@^[[:space:]]+inet[[:space:]]+([[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+/[[:digit:]]+).*[[:space:]]([^[:space:]]+)+$@\1:\2@p')
+else
+    all_test_node_ips=""
+fi
 add_ip=""
 
 # Use an IP already on one of the nodes, remove the last octet and