Test suite - fix addip test.
[sahlberg/ctdb.git] / tests / simple / 19_ctdb_thaw.sh
1 #!/bin/bash
2
3 test_info()
4 {
5     cat <<EOF
6 Verify 'ctdb thaw' works correctly.
7
8 This is a superficial test that simply checks that 'ctdb statistics'
9 reports the node becomes unfrozen.  No checks are done to ensure that
10 client access to databases is unblocked.
11
12 Prerequisites:
13
14 * An active CTDB cluster with at least 2 active nodes.
15
16 Steps:
17
18 1. Verify that the status on all of the ctdb nodes is 'OK'.
19 2. Use 'ctdb freeze -n <node>' to freeze the databases on one of the
20    nodes.
21 3. Run 'ctdb statistics' to verify that 'frozen' has the value '1' on
22    the node.
23 4, Now run 'ctdb thaw -n <node>' on the same node.
24 5. Run 'ctdb statistics' to verify that 'frozen' once again has the
25    value '0' on the node.
26
27
28 Expected results:
29
30 * 'ctdb thaw' causes a node to 'thaw' and the status change can be
31   seem via 'ctdb statistics'.
32 EOF
33 }
34
35 . ctdb_test_functions.bash
36
37 ctdb_test_init "$@"
38
39 set -e
40
41 cluster_is_healthy
42
43 test_node=1
44
45 echo "Freezing node $test_node"
46
47 try_command_on_node 0 $CTDB freeze -n $test_node
48
49 wait_until_node_has_status $test_node frozen
50
51 echo "That worked!  Now thawing node $test_node"
52
53 try_command_on_node 0 $CTDB thaw -n $test_node
54
55 wait_until_node_has_status $test_node unfrozen