summaryrefslogtreecommitdiffstats
path: root/ctdb/tests
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2014-12-01 13:50:42 +1100
committerMartin Schwenke <martins@samba.org>2014-12-05 21:02:40 +0100
commit255705c030135bd54a1f7a7dc40cbf00c2fb39c9 (patch)
tree56caade1aeb362bf8f827b4a9b8f2a25f5529b0e /ctdb/tests
parent62acf5986f52a3118ed4e3638c5ac8b1f9c0adf8 (diff)
downloadsamba-255705c030135bd54a1f7a7dc40cbf00c2fb39c9.tar.gz
samba-255705c030135bd54a1f7a7dc40cbf00c2fb39c9.tar.xz
samba-255705c030135bd54a1f7a7dc40cbf00c2fb39c9.zip
ctdb-tests: Use ping_wrapper to do relevant ping or ping6
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb/tests')
-rwxr-xr-xctdb/tests/complex/33_gratuitous_arp.sh2
-rwxr-xr-xctdb/tests/complex/41_failover_ping_discrete.sh4
-rw-r--r--ctdb/tests/complex/scripts/local.bash7
3 files changed, 10 insertions, 3 deletions
diff --git a/ctdb/tests/complex/33_gratuitous_arp.sh b/ctdb/tests/complex/33_gratuitous_arp.sh
index 721b0f2a34..a51aa0cdce 100755
--- a/ctdb/tests/complex/33_gratuitous_arp.sh
+++ b/ctdb/tests/complex/33_gratuitous_arp.sh
@@ -57,7 +57,7 @@ echo "Removing ${test_ip} from the local ARP table..."
arp -d $test_ip >/dev/null 2>&1 || true
echo "Pinging ${test_ip}..."
-ping -q -n -c 1 $test_ip
+ping_wrapper -q -n -c 1 $test_ip
echo "Getting MAC address associated with ${test_ip}..."
original_mac=$(arp -n $test_ip | awk '$2 == "ether" {print $3}')
diff --git a/ctdb/tests/complex/41_failover_ping_discrete.sh b/ctdb/tests/complex/41_failover_ping_discrete.sh
index 88b2013f06..1fe7c1f548 100755
--- a/ctdb/tests/complex/41_failover_ping_discrete.sh
+++ b/ctdb/tests/complex/41_failover_ping_discrete.sh
@@ -51,7 +51,7 @@ echo "Removing ${test_ip} from the local ARP table..."
arp -d $test_ip >/dev/null 2>&1 || true
echo "Pinging ${test_ip}..."
-ping -q -n -c 1 $test_ip
+ping_wrapper -q -n -c 1 $test_ip
gratarp_sniff_start
@@ -65,4 +65,4 @@ echo "Removing ${test_ip} from the local ARP table again..."
arp -d $test_ip >/dev/null 2>&1 || true
echo "Pinging ${test_ip} again..."
-ping -q -n -c 1 $test_ip
+ping_wrapper -q -n -c 1 $test_ip
diff --git a/ctdb/tests/complex/scripts/local.bash b/ctdb/tests/complex/scripts/local.bash
index 6fbc1aea71..fcd919b372 100644
--- a/ctdb/tests/complex/scripts/local.bash
+++ b/ctdb/tests/complex/scripts/local.bash
@@ -170,3 +170,10 @@ ctdb_test_check_real_cluster ()
done
}
+ping_wrapper ()
+{
+ case "$*" in
+ *:*) ping6 "$@" ;;
+ *) ping "$@" ;;
+ esac
+}