792a4ee4881acf246411743a09e2ded2d2c812f1
[sahlberg/ctdb.git] / tests / simple / 18_ctdb_freeze.sh
1 #!/bin/bash
2
3 test_info()
4 {
5     cat <<EOF
6 Verify 'ctdb freeze' works correctly.
7
8 This is a superficial test that simply checks that 'ctdb statistics'
9 reports the node becomes frozen.  No checks are done to ensure that
10 client access to databases is blocked.
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
24 Expected results:
25
26 * When the database is frozen, the 'frozen' variable in the
27   'ctdb statistics' output is set to 1 on the node.
28 EOF
29 }
30
31 . ctdb_test_functions.bash
32
33 ctdb_test_init "$@"
34
35 set -e
36
37 cluster_is_healthy
38
39 # Reset configuration
40 ctdb_restart_when_done
41
42 test_node=1
43
44 echo "Freezing node $test_node"
45
46 try_command_on_node 0 $CTDB freeze -n $test_node
47
48 wait_until_node_has_status $test_node frozen