summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ctdb/tests/scripts/integration.bash19
-rwxr-xr-xctdb/tests/simple/60_recoverd_missing_ip.sh14
2 files changed, 20 insertions, 13 deletions
diff --git a/ctdb/tests/scripts/integration.bash b/ctdb/tests/scripts/integration.bash
index 548b1e19c0..d40582955b 100644
--- a/ctdb/tests/scripts/integration.bash
+++ b/ctdb/tests/scripts/integration.bash
@@ -202,6 +202,25 @@ select_test_node_and_ips ()
return 0
}
+# Sets: mask, iface
+get_test_ip_mask_and_iface ()
+{
+ # Find the interface
+ try_command_on_node $test_node "$CTDB ip -v -Y | awk -F: -v ip=$test_ip '\$2 == ip { print \$4 }'"
+ iface="$out"
+
+ if [ -z "$TEST_LOCAL_DAEMONS" ] ; then
+ # Find the netmask
+ try_command_on_node $test_node ip addr show to $test_ip
+ mask="${out##*/}"
+ mask="${mask%% *}"
+ else
+ mask="24"
+ fi
+
+ echo "$test_ip/$mask is on $iface"
+}
+
#######################################
# Wait until either timeout expires or command succeeds. The command
diff --git a/ctdb/tests/simple/60_recoverd_missing_ip.sh b/ctdb/tests/simple/60_recoverd_missing_ip.sh
index 8ba05702a9..d6d5310662 100755
--- a/ctdb/tests/simple/60_recoverd_missing_ip.sh
+++ b/ctdb/tests/simple/60_recoverd_missing_ip.sh
@@ -22,19 +22,7 @@ select_test_node_and_ips
echo "Running test against node $test_node and IP $test_ip"
-# Find the interface
-try_command_on_node $test_node "$CTDB ip -v -Y | awk -F: -v ip=$test_ip '\$2 == ip { print \$4 }'"
-iface="$out"
-
-if [ -z "$TEST_LOCAL_DAEMONS" ] ; then
- # Find the netmask
- try_command_on_node $test_node ip addr show to $test_ip
- mask="${out##*/}"
- mask="${mask%% *}"
-else
- mask="24"
-fi
-
+get_test_ip_mask_and_iface
echo "$test_ip/$mask is on $iface"
echo "Deleting IP $test_ip from all nodes"