6b07dc017bac8abdd6178b04274ec85f990987ee
[vlendec/samba-autobuild/.git] / ctdb / tests / UNIT / cunit / protocol_test_101.sh
1 #!/bin/sh
2
3 . "${TEST_SCRIPTS_DIR}/unit.sh"
4
5 last_control=155
6
7 generate_control_output ()
8 {
9     for i in $(seq 0 $last_control) ; do
10         echo "$1 $i"
11     done
12 }
13
14 srvid_list="\
15     f002000000000000 \
16     f100000000000000 \
17     f200000000000000 \
18     f300000000000000 \
19     f301000000000000 \
20     f400000000000000 \
21     f500000000000000 \
22     f700000000000000 \
23     f701000000000000 \
24     f800000000000000 \
25     f801000000000000 \
26     f802000000000000 \
27     f900000000000000 \
28     fa00000000000000 \
29     fb00000000000000 \
30     fb01000000000000 \
31     fb03000000000000 \
32     fb04000000000000 \
33     fc00000000000000 \
34 "
35
36 generate_message_output ()
37 {
38     for i in $srvid_list ; do
39         echo "$1 $i"
40     done
41 }
42
43 output=$(
44     echo "ctdb_req_header"
45     echo "ctdb_req_call"
46     echo "ctdb_reply_call"
47     echo "ctdb_reply_error"
48     echo "ctdb_req_dmaster"
49     echo "ctdb_reply_dmaster"
50     generate_control_output "ctdb_req_control_data"
51     generate_control_output "ctdb_reply_control_data"
52     generate_control_output "ctdb_req_control"
53     generate_control_output "ctdb_reply_control"
54     generate_message_output "ctdb_message_data"
55     generate_message_output "ctdb_req_message"
56     echo "ctdb_req_message_data"
57     echo "ctdb_req_keepalive"
58     echo "ctdb_req_tunnel"
59 )
60
61 ok "$output"
62
63 for i in $(seq 1 100) ; do
64     unit_test protocol_ctdb_test $i
65 done