ctdb-tests: Extend regexps to handle IPv6 address matching
authorMartin Schwenke <martin@meltin.net>
Wed, 3 Dec 2014 04:58:20 +0000 (15:58 +1100)
committerMartin Schwenke <martins@samba.org>
Fri, 5 Dec 2014 20:02:40 +0000 (21:02 +0100)
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/complex/11_ctdb_delip_removes_ip.sh

index d67cb070c8a34589e35687d81d0c863d2a713bfd..d023e98da8f26c294f5d8d2d3273eaeb0b171943 100755 (executable)
@@ -26,7 +26,7 @@ select_test_node_and_ips
 get_test_ip_mask_and_iface
 
 echo "Checking that node ${test_node} hosts ${test_ip} on interface ${iface}..."
-try_command_on_node $test_node "ip addr show dev $iface | grep -E 'inet[[:space:]]*${test_ip}/'"
+try_command_on_node $test_node "ip addr show dev $iface | grep -E 'inet6?[[:space:]]*${test_ip}/'"
 
 echo "Attempting to remove ${test_ip} from node ${test_node}."
 try_command_on_node $test_node $CTDB delip $test_ip
@@ -38,7 +38,7 @@ count=0
 echo "Waiting for ${test_ip} to disappear from ${iface}..."
 while : ; do
     try_command_on_node -v $test_node "ip addr show dev $iface"
-    if echo "$out" | grep -E 'inet[[:space:]]*${test_ip}/'; then
+    if echo "$out" | grep -E 'inet6?[[:space:]]*${test_ip}/'; then
        echo "Still there..."
        if [ $(($count * $increment)) -ge $timeout ] ; then
            echo "BAD: Timed out waiting..."