diff options
author | Martin Schwenke <martin@meltin.net> | 2014-09-17 20:34:39 +1000 |
---|---|---|
committer | Amitay Isaacs <amitay@samba.org> | 2014-09-23 08:06:12 +0200 |
commit | e3089d7da17e2f25d426005eca0fe55397f2689f (patch) | |
tree | 203ee251aac9e0292071d2b6ce98ca352b68145b /ctdb | |
parent | 81213af32ae17eaae33f9d27c9b7ce63c84ce5df (diff) | |
download | samba-e3089d7da17e2f25d426005eca0fe55397f2689f.tar.gz samba-e3089d7da17e2f25d426005eca0fe55397f2689f.tar.xz samba-e3089d7da17e2f25d426005eca0fe55397f2689f.zip |
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 <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb')
-rw-r--r-- | ctdb/tests/scripts/integration.bash | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/ctdb/tests/scripts/integration.bash b/ctdb/tests/scripts/integration.bash index d40582955b..7b8699a37b 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 |