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.
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
{
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"
persistent database directory = ${db_dir}/persistent
state database directory = ${db_dir}/state
+[failover]
+ disabled = ${disable_failover}
+
[event]
debug script = debug-hung-script.sh
EOF