Test suite: better debug info when the cluster is unexpectedly unhealthy.
[tridge/ctdb.git] / tests / simple / 53_ctdb_transaction.sh
1 #!/bin/bash
2
3 test_info()
4 {
5     cat <<EOF
6 Verify that the ctdb_transaction test succeeds.
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 two copies of ctdb_transaction on each node with a 30 second
16    timeout.
17 3. Ensure that all ctdb_transaction processes complete successfully.
18
19 Expected results:
20
21 * ctdb_transaction runs without error.
22 EOF
23 }
24
25 . ctdb_test_functions.bash
26
27 ctdb_test_init "$@"
28
29 set -e
30
31 cluster_is_healthy
32
33 try_command_on_node 0 "$CTDB listnodes"
34 num_nodes=$(echo "$out" | wc -l)
35
36 t="$CTDB_TEST_WRAPPER $VALGRIND ctdb_transaction --timelimit=30"
37
38 echo "Running ctdb_transaction on all $num_nodes nodes."
39 try_command_on_node -v -pq all "$t & $t"