smbd: Simplify validate_lock_entries
[Samba.git] / ctdb / tests / simple / 32_ctdb_enable.sh
blob7cc3da31291d262bbb0f6e3cbf4bc534390c6a9e
1 #!/bin/bash
3 test_info()
5 cat <<EOF
6 Verify the operation of 'ctdb enable'.
8 This is a superficial test of the 'ctdb enable' command. It trusts
9 information from CTDB that indicates that the IP failover has happened
10 correctly. Another test should check that the failover has actually
11 happened at the networking level.
13 Prerequisites:
15 * An active CTDB cluster with at least 2 active nodes.
17 Steps:
19 1. Verify that the status on all of the ctdb nodes is 'OK'.
20 2. Disable one of the nodes using 'ctdb disable -n <node>'.
21 3. Verify that the status of the node changes to 'disabled'.
22 4. Verify that the public IP addreses served by the disabled node are
23 failed over to other nodes.
24 5. Enable the disabled node using 'ctdb enable -n '<node>'.
25 6. Verify that the status changes back to 'OK'.
26 7. Verify that some public IP addreses are failed back to the node.
29 Expected results:
31 * The status of a re-enabled node changes as expected and IP addresses
32 fail back as expected.
33 EOF
36 . "${TEST_SCRIPTS_DIR}/integration.bash"
38 ctdb_test_init "$@"
40 ########################################
42 set -e
44 cluster_is_healthy
46 select_test_node_and_ips
48 echo "Disabling node $test_node"
49 try_command_on_node 1 $CTDB disable -n $test_node
51 wait_until_node_has_status $test_node disabled
53 if wait_until_ips_are_on_nodeglob "[!${test_node}]" $test_node_ips ; then
54 echo "All IPs moved."
55 else
56 echo "Some IPs didn't move."
57 testfailures=1
60 echo "Reenabling node $test_node"
61 try_command_on_node 1 $CTDB enable -n $test_node
63 wait_until_node_has_status $test_node enabled
65 wait_until_node_has_some_ips "$test_node"