Statistics
| Branch: | Tag: | Revision:

root / test / hs / shelltests / htools-balancing.test @ 93f1e606

History | View | Annotate | Download (4.2 kB)

1 53d4cdf1 Iustin Pop
### std tests
2 53d4cdf1 Iustin Pop
3 53d4cdf1 Iustin Pop
# test basic parsing
4 83846468 Iustin Pop
./test/hs/hinfo -v -v -p --print-instances $BACKEND_BAL_STD
5 53d4cdf1 Iustin Pop
>>>= 0
6 83846468 Iustin Pop
./test/hs/hbal -v -v -v -p --print-instances $BACKEND_BAL_STD -G group-01
7 53d4cdf1 Iustin Pop
>>> !/(Nothing to do, exiting|No solution found)/
8 53d4cdf1 Iustin Pop
>>>2 !/(Nothing to do, exiting|No solution found)/
9 53d4cdf1 Iustin Pop
>>>= 0
10 53d4cdf1 Iustin Pop
11 53d4cdf1 Iustin Pop
# test command output
12 83846468 Iustin Pop
./test/hs/hbal $BACKEND_BAL_STD -G group-01 -C -S $T/simu-rebal.standard
13 53d4cdf1 Iustin Pop
>>> /gnt-instance (failover|migrate|replace-disks)/
14 53d4cdf1 Iustin Pop
>>>= 0
15 53d4cdf1 Iustin Pop
16 a81ca843 Iustin Pop
# test that correct priorities are accepted
17 a81ca843 Iustin Pop
./test/hs/hbal $BACKEND_BAL_STD -G group-01 -C -S $T/simu-rebal.standard --prio low
18 a81ca843 Iustin Pop
>>> /gnt-instance (failover|migrate|replace-disks)/
19 a81ca843 Iustin Pop
>>>= 0
20 a81ca843 Iustin Pop
21 a81ca843 Iustin Pop
22 591fa888 Iustin Pop
# test that hbal won't execute rebalances when using the text backend
23 83846468 Iustin Pop
./test/hs/hbal $BACKEND_BAL_STD -G group-01 -X
24 591fa888 Iustin Pop
>>>2
25 591fa888 Iustin Pop
Error: hbal: Execution of commands possible only on LUXI
26 591fa888 Iustin Pop
>>>= !0
27 591fa888 Iustin Pop
28 591fa888 Iustin Pop
# test that hbal won't execute any moves if we request an absurdly-high
29 591fa888 Iustin Pop
# minimum-improvement
30 83846468 Iustin Pop
./test/hs/hbal $BACKEND_BAL_STD -G group-01 -C --min-gain 10000 --min-gain-limit 10000
31 591fa888 Iustin Pop
>>>/No solution found/
32 591fa888 Iustin Pop
>>>= 0
33 591fa888 Iustin Pop
34 53d4cdf1 Iustin Pop
# test saving commands
35 83846468 Iustin Pop
./test/hs/hbal $BACKEND_BAL_STD -G group-01 -C$T/rebal-cmds.standard
36 53d4cdf1 Iustin Pop
>>>= 0
37 53d4cdf1 Iustin Pop
# and now check the file (depends on previous test)
38 53d4cdf1 Iustin Pop
cat $T/rebal-cmds.standard
39 53d4cdf1 Iustin Pop
>>> /gnt-instance (failover|migrate|replace-disks)/
40 53d4cdf1 Iustin Pop
>>>= 0
41 53d4cdf1 Iustin Pop
42 53d4cdf1 Iustin Pop
# state saved before rebalancing should be identical; depends on the
43 53d4cdf1 Iustin Pop
# previous test
44 53d4cdf1 Iustin Pop
diff -u $T/simu-rebal-merged.standard $T/simu-rebal.standard.original
45 53d4cdf1 Iustin Pop
>>>
46 53d4cdf1 Iustin Pop
>>>= 0
47 53d4cdf1 Iustin Pop
48 53d4cdf1 Iustin Pop
# no double rebalance; depends on previous test
49 83846468 Iustin Pop
./test/hs/hbal -t $T/simu-rebal.standard.balanced -G group-01
50 53d4cdf1 Iustin Pop
>>> /(Nothing to do, exiting|No solution found)/
51 53d4cdf1 Iustin Pop
>>>= 0
52 53d4cdf1 Iustin Pop
53 165b385b Agata Murawska
# hcheck sees no reason to rebalance after rebalancing was already done
54 83846468 Iustin Pop
./test/hs/hcheck -t$T/simu-rebal.standard.balanced --machine-readable
55 47ed1d79 Agata Murawska
>>> /HCHECK_INIT_CLUSTER_NEED_REBALANCE=0/
56 165b385b Agata Murawska
>>>= 0
57 165b385b Agata Murawska
58 53d4cdf1 Iustin Pop
### now tiered tests
59 53d4cdf1 Iustin Pop
60 53d4cdf1 Iustin Pop
# test basic parsing
61 83846468 Iustin Pop
./test/hs/hinfo -v -v -p --print-instances $BACKEND_BAL_TIER
62 53d4cdf1 Iustin Pop
>>>= 0
63 83846468 Iustin Pop
./test/hs/hbal -v -v -v -p --print-instances $BACKEND_BAL_TIER -G group-01
64 53d4cdf1 Iustin Pop
>>> !/(Nothing to do, exiting|No solution found)/
65 53d4cdf1 Iustin Pop
>>>2 !/(Nothing to do, exiting|No solution found)/
66 53d4cdf1 Iustin Pop
>>>= 0
67 53d4cdf1 Iustin Pop
68 53d4cdf1 Iustin Pop
# test command output
69 83846468 Iustin Pop
./test/hs/hbal $BACKEND_BAL_TIER -G group-01 -C -S $T/simu-rebal.tiered
70 53d4cdf1 Iustin Pop
>>> /gnt-instance (failover|migrate|replace-disks)/
71 53d4cdf1 Iustin Pop
>>>= 0
72 53d4cdf1 Iustin Pop
73 53d4cdf1 Iustin Pop
# test saving commands
74 83846468 Iustin Pop
./test/hs/hbal $BACKEND_BAL_TIER -G group-01 -C$T/rebal-cmds.tiered
75 53d4cdf1 Iustin Pop
>>>= 0
76 53d4cdf1 Iustin Pop
# and now check the file (depends on previous test)
77 53d4cdf1 Iustin Pop
cat $T/rebal-cmds.tiered
78 53d4cdf1 Iustin Pop
>>> /gnt-instance (failover|migrate|replace-disks)/
79 53d4cdf1 Iustin Pop
>>>= 0
80 53d4cdf1 Iustin Pop
81 53d4cdf1 Iustin Pop
# state saved before rebalancing should be identical; depends on the
82 53d4cdf1 Iustin Pop
# previous test
83 53d4cdf1 Iustin Pop
diff -u $T/simu-rebal-merged.tiered $T/simu-rebal.tiered.original
84 53d4cdf1 Iustin Pop
>>>
85 53d4cdf1 Iustin Pop
>>>= 0
86 53d4cdf1 Iustin Pop
87 53d4cdf1 Iustin Pop
# no double rebalance; depends on previous test
88 83846468 Iustin Pop
./test/hs/hbal -t $T/simu-rebal.tiered.balanced -G group-01
89 53d4cdf1 Iustin Pop
>>> /(Nothing to do, exiting|No solution found)/
90 53d4cdf1 Iustin Pop
>>>= 0
91 591fa888 Iustin Pop
92 591fa888 Iustin Pop
### now some other custom tests
93 591fa888 Iustin Pop
94 591fa888 Iustin Pop
# n+1 bad instances are reported as such
95 83846468 Iustin Pop
./test/hs/hbal -t$TESTDATA_DIR/n1-failure.data -G group-01
96 591fa888 Iustin Pop
>>>/Initial check done: 4 bad nodes, 8 bad instances./
97 591fa888 Iustin Pop
>>>=0
98 591fa888 Iustin Pop
99 591fa888 Iustin Pop
# same test again, different message check (shelltest can't test multiple
100 591fa888 Iustin Pop
# messages via regexp
101 83846468 Iustin Pop
./test/hs/hbal -t$TESTDATA_DIR/n1-failure.data -G group-01
102 591fa888 Iustin Pop
>>>/Cluster is not N\+1 happy, continuing but no guarantee that the cluster will end N\+1 happy./
103 591fa888 Iustin Pop
>>>2
104 591fa888 Iustin Pop
>>>=0
105 591fa888 Iustin Pop
106 c64c3854 Iustin Pop
# and hcheck should report this as needs rebalancing
107 83846468 Iustin Pop
./test/hs/hcheck -t$TESTDATA_DIR/n1-failure.data
108 c64c3854 Iustin Pop
>>>/Cluster needs rebalancing./
109 c64c3854 Iustin Pop
>>>= 1
110 c64c3854 Iustin Pop
111 c64c3854 Iustin Pop
# ... unless we request no-simulation mode
112 83846468 Iustin Pop
./test/hs/hcheck -t$TESTDATA_DIR/n1-failure.data --no-simulation
113 c64c3854 Iustin Pop
>>>/Running in no-simulation mode./
114 c64c3854 Iustin Pop
>>>= 0
115 c64c3854 Iustin Pop
116 c64c3854 Iustin Pop
# and a clean cluster should be reported as such
117 83846468 Iustin Pop
./test/hs/hcheck $BACKEND_BAL_STD
118 c64c3854 Iustin Pop
>>>/No need to rebalance cluster, no problems found./
119 c64c3854 Iustin Pop
>>>= 0
120 c64c3854 Iustin Pop
121 c64c3854 Iustin Pop
# ... and even one with non-zero score
122 83846468 Iustin Pop
./test/hs/hcheck -t $TESTDATA_DIR/clean-nonzero-score.data
123 c64c3854 Iustin Pop
>>>/No need to rebalance cluster, no problems found./
124 c64c3854 Iustin Pop
>>>= 0
125 c64c3854 Iustin Pop
126 591fa888 Iustin Pop
# hbal should work on empty groups as well
127 83846468 Iustin Pop
./test/hs/hbal -t$TESTDATA_DIR/n1-failure.data -G group-02
128 591fa888 Iustin Pop
>>>/Group size 0 nodes, 0 instances/
129 591fa888 Iustin Pop
>>>= 0
130 f8d4db63 Klaus Aehlig
131 f8d4db63 Klaus Aehlig
# By default, hbal should assume equal, non-zero utilisation
132 f8d4db63 Klaus Aehlig
./test/hs/hbal -t$TESTDATA_DIR/hbal-dyn.data
133 f8d4db63 Klaus Aehlig
>>>/Solution length=1/
134 f8d4db63 Klaus Aehlig
>>>=0
135 f8d4db63 Klaus Aehlig
136 f8d4db63 Klaus Aehlig
# ...but the --ignore-dynu option should be honored
137 f8d4db63 Klaus Aehlig
./test/hs/hbal -t$TESTDATA_DIR/hbal-dyn.data --ignore-dynu
138 f8d4db63 Klaus Aehlig
>>>/Cluster is already well balanced/
139 f8d4db63 Klaus Aehlig
>>>=0