Test suite: fix typo in ctdb ping test grep pattern.
[metze/ctdb/wip.git] / tests / simple / 09_ctdb_ping.sh
1 #!/bin/bash
2
3 test_info()
4 {
5     cat <<EOF
6 Verify the operation of the 'ctdb ping' command.
7
8 Prerequisites:
9
10 * An active CTDB cluster with at least 2 active nodes.
11
12 Steps:
13
14 1. Verify that the status on all of the ctdb nodes is 'OK'.
15 2. Run the 'ctdb ping' command on one of the nodes and verify that it
16    shows valid and expected output. 
17 3. Shutdown one of the cluster nodes, using the 'ctdb shutdown'
18    command. 
19 4. Run the 'ctdb ping -n <node>' command from another node to this
20    node. 
21 5. Verify that the command is not successful since th ctdb daemon is
22    not running on the node.
23
24 Expected results:
25
26 * The 'ctdb ping' command shows valid and expected output.
27 EOF
28 }
29
30 . ctdb_test_functions.bash
31
32 ctdb_test_init "$@"
33
34 set -e
35
36 cluster_is_healthy
37
38 # Reset configuration
39 ctdb_restart_when_done
40
41 try_command_on_node -v 0 "$CTDB ping -n 1"
42
43 sanity_check_output \
44     1 \
45     '^response from 1 time=-?[.0-9]+ sec[[:space:]]+\([[:digit:]]+ clients\)$' \
46     "$out"
47
48 try_command_on_node -v 0 "$CTDB shutdown -n 1"
49
50 wait_until_node_has_status 1 disconnected
51
52 try_command_on_node -v 0 "! $CTDB ping -n 1"
53
54 sanity_check_output \
55     1 \
56     "(: ctdb_control error: ('ctdb_control to disconnected node'|'node is disconnected')|Unable to get ping response from node 1|Node 1 is DISCONNECTED|ctdb_control for getpnn failed|: Can not access node. Node is not operational\.)" \
57     "$out"