charset/tests: assert the exact values of str[n]casecmp_m()
[Samba.git] / ctdb / tests / simple / 09_ctdb_ping.sh
blobab6ba146df6f483e3e75bb28b5bff37386f7cb43
1 #!/bin/bash
3 test_info()
5 cat <<EOF
6 Verify the operation of the 'ctdb ping' command.
8 Prerequisites:
10 * An active CTDB cluster with at least 2 active nodes.
12 Steps:
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.
24 Expected results:
26 * The 'ctdb ping' command shows valid and expected output.
27 EOF
30 . "${TEST_SCRIPTS_DIR}/integration.bash"
32 ctdb_test_init "$@"
34 set -e
36 cluster_is_healthy
38 # Reset configuration
39 ctdb_restart_when_done
41 try_command_on_node -v 0 "$CTDB ping -n 1"
43 sanity_check_output \
44 1 \
45 '^response from 1 time=-?[.0-9]+ sec[[:space:]]+\([[:digit:]]+ clients\)$' \
46 "$out"
48 try_command_on_node -v 0 "$CTDB shutdown -n 1"
50 wait_until_node_has_status 1 disconnected 30 0
52 try_command_on_node -v 0 "! $CTDB ping -n 1"
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\.|Node 1 has status DISCONNECTED\|UNHEALTHY\|INACTIVE$)" \
57 "$out"