8aedb339d94bf22ef9b4da466ae15638e4b7c9fd
[samba.git] / ctdb / tests / simple / 19_ip_takeover_noop.sh
1 #!/bin/bash
2
3 test_info()
4 {
5     cat <<EOF
6 Check that CTDB operates correctly if:
7
8 * failover is disabled; or
9 * there are 0 public IPs configured
10
11 This test only does anything with local daemons.  On a real cluster it
12 has no way of updating configuration.
13 EOF
14 }
15
16 . "${TEST_SCRIPTS_DIR}/integration.bash"
17
18 set -e
19
20 if [ -z "$TEST_LOCAL_DAEMONS" ] ; then
21         echo "SKIPPING this test - only runs against local daemons"
22         exit 0
23 fi
24
25 echo "Starting CTDB with failover disabled..."
26 ctdb_test_init --disable-failover
27
28 cluster_is_healthy
29
30 echo "Getting IP allocation..."
31 try_command_on_node -v any "$CTDB ip all | tail -n +2"
32
33 while read ip pnn ; do
34         if [ "$pnn" != "-1" ] ; then
35                 die "BAD: IP address ${ip} is assigned to node ${pnn}"
36         fi
37 done <<EOF
38 $out
39 EOF
40
41 echo "GOOD: All IP addresses are unassigned"
42
43 echo "----------------------------------------"
44
45 echo "Starting CTDB with an empty public addresses configuration..."
46 ctdb_test_init --no-public-addresses
47
48 cluster_is_healthy
49
50 echo "Trying explicit ipreallocate..."
51 try_command_on_node any $CTDB ipreallocate
52
53 echo "Good, that seems to work!"
54 echo