From e3089d7da17e2f25d426005eca0fe55397f2689f Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Wed, 17 Sep 2014 20:34:39 +1000 Subject: [PATCH] ctdb-tests: Make all_ips_on_node() do what it should The "-n all" is wrong. Simplify the implementation and tighten up some uses of this function. _select_test_node_and_ips() can't use this function anymore. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- ctdb/tests/scripts/integration.bash | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ctdb/tests/scripts/integration.bash b/ctdb/tests/scripts/integration.bash index d40582955b8..7b8699a37bf 100644 --- a/ctdb/tests/scripts/integration.bash +++ b/ctdb/tests/scripts/integration.bash @@ -160,13 +160,15 @@ sanity_check_ips () # This returns a list of "ip node" lines in $out all_ips_on_node() { - local node=$@ - try_command_on_node $node "$CTDB ip -Y -n all | cut -d ':' -f1-3 | sed -e '1d' -e 's@^:@@' -e 's@:@ @g'" + local node="$1" + try_command_on_node $node \ + "$CTDB ip -Y | awk -F: 'NR > 1 { print \$2, \$3 }'" } _select_test_node_and_ips () { - all_ips_on_node 0 + try_command_on_node any \ + "$CTDB ip -Y -n all | awk -F: 'NR > 1 { print \$2, \$3 }'" test_node="" # this matches no PNN test_node_ips="" @@ -412,7 +414,7 @@ ips_are_on_node () local out - all_ips_on_node 1 + all_ips_on_node $node local check for check in $ips ; do @@ -452,7 +454,7 @@ node_has_some_ips () local out - all_ips_on_node 1 + all_ips_on_node $node while read ip pnn ; do if [ "$node" = "$pnn" ] ; then -- 2.11.4.GIT