summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2012-06-14 19:36:04 +1000
committerAmitay Isaacs <amitay@gmail.com>2012-07-26 22:03:00 +1000
commitc075c2e5c9c28e851096a16b99d53801c340140b (patch)
tree60d4b2280f6ab4264cad01214238083d46ce949a
parentc44a97dfa14d5a702aebbe54906bca87dbdc3b93 (diff)
downloadsamba-c075c2e5c9c28e851096a16b99d53801c340140b.tar.gz
samba-c075c2e5c9c28e851096a16b99d53801c340140b.tar.xz
samba-c075c2e5c9c28e851096a16b99d53801c340140b.zip
tests: select_test_node_and_ips() should never select non-node -1
Instead of selecting the 1st pnn found, select the 1st one that isn't -1. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit f02e501342112aab67aee95f253e29a670b29273)
-rw-r--r--ctdb/tests/scripts/integration.bash9
1 files changed, 4 insertions, 5 deletions
diff --git a/ctdb/tests/scripts/integration.bash b/ctdb/tests/scripts/integration.bash
index 70308de6186..e3301f283cf 100644
--- a/ctdb/tests/scripts/integration.bash
+++ b/ctdb/tests/scripts/integration.bash
@@ -238,14 +238,13 @@ select_test_node_and_ips ()
{
all_ips_on_node 0
- # When selecting test_node we just want a node that has public
- # IPs. This will work and is economically semi-random. :-)
- local x
- read x test_node <<<"$out"
-
+ test_node="" # this matches no PNN
test_node_ips=""
local ip pnn
while read ip pnn ; do
+ if [ -z "$test_node" -a "$pnn" != "-1" ] ; then
+ test_node="$pnn"
+ fi
if [ "$pnn" = "$test_node" ] ; then
test_node_ips="${test_node_ips}${test_node_ips:+ }${ip}"
fi