pthreadpool: Add a test for the race condition fixed in the last commit
[Samba.git] / ctdb / tests / simple / 19_ip_takeover_noop.sh
blob4cfedb06b3bf4c1c8e72caa3e39b0c4136b101fe
1 #!/bin/bash
3 test_info()
5 cat <<EOF
6 Check that CTDB operates correctly if:
8 * DisableIPFailover is set; or
9 * there are 0 public IPs configured
11 This test only does anything with local daemons. On a real cluster it
12 has no way of updating configuration.
13 EOF
16 . "${TEST_SCRIPTS_DIR}/integration.bash"
18 ctdb_test_init "$@"
20 set -e
22 cluster_is_healthy
24 if [ -z "$TEST_LOCAL_DAEMONS" ] ; then
25 echo "SKIPPING this test - only runs against local daemons"
26 exit 0
29 # Reset configuration
30 ctdb_restart_when_done
32 select_test_node_and_ips
34 echo "Setting DisableIPFailover=1 on all nodes"
35 try_command_on_node all $CTDB setvar DisableIPFailover 1
37 echo "Getting \"before\" IP allocation..."
38 try_command_on_node -v any $CTDB ip all
39 before="$out"
41 echo "Disabling node ${test_node}..."
42 try_command_on_node "$test_node" $CTDB disable
43 wait_until_node_has_status $test_node disabled
45 echo "Getting \"after\" IP allocation..."
46 try_command_on_node -v any $CTDB ip all
47 after="$out"
49 if [ "$before" == "$after" ] ; then
50 echo "GOOD: IP allocation is unchanged"
51 echo
52 else
53 die "BAD: IP allocation changed"
56 echo "----------------------------------------"
58 daemons_stop
60 echo "Starting CTDB with an empty public addresses configuration..."
61 CTDB_PUBLIC_ADDRESSES="/dev/null" daemons_start
63 wait_until_ready
65 echo "Trying explicit ipreallocate..."
66 try_command_on_node any $CTDB ipreallocate
68 echo "Good, that seems to work!"
69 echo
71 ps_ctdbd