1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

tests: Integration tests use "ctdb nodestatus" for healthy cluster check

Also check that we're not in recovery mode.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit b7aaa28b3a6a2de923417f3d143f8d516447711e)
This commit is contained in:
Martin Schwenke 2013-06-20 16:43:10 +10:00 committed by Amitay Isaacs
parent 0a80d65c2e
commit 16d374f75e

View 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 ()