summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2016-09-13 13:48:19 +1000
committerMartin Schwenke <martins@samba.org>2016-09-14 12:30:30 +0200
commit9f6015f8a61f71db7239fb8dce94781629b1d4cc (patch)
tree07cedc2a89db49704d9cae4f5794e963c3d2cd81
parent3adf9cad47532d9ebf7ae3e4e618dfe7100008fb (diff)
downloadsamba-9f6015f8a61f71db7239fb8dce94781629b1d4cc.tar.gz
ctdb-tests: Add new public IP takeover no-op test
Test with DisableIPFailover=1 and with no public IP addresses configured. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12254 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Wed Sep 14 12:30:30 CEST 2016 on sn-devel-144
-rwxr-xr-xctdb/tests/simple/19_ip_takeover_noop.sh71
1 files changed, 71 insertions, 0 deletions
diff --git a/ctdb/tests/simple/19_ip_takeover_noop.sh b/ctdb/tests/simple/19_ip_takeover_noop.sh
new file mode 100755
index 00000000000..4cfedb06b3b
--- /dev/null
+++ b/ctdb/tests/simple/19_ip_takeover_noop.sh
@@ -0,0 +1,71 @@
+#!/bin/bash
+
+test_info()
+{
+ cat <<EOF
+Check that CTDB operates correctly if:
+
+* DisableIPFailover is set; 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.
+EOF
+}
+
+. "${TEST_SCRIPTS_DIR}/integration.bash"
+
+ctdb_test_init "$@"
+
+set -e
+
+cluster_is_healthy
+
+if [ -z "$TEST_LOCAL_DAEMONS" ] ; then
+ echo "SKIPPING this test - only runs against local daemons"
+ exit 0
+fi
+
+# Reset configuration
+ctdb_restart_when_done
+
+select_test_node_and_ips
+
+echo "Setting DisableIPFailover=1 on all nodes"
+try_command_on_node all $CTDB setvar DisableIPFailover 1
+
+echo "Getting \"before\" IP allocation..."
+try_command_on_node -v any $CTDB ip all
+before="$out"
+
+echo "Disabling node ${test_node}..."
+try_command_on_node "$test_node" $CTDB disable
+wait_until_node_has_status $test_node disabled
+
+echo "Getting \"after\" IP allocation..."
+try_command_on_node -v any $CTDB ip all
+after="$out"
+
+if [ "$before" == "$after" ] ; then
+ echo "GOOD: IP allocation is unchanged"
+ echo
+else
+ die "BAD: IP allocation changed"
+fi
+
+echo "----------------------------------------"
+
+daemons_stop
+
+echo "Starting CTDB with an empty public addresses configuration..."
+CTDB_PUBLIC_ADDRESSES="/dev/null" daemons_start
+
+wait_until_ready
+
+echo "Trying explicit ipreallocate..."
+try_command_on_node any $CTDB ipreallocate
+
+echo "Good, that seems to work!"
+echo
+
+ps_ctdbd