tests: Integration tests use "ctdb nodestatus" for healthy cluster check
authorMartin Schwenke <martin@meltin.net>
Thu, 20 Jun 2013 06:43:10 +0000 (16:43 +1000)
committerAmitay Isaacs <amitay@gmail.com>
Sat, 22 Jun 2013 05:51:17 +0000 (15:51 +1000)
Also check that we're not in recovery mode.

Signed-off-by: Martin Schwenke <martin@meltin.net>
tests/scripts/integration.bash

index a43ffe8be0f1ece2cb4bb2447101f30344edcf3b..95d67c3a35e0d513a134e19301e93a69b840ecc1 100644 (file)
@@ -320,21 +320,8 @@ sleep_for ()
 
 _cluster_is_healthy ()
 {
-    local out x count line
-
-    out=$($CTDB -Y status 2>/dev/null) || return 1
-
-    {
-        read x
-       count=0
-        while read line ; do
-           # We need to see valid lines if we're going to be healthy.
-           [ "${line#:[0-9]}" != "$line" ] && count=$(($count + 1))
-           # A line indicating a node is unhealthy causes failure.
-           [ "${line##:*:*:*1:}" != "$line" ] && return 1
-        done
-       [ $count -gt 0 ] && return $?
-    } <<<"$out" # Yay bash!
+    $CTDB nodestatus all >/dev/null && \
+       node_has_status 0 recovered
 }
 
 cluster_is_healthy ()