From 693ca7b99e6b2bcce5a3a9c375a2c7e83a053894 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Tue, 27 Feb 2018 06:40:59 +1100 Subject: [PATCH] ctdb-tests: Simplify a test Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- ctdb/tests/simple/20_delip_iface_gc.sh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/ctdb/tests/simple/20_delip_iface_gc.sh b/ctdb/tests/simple/20_delip_iface_gc.sh index 8ad001fb460a..e73eed20cc00 100755 --- a/ctdb/tests/simple/20_delip_iface_gc.sh +++ b/ctdb/tests/simple/20_delip_iface_gc.sh @@ -18,14 +18,12 @@ cluster_is_healthy # Reset configuration ctdb_restart_when_done -echo "Getting public IPs information..." -try_command_on_node -v any "$CTDB ip -v all -X | tail -n +2" -ip_info="$out" - -# Select the first node and find out its interfaces -test_node=$(awk -F'|' 'NR == 1 { print $3}' <<<"$ip_info") -ifaces=$(awk -F'|' -v tn=$test_node '$3 == tn { print $6 }' <<<"$ip_info" | sed 's@, @ @g' | xargs -n 1 | sort -u) -echo "Selected test node ${test_node} with interfaces: ${ifaces}" +select_test_node_and_ips + +# Find interfaces on test node +try_command_on_node $test_node "$CTDB ifaces -X" +ifaces=$(awk -F'|' 'NR > 1 { print $2 }' <<<"$out") +echo "Node ${test_node} has interfaces: ${ifaces}" # Delete all IPs on each interface... deleting IPs from one interface # can cause other interfaces to disappear, so we need to be careful... -- 2.34.1