bash_completion: Enable extglob while parsing file
[ganeti-local] / test / htools-balancing.test
1 ### std tests
2
3 # test basic parsing
4 ./test/hinfo -v -v -p --print-instances $BACKEND_BAL_STD
5 >>>= 0
6 ./test/hbal -v -v -v -p --print-instances $BACKEND_BAL_STD -G group-01
7 >>> !/(Nothing to do, exiting|No solution found)/
8 >>>2 !/(Nothing to do, exiting|No solution found)/
9 >>>= 0
10
11 # test command output
12 ./test/hbal $BACKEND_BAL_STD -G group-01 -C -S $T/simu-rebal.standard
13 >>> /gnt-instance (failover|migrate|replace-disks)/
14 >>>= 0
15
16 # test saving commands
17 ./test/hbal $BACKEND_BAL_STD -G group-01 -C$T/rebal-cmds.standard
18 >>>= 0
19 # and now check the file (depends on previous test)
20 cat $T/rebal-cmds.standard
21 >>> /gnt-instance (failover|migrate|replace-disks)/
22 >>>= 0
23
24 # state saved before rebalancing should be identical; depends on the
25 # previous test
26 diff -u $T/simu-rebal-merged.standard $T/simu-rebal.standard.original
27 >>>
28 >>>= 0
29
30 # no double rebalance; depends on previous test
31 ./test/hbal -t $T/simu-rebal.standard.balanced -G group-01
32 >>> /(Nothing to do, exiting|No solution found)/
33 >>>= 0
34
35 # hcheck sees no reason to rebalance after rebalancing was already done
36 ./test/hcheck -t$T/simu-rebal.standard.balanced --machine-readable
37 >>> /HCHECK_INIT_CLUSTER_NEED_REBALANCE=0/
38 >>>= 0
39
40 ### now tiered tests
41
42 # test basic parsing
43 ./test/hinfo -v -v -p --print-instances $BACKEND_BAL_TIER
44 >>>= 0
45 ./test/hbal -v -v -v -p --print-instances $BACKEND_BAL_TIER -G group-01
46 >>> !/(Nothing to do, exiting|No solution found)/
47 >>>2 !/(Nothing to do, exiting|No solution found)/
48 >>>= 0
49
50 # test command output
51 ./test/hbal $BACKEND_BAL_TIER -G group-01 -C -S $T/simu-rebal.tiered
52 >>> /gnt-instance (failover|migrate|replace-disks)/
53 >>>= 0
54
55 # test saving commands
56 ./test/hbal $BACKEND_BAL_TIER -G group-01 -C$T/rebal-cmds.tiered
57 >>>= 0
58 # and now check the file (depends on previous test)
59 cat $T/rebal-cmds.tiered
60 >>> /gnt-instance (failover|migrate|replace-disks)/
61 >>>= 0
62
63 # state saved before rebalancing should be identical; depends on the
64 # previous test
65 diff -u $T/simu-rebal-merged.tiered $T/simu-rebal.tiered.original
66 >>>
67 >>>= 0
68
69 # no double rebalance; depends on previous test
70 ./test/hbal -t $T/simu-rebal.tiered.balanced -G group-01
71 >>> /(Nothing to do, exiting|No solution found)/
72 >>>= 0