1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00

ctdb-tests: Check that no IPs are assigned when failover is disabled

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13589

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>

Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Fri Aug 24 14:13:12 CEST 2018 on sn-devel-144
This commit is contained in:
Martin Schwenke 2018-08-24 17:37:38 +10:00 committed by Amitay Isaacs
parent 55893bf8d2
commit 6fb80cbffb
2 changed files with 31 additions and 1 deletions

View File

@ -3,7 +3,10 @@
test_info()
{
cat <<EOF
Check that CTDB operates correctly if there are 0 public IPs configured
Check that CTDB operates correctly if:
* failover is disabled; or
* there are 0 public IPs configured
This test only does anything with local daemons. On a real cluster it
has no way of updating configuration.
@ -30,6 +33,28 @@ select_test_node_and_ips
daemons_stop
echo "Starting CTDB with failover disabled..."
setup_ctdb --disable-failover
daemons_start
wait_until_ready
echo "Getting IP allocation..."
try_command_on_node -v any "$CTDB ip all | tail -n +2"
while read ip pnn ; do
if [ "$pnn" != "-1" ] ; then
die "BAD: IP address ${ip} is assigned to node ${pnn}"
fi
done <<EOF
$out
EOF
echo "GOOD: All IP addresses are unassigned"
echo "----------------------------------------"
daemons_stop
echo "Starting CTDB with an empty public addresses configuration..."
setup_ctdb --no-public-addresses
daemons_start

View File

@ -94,9 +94,11 @@ setup_ctdb ()
{
local no_public_addresses=false
local no_event_scripts=false
local disable_failover=false
case "$1" in
--no-public-addresses) no_public_addresses=true ;;
--no-event-scripts) no_event_scripts=true ;;
--disable-failover) disable_failover=true ;;
esac
nodes_file="${SIMPLE_TESTS_VAR_DIR}/nodes"
@ -154,6 +156,9 @@ setup_ctdb ()
persistent database directory = ${db_dir}/persistent
state database directory = ${db_dir}/state
[failover]
disabled = ${disable_failover}
[event]
debug script = debug-hung-script.sh
EOF