From: Martin Schwenke Date: Mon, 26 Feb 2018 19:40:59 +0000 (+1100) Subject: ctdb-tests: Simplify a test X-Git-Tag: ldb-1.4.0~519 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=693ca7b99e6b2bcce5a3a9c375a2c7e83a053894;p=thirdparty%2Fsamba.git ctdb-tests: Simplify a test Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/tests/simple/20_delip_iface_gc.sh b/ctdb/tests/simple/20_delip_iface_gc.sh index 8ad001fb460..e73eed20cc0 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...