ctdb-tests: Make the fake log timestamp string easy to modify
[vlendec/samba-autobuild/.git] / ctdb / tests / takeover / lcp2.023.sh
1 #!/bin/sh
2
3 . "${TEST_SCRIPTS_DIR}/unit.sh"
4
5 define_test "3 nodes, all IPs assigned, 1->3 unhealthy"
6
7 export CTDB_TEST_LOGLEVEL=4
8
9 required_result <<EOF
10 ${TEST_DATE_STAMP} ----------------------------------------
11 ${TEST_DATE_STAMP} CONSIDERING MOVES (UNASSIGNED)
12 ${TEST_DATE_STAMP} ----------------------------------------
13 ${TEST_DATE_STAMP}+++++++++++++++++++++++++++++++++++++++++
14 ${TEST_DATE_STAMP}Selecting most imbalanced node from:
15 ${TEST_DATE_STAMP} 0 [89609]
16 ${TEST_DATE_STAMP} 1 [0]
17 ${TEST_DATE_STAMP} 2 [147968]
18 ${TEST_DATE_STAMP} ----------------------------------------
19 ${TEST_DATE_STAMP} CONSIDERING MOVES FROM 2 [147968]
20 ${TEST_DATE_STAMP} 2 [-58359] -> 192.168.21.254 -> 1 [+0]
21 ${TEST_DATE_STAMP} 2 [-58359] -> 192.168.21.252 -> 1 [+0]
22 ${TEST_DATE_STAMP} 2 [-59572] -> 192.168.20.253 -> 1 [+0]
23 ${TEST_DATE_STAMP} 2 [-59823] -> 192.168.20.251 -> 1 [+0]
24 ${TEST_DATE_STAMP} 2 [-59823] -> 192.168.20.249 -> 1 [+0]
25 ${TEST_DATE_STAMP} ----------------------------------------
26 ${TEST_DATE_STAMP}2 [-59823] -> 192.168.20.251 -> 1 [+0]
27 ${TEST_DATE_STAMP}+++++++++++++++++++++++++++++++++++++++++
28 ${TEST_DATE_STAMP}Selecting most imbalanced node from:
29 ${TEST_DATE_STAMP} 0 [89609]
30 ${TEST_DATE_STAMP} 1 [0]
31 ${TEST_DATE_STAMP} 2 [88145]
32 ${TEST_DATE_STAMP} ----------------------------------------
33 ${TEST_DATE_STAMP} CONSIDERING MOVES FROM 0 [89609]
34 ${TEST_DATE_STAMP} 0 [-42483] -> 192.168.21.253 -> 1 [+14161]
35 ${TEST_DATE_STAMP} 0 [-45662] -> 192.168.20.254 -> 1 [+15625]
36 ${TEST_DATE_STAMP} 0 [-45662] -> 192.168.20.252 -> 1 [+15625]
37 ${TEST_DATE_STAMP} 0 [-45411] -> 192.168.20.250 -> 1 [+16129]
38 ${TEST_DATE_STAMP} ----------------------------------------
39 ${TEST_DATE_STAMP}0 [-45662] -> 192.168.20.254 -> 1 [+15625]
40 ${TEST_DATE_STAMP}+++++++++++++++++++++++++++++++++++++++++
41 ${TEST_DATE_STAMP}Selecting most imbalanced node from:
42 ${TEST_DATE_STAMP} 0 [43947]
43 ${TEST_DATE_STAMP} 1 [15625]
44 ${TEST_DATE_STAMP} 2 [88145]
45 ${TEST_DATE_STAMP} ----------------------------------------
46 ${TEST_DATE_STAMP} CONSIDERING MOVES FROM 2 [88145]
47 ${TEST_DATE_STAMP} 2 [-44198] -> 192.168.21.254 -> 1 [+28322]
48 ${TEST_DATE_STAMP} 2 [-44198] -> 192.168.21.252 -> 1 [+28322]
49 ${TEST_DATE_STAMP} 2 [-43947] -> 192.168.20.253 -> 1 [+31501]
50 ${TEST_DATE_STAMP} 2 [-43947] -> 192.168.20.249 -> 1 [+31501]
51 ${TEST_DATE_STAMP} ----------------------------------------
52 ${TEST_DATE_STAMP}2 [-44198] -> 192.168.21.254 -> 1 [+28322]
53 ${TEST_DATE_STAMP}+++++++++++++++++++++++++++++++++++++++++
54 ${TEST_DATE_STAMP}Selecting most imbalanced node from:
55 ${TEST_DATE_STAMP} 0 [43947]
56 ${TEST_DATE_STAMP} 1 [43947]
57 ${TEST_DATE_STAMP} 2 [43947]
58 ${TEST_DATE_STAMP} ----------------------------------------
59 ${TEST_DATE_STAMP} CONSIDERING MOVES FROM 0 [43947]
60 ${TEST_DATE_STAMP} 0 [-28322] -> 192.168.21.253 -> 1 [+44198]
61 ${TEST_DATE_STAMP} 0 [-29786] -> 192.168.20.252 -> 1 [+45662]
62 ${TEST_DATE_STAMP} 0 [-29786] -> 192.168.20.250 -> 1 [+45915]
63 ${TEST_DATE_STAMP} ----------------------------------------
64 ${TEST_DATE_STAMP} ----------------------------------------
65 ${TEST_DATE_STAMP} CONSIDERING MOVES FROM 1 [43947]
66 ${TEST_DATE_STAMP} 1 [-28322] -> 192.168.21.254 -> 1 [+28322]
67 ${TEST_DATE_STAMP} 1 [-29786] -> 192.168.20.254 -> 1 [+29786]
68 ${TEST_DATE_STAMP} 1 [-29786] -> 192.168.20.251 -> 1 [+29786]
69 ${TEST_DATE_STAMP} ----------------------------------------
70 ${TEST_DATE_STAMP} ----------------------------------------
71 ${TEST_DATE_STAMP} CONSIDERING MOVES FROM 2 [43947]
72 ${TEST_DATE_STAMP} 2 [-28322] -> 192.168.21.252 -> 1 [+44198]
73 ${TEST_DATE_STAMP} 2 [-29786] -> 192.168.20.253 -> 1 [+45662]
74 ${TEST_DATE_STAMP} 2 [-29786] -> 192.168.20.249 -> 1 [+45662]
75 ${TEST_DATE_STAMP} ----------------------------------------
76 192.168.21.254 1
77 192.168.21.253 0
78 192.168.21.252 2
79 192.168.20.254 1
80 192.168.20.253 2
81 192.168.20.252 0
82 192.168.20.251 1
83 192.168.20.250 0
84 192.168.20.249 2
85 EOF
86
87 simple_test 2,2,2 <<EOF
88 192.168.21.254 2
89 192.168.21.253 0
90 192.168.21.252 2
91 192.168.20.254 0
92 192.168.20.253 2
93 192.168.20.252 0
94 192.168.20.251 2
95 192.168.20.250 0
96 192.168.20.249 2
97 EOF