1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-25 06:04:04 +03:00
Martin Schwenke e8de58abd7 tools/onnode: Fix healthy/ok node handling
This bit-rotted a long time ago when the "ThisNode" column was added
to "ctdb -Y status" output.  The fake "ctdb -Y status" output in the
test was never updated to reflect this change.

Instead of making sure that all columns are "0", just check that
they're not "1".  This implicitly ignores "Y" and "N" in this
"ThisNode" column without having to do anything else clever.

Also update associated tests.  The main "ctdb ok" test had a duplicate
opening line for a here document, which was tickled by this change.

This fixes samba bz#8122.

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

onnode test fixup

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

(This used to be ctdb commit 01a46205c3a3d6609dc0b0324319b89667dffa32)
2013-10-29 17:14:55 +11:00

33 lines
616 B
Bash
Executable File

#!/bin/sh
. "${TEST_SCRIPTS_DIR}/unit.sh"
cmd="$ONNODE ok hostname"
define_test "$cmd" "all nodes OK"
ctdb_set_output <<EOF
:Node:IP:Disconnected:Banned:Disabled:Unhealthy:Stopped:Inactive:PartiallyOnline:ThisNode:
:0:192.168.1.101:0:0:0:0:0:0:0:Y:
:1:192.168.1.102:0:0:0:0:0:0:0:N:
:2:192.168.1.103:0:0:0:0:0:0:0:N:
:3:192.168.1.104:0:0:0:0:0:0:0:N:
EOF
required_result <<EOF
>> NODE: 192.168.1.101 <<
-n 192.168.1.101 hostname
>> NODE: 192.168.1.102 <<
-n 192.168.1.102 hostname
>> NODE: 192.168.1.103 <<
-n 192.168.1.103 hostname
>> NODE: 192.168.1.104 <<
-n 192.168.1.104 hostname
EOF
simple_test $cmd