Revision 53d4cdf1

b/Makefile.am
759 759
	test/data/vgreduce-removemissing-2.02.66-ok.txt \
760 760
	test/data/vgs-missing-pvs-2.02.02.txt \
761 761
	test/data/vgs-missing-pvs-2.02.66.txt \
762
	test/import-export_unittest-helper
762
	test/import-export_unittest-helper \
763
	test/htools-balancing.test \
764
	test/htools-basic.test \
765
	test/htools-dynutil.test \
766
	test/htools-excl.test \
767
	test/htools-hail.test \
768
	test/htools-hspace.test \
769
	test/htools-invalid.test \
770
	test/htools-multi-group.test \
771
	test/htools-no-backend.test \
772
	test/htools-rapi.test \
773
	test/htools-single-group.test \
774
	test/htools-text-backend.test
763 775

  
764 776
python_tests = \
765 777
	test/ganeti.asyncnotifier_unittest.py \
b/htools/offline-test.sh
25 25

  
26 26
. $(dirname $0)/cli-tests-defs.sh
27 27

  
28
T=`mktemp -d`
28
echo Running offline htools tests
29

  
30
export T=`mktemp -d`
29 31
trap 'rm -rf $T' EXIT
30
trap 'echo FAIL' ERR
32
trap 'echo FAIL to build test files' ERR
31 33
echo Using $T as temporary dir
32 34

  
33
echo Checking command line basic options
34
for prog in $ALL_ROLES; do
35
  $prog --version >/dev/null
36
  $prog --help >/dev/null
37
  ! $prog --no-such-option 2>/dev/null
38
done
39
echo OK
40

  
41
echo Checking missing backend failure
42
for prog in hspace hinfo hbal; do
43
  ! $prog 2>/dev/null
44
done
45
echo OK
46

  
47
echo Checking hail missing input file
48
! hail 2>/dev/null
49
echo OK
50

  
51
echo Checking extra arguments
52
for prog in hspace hbal hinfo; do
53
  (! $prog unexpected-argument 2>&1 ) | \
54
    grep -q "Error: this program doesn't take any arguments"
55
done
56
echo OK
57

  
58
echo Checking failure on multiple backends
59
(! hbal -t /dev/null -m localhost 2>&1 ) | \
60
  grep -q "Error: Only one of the rapi, luxi, and data files options should be given."
61
echo OK
62

  
63
echo Checking text file loading
64
hbal -t $TESTDATA_DIR/missing-resources.data 2>&1 | \
65
  grep "node node2 is missing .* ram and .* disk" >/dev/null
66
hbal -t $TESTDATA_DIR/common-suffix.data -v 2>&1 | \
67
  grep "Stripping common suffix of '.example.com' from names" >/dev/null
68
(! hbal -t $TESTDATA_DIR/invalid-node.data 2>&1 ) | \
69
  grep "Unknown node '.*' for instance new-0" >/dev/null
70
echo OK
71

  
72
echo Checking hspace machine-readable mode
73
hspace --simu p,4,8T,64g,16 --machine-readable \
74
  --disk-template drbd -l 8 >$T/capacity
75
( . $T/capacity && test "$HTS_OK" = "1" )
76
echo OK
77

  
78
echo Checking hspace simulation to hinfo to hbal
35
echo -n Generating hspace simulation data for hinfo and hbal...
79 36
# this cluster spec should be fine
80
hspace --simu p,4,8T,64g,16 -S $T/simu-onegroup \
37
./test/hspace --simu p,4,8T,64g,16 -S $T/simu-onegroup \
81 38
  --disk-template drbd -l 8 -v -v -v >/dev/null 2>&1
82
# results in .tiered and .standard
83
for suffix in standard tiered; do
84
  BACKEND="-t$T/simu-onegroup.$suffix"
85
  hinfo -v -v -p --print-instances $BACKEND >/dev/null 2>&1
86
  hbal  -v -v -p --print-instances $BACKEND >/dev/null 2>&1
87
  # hbal should not be able to balance
88
  hbal $BACKEND | grep -qE "(Nothing to do, exiting|No solution found)"
89
done
90 39
echo OK
91 40

  
92
echo Checking hinfo and hbal on multi-nodegroup
93
hspace --simu p,4,8T,64g,16 --simu p,4,8T,64g,16 \
41
echo -n Generating hinfo and hbal test files for multi-group...
42
./test/hspace --simu p,4,8T,64g,16 --simu p,4,8T,64g,16 \
94 43
  -S $T/simu-twogroups --disk-template drbd -l 8 >/dev/null 2>&1
95
# results in .tiered and .standard
96
for suffix in standard tiered; do
97
  BACKEND="-t$T/simu-twogroups.$suffix"
98
  hinfo -v -v -p --print-instances $BACKEND >/dev/null 2>&1
99
  ! hbal $BACKEND >/dev/null 2>&1
100
  # hbal should not be able to balance
101
  ! hbal $BACKEND 2>&1 | grep -q "Found multiple node groups"
102
  # but hbal should be able to balance one node group
103
  hbal $BACKEND -G group-01 >/dev/null
104
  # and it should not find an invalid group
105
  ! hbal $BACKEND -G no-such-group >/dev/null 2>&1
106
done
107 44
echo OK
108 45

  
109
echo Checking rebalancing
46
echo -n Generating test files for rebalancing...
110 47
# we generate a cluster with two node groups, one with unallocable
111 48
# policy, then we change all nodes from this group to the allocable
112 49
# one, and we check for rebalancing
113 50
FROOT="$T/simu-rebal-orig"
114
hspace --simu u,4,8T,64g,16 --simu p,4,8T,64g,16 \
51
./test/hspace --simu u,4,8T,64g,16 --simu p,4,8T,64g,16 \
115 52
  -S $FROOT --disk-template drbd -l 8 >/dev/null 2>&1
116 53
for suffix in standard tiered; do
117 54
  RELOC="$T/simu-rebal-merged.$suffix"
118 55
  # this relocates the nodes
119 56
  sed -re 's/^(node-.*|fake-uuid-)-02(|.*)/\1-01\2/' \
120 57
    < $FROOT.$suffix > $RELOC
121
  BACKEND="-t$RELOC"
122
  hinfo -v -v -p --print-instances $BACKEND >/dev/null 2>&1
123
  hbal -v -v -v -p --print-instances $BACKEND -G group-01 2>/dev/null | \
124
    grep -qE -v "(Nothing to do, exiting|No solution found)"
125
  hbal $BACKEND -G group-01 -C$T/rebal-cmds.$suffix \
126
    -S $T/simu-rebal.$suffix >/dev/null 2>&1
127
  grep -qE "gnt-instance (failover|migrate|replace-disks)" \
128
    $T/rebal-cmds.$suffix
129
  hbal $BACKEND -G group-01 -C \
130
    -S $T/simu-rebal.$suffix 2>/dev/null | \
131
    grep -qE "gnt-instance (failover|migrate|replace-disks)"
132
  # state saved by hbal should be original
133
  cmp $RELOC $T/simu-rebal.$suffix.original
134
  # and we can't double rebalance
135
  hbal -t $T/simu-rebal.$suffix.balanced \
136
    -G group-01 | \
137
    grep -qE "(Nothing to do, exiting|No solution found)"
138

  
139 58
done
59
export BACKEND_BAL_STD="-t$T/simu-rebal-merged.standard"
60
export BACKEND_BAL_TIER="-t$T/simu-rebal-merged.tiered"
140 61
echo OK
141 62

  
142
echo Checking utilisation-based code
143
BACKEND="-t $T/simu-onegroup.standard"
144
echo a > $T/dynu
145
(! hbal -U <(echo a) $BACKEND  2>&1 ) | grep -q "Cannot parse line"
146
(! hbal -U <(echo a b c d e f g h) $BACKEND 2>&1 ) | \
147
  grep -q "Cannot parse line"
148
(! hbal -U <(echo inst cpu mem dsk net) $BACKEND 2>&1 ) | \
149
  grep -Eq "cannot parse string '(cpu|mem|dsk|net)'"
150
# unknown instances are currently just ignored
151
hbal -U <(echo no-such-inst 2 2 2 2) $BACKEND >/dev/null 2>&1
152
# new-0 is the name of the first instance allocated by hspace
153
hbal -U <(echo new-0 2 2 2 2) $BACKEND >/dev/null 2>&1
154
echo OK
155

  
156
echo Checking selected/excluded instances
157
(! hbal $BACKEND --exclude-instances no-such-instance 2>&1 ) | \
158
  grep -q "Unknown instance"
159
(! hbal $BACKEND --select-instances no-such-instances 2>&1 ) | \
160
  grep -q "Unknown instance"
161
hbal $BACKEND --exclude-instances new-0 --select-instances new-1 >/dev/null
162
echo OK
163

  
164
echo IAllocator checks
165
# test that on invalid files it can't parse the request
166
(! hail /dev/null 2>&1 ) | grep -q "Invalid JSON"
167
! hail <(echo '[]') >/dev/null 2>&1
168
(! hail <(echo '{}') 2>&1 ) | grep -q "key 'request' not found"
169
(! hail <(echo '{"request": 0}') 2>&1 ) | grep -q "key 'request'"
170
! hail $TESTDATA_DIR/hail-invalid-reloc.json >/dev/null 2>&1
171

  
172
# just test that it can read the file, print the cluster and generate
173
# pre and post allocation files
174
hail -v -v -v -p $TESTDATA_DIR/hail-alloc-drbd.json \
175
  -S $T/hail-alloc >/dev/null 2>&1
176
! cmp -s $T/hail-alloc.pre-ialloc $T/hail-alloc.post-ialloc
177
hail -v -v -v -p $TESTDATA_DIR/hail-reloc-drbd.json \
178
  -S $T/hail-reloc >/dev/null 2>&1
179
! cmp -s $T/hail-reloc.pre-ialloc $T/hail-reloc.post-ialloc
180

  
181
# and now start the real tests
182
hail $TESTDATA_DIR/hail-alloc-drbd.json | \
183
  grep -q '"success":true,.*,"result":\["node2","node1"\]'
184
hail $TESTDATA_DIR/hail-reloc-drbd.json | \
185
  grep -q '"success":true,.*,"result":\["node1"\]'
186

  
187
hail $TESTDATA_DIR/hail-node-evac.json | \
188
  grep -Fq '"success":true,"info":"Request successful: 0 instances failed to move and 1 were moved successfully"'
189

  
190
hail $TESTDATA_DIR/hail-change-group.json | \
191
  grep -Fq '"success":true,"info":"Request successful: 0 instances failed to move and 1 were moved successfully"'
63
# For various tests
64
export BACKEND_DYNU="-t $T/simu-onegroup.standard"
65
export BACKEND_EXCL="-t $T/simu-onegroup.standard"
192 66

  
67
echo -n Generating data files for IAllocator checks...
193 68
for evac_mode in primary-only secondary-only all; do
194 69
  sed -e 's/"evac_mode": "all"/"evac_mode": "'${evac_mode}'"/' \
195 70
    < $TESTDATA_DIR/hail-node-evac.json \
196 71
    > $T/hail-node-evac.json.$evac_mode
197
  hail $T/hail-node-evac.json.$evac_mode | \
198
    grep -q '"success":true,"info":"Request successful: 0 instances failed to move and 1 were moved successfully"'
199 72
done
200

  
201
# check that hail can use the simu and text backends
202
hail --simu p,8,8T,16g,16 $TESTDATA_DIR/hail-alloc-drbd.json | \
203
  grep -q '"success":true,'
204
hail -t $T/simu-rebal-merged.standard $TESTDATA_DIR/hail-alloc-drbd.json | \
205
  grep -q '"success":true,'
206 73
echo OK
207 74

  
208
echo Checking file-based RAPI
75
echo -n Checking file-based RAPI...
209 76
mkdir -p $T/hscan
210
URL="file://$TESTDATA_DIR/rapi"
211
hinfo -v -v -p --print-instances -m $URL >/dev/null 2>&1
212
hbal -v -v -p --print-instances -m $URL >/dev/null 2>&1
213
hscan -d $T/hscan/ -p -v -v $URL >/dev/null 2>&1
77
export RAPI_URL="file://$TESTDATA_DIR/rapi"
78
./test/hscan -d $T/hscan/ -p -v -v $RAPI_URL >/dev/null 2>&1
214 79
# check that we file parsing is correct, i.e. hscan saves correct text
215
# files, and is idempotent (rapi+text == rapi)
216
HS="$(ls $T/hscan/*.data|head -n1)"
217
hinfo -p --print-instances -m $URL > $T/hscan/direct.hinfo 2>&1
218
hinfo -p --print-instances -t $HS  > $T/hscan/fromtext.hinfo 2>&1
219
cmp -s $T/hscan/direct.hinfo $T/hscan/fromtext.hinfo
80
# files, and is idempotent (rapi+text == rapi); more is tested in
81
# shelltest later
82
RAPI_TXT="$(ls $T/hscan/*.data|head -n1)"
83
./test/hinfo -p --print-instances -m $RAPI_URL > $T/hscan/direct.hinfo 2>&1
84
./test/hinfo -p --print-instances -t $RAPI_TXT > $T/hscan/fromtext.hinfo 2>&1
220 85
echo OK
221 86

  
87
echo Running shelltest...
88

  
89
shelltest $SHELLTESTARGS test/ -- --hide-successes
90

  
222 91
echo All OK
b/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
### now tiered tests
36

  
37
# test basic parsing
38
./test/hinfo -v -v -p --print-instances $BACKEND_BAL_TIER
39
>>>= 0
40
./test/hbal -v -v -v -p --print-instances $BACKEND_BAL_TIER -G group-01
41
>>> !/(Nothing to do, exiting|No solution found)/
42
>>>2 !/(Nothing to do, exiting|No solution found)/
43
>>>= 0
44

  
45
# test command output
46
./test/hbal $BACKEND_BAL_TIER -G group-01 -C -S $T/simu-rebal.tiered
47
>>> /gnt-instance (failover|migrate|replace-disks)/
48
>>>= 0
49

  
50
# test saving commands
51
./test/hbal $BACKEND_BAL_TIER -G group-01 -C$T/rebal-cmds.tiered
52
>>>= 0
53
# and now check the file (depends on previous test)
54
cat $T/rebal-cmds.tiered
55
>>> /gnt-instance (failover|migrate|replace-disks)/
56
>>>= 0
57

  
58
# state saved before rebalancing should be identical; depends on the
59
# previous test
60
diff -u $T/simu-rebal-merged.tiered $T/simu-rebal.tiered.original
61
>>>
62
>>>= 0
63

  
64
# no double rebalance; depends on previous test
65
./test/hbal -t $T/simu-rebal.tiered.balanced -G group-01
66
>>> /(Nothing to do, exiting|No solution found)/
67
>>>= 0
b/test/htools-basic.test
1
# help/version tests
2
./test/hail --version
3
>>>= 0
4
./test/hail --help
5
>>>= 0
6
./test/hbal --version
7
>>>= 0
8
./test/hbal --help
9
>>>= 0
10
./test/hspace --version
11
>>>= 0
12
./test/hspace --help
13
>>>= 0
14
./test/hscan --version
15
>>>= 0
16
./test/hscan --help
17
>>>= 0
18
./test/hinfo --version
19
>>>= 0
20
./test/hinfo --help
21
>>>= 0
b/test/htools-dynutil.test
1
echo a > $T/dynu; ./test/hbal -U $T/dynu $BACKEND_DYNU
2
>>>2 /Cannot parse line/
3
>>>= !0
4

  
5
echo a b c d e f g h > $T/dynu; ./test/hbal -U $T/dynu $BACKEND_DYNU
6
>>>2 /Cannot parse line/
7
>>>= !0
8

  
9
echo inst cpu mem dsk net >$T/dynu; ./test/hbal -U $T/dynu $BACKEND_DYNU
10
>>>2 /cannot parse string '(cpu|mem|dsk|net)'/
11
>>>= !0
12

  
13
# unknown instances are currently just ignored
14
echo no-such-inst 2 2 2 2 > $T/dynu; ./test/hbal -U $T/dynu $BACKEND_DYNU
15
>>>= 0
16

  
17
# new-0 is the name of the first instance allocated by hspace
18
echo new-0 2 2 2 2 > $T/dynu; ./test/hbal -U $T/dynu $BACKEND_DYNU
19
>>>= 0
b/test/htools-excl.test
1
./test/hbal $BACKEND_EXCL --exclude-instances no-such-instance
2
>>>2 /Unknown instance/
3
>>>= !0
4

  
5
./test/hbal $BACKEND_EXCL --select-instances no-such-instances
6
>>>2 /Unknown instance/
7
>>>= !0
8

  
9
./test/hbal $BACKEND_EXCL --exclude-instances new-0 --select-instances new-1
10
>>>= 0
b/test/htools-hail.test
1
# test that on invalid files it can't parse the request
2
./test/hail /dev/null
3
>>>2 /Invalid JSON/
4
>>>= !0
5

  
6
# another invalid example
7
echo '[]' | ./test/hail -
8
>>>2 /Unable to read JSObject/
9
>>>= !0
10

  
11
# empty dict
12
echo '{}' | ./test/hail -
13
>>>2 /key 'request' not found/
14
>>>= !0
15

  
16
echo '{"request": 0}' | ./test/hail -
17
>>>2 /key 'request'/
18
>>>= !0
19

  
20
./test/hail $TESTDATA_DIR/hail-invalid-reloc.json
21
>>>2 /key 'name': Unable to read String/
22
>>>= !0
23

  
24
# and now start the real tests
25
./test/hail $TESTDATA_DIR/hail-alloc-drbd.json
26
>>> /"success":true,.*,"result":\["node2","node1"\]/
27
>>>= 0
28

  
29
./test/hail $TESTDATA_DIR/hail-reloc-drbd.json
30
>>> /"success":true,.*,"result":\["node1"\]/
31
>>>= 0
32

  
33
./test/hail $TESTDATA_DIR/hail-node-evac.json
34
>>> /"success":true,"info":"Request successful: 0 instances failed to move and 1 were moved successfully"/
35
>>>= 0
36

  
37
./test/hail $TESTDATA_DIR/hail-change-group.json
38
>>> /"success":true,"info":"Request successful: 0 instances failed to move and 1 were moved successfully"/
39
>>>= 0
40

  
41
# check that hail can use the simu backend
42
./test/hail --simu p,8,8T,16g,16 $TESTDATA_DIR/hail-alloc-drbd.json
43
>>> /"success":true,/
44
>>>= 0
45

  
46
# check that hail can use the text backend
47
./test/hail -t $T/simu-rebal-merged.standard $TESTDATA_DIR/hail-alloc-drbd.json
48
>>> /"success":true,/
49
>>>= 0
50

  
51
# check that hail can use the simu backend
52
./test/hail -t $T/simu-rebal-merged.standard $TESTDATA_DIR/hail-alloc-drbd.json
53
>>> /"success":true,/
54
>>>= 0
55

  
56
# check that hail pre/post saved state differs after allocation
57
./test/hail -v -v -v -p $TESTDATA_DIR/hail-alloc-drbd.json -S $T/hail-alloc >/dev/null 2>&1 && ! diff -q $T/hail-alloc.pre-ialloc $T/hail-alloc.post-ialloc
58
>>> /Files .* and .* differ/
59
>>>= 0
60

  
61
# check that hail pre/post saved state differs after relocation
62
./test/hail -v -v -v -p $TESTDATA_DIR/hail-reloc-drbd.json -S $T/hail-reloc >/dev/null 2>&1 && ! diff -q $T/hail-reloc.pre-ialloc $T/hail-reloc.post-ialloc
63
>>> /Files .* and .* differ/
64
>>>= 0
65

  
66
# evac tests
67
./test/hail $T/hail-node-evac.json.primary-only
68
>>> /"success":true,"info":"Request successful: 0 instances failed to move and 1 were moved successfully"/
69
>>>= 0
70

  
71
./test/hail $T/hail-node-evac.json.secondary-only
72
>>> /"success":true,"info":"Request successful: 0 instances failed to move and 1 were moved successfully"/
73
>>>= 0
74

  
75
./test/hail $T/hail-node-evac.json.all
76
>>> /"success":true,"info":"Request successful: 0 instances failed to move and 1 were moved successfully"/
77
>>>= 0
b/test/htools-hspace.test
1
# test that hspace machine readable output looks correct
2
./test/hspace --simu p,4,8T,64g,16 --machine-readable --disk-template drbd -l 8
3
>>> /^HTS_OK=1/
4
>>>= 0
5

  
6
# test again via a file and shell parsing
7
./test/hspace --simu p,4,8T,64g,16 --machine-readable --disk-template drbd -l 8 > $T/capacity && sh -c ". $T/capacity && test x\$HTS_OK = x1"
8
>>>= 0
b/test/htools-invalid.test
1
# invalid option test
2
./test/hail --no-such-option
3
>>>= 2
4

  
5
# invalid option test
6
./test/hbal --no-such-option
7
>>>= 2
8

  
9
# invalid option test
10
./test/hspace --no-such-option
11
>>>= 2
12

  
13
# invalid option test
14
./test/hscan --no-such-option
15
>>>= 2
16

  
17
# invalid option test
18
./test/hinfo --no-such-option
19
>>>= 2
20

  
21
# extra arguments
22
./test/hspace unexpected-argument
23
>>>2
24
Error: this program doesn't take any arguments.
25
>>>=1
26

  
27
./test/hbal unexpected-argument
28
>>>2
29
Error: this program doesn't take any arguments.
30
>>>=1
31

  
32
./test/hinfo unexpected-argument
33
>>>2
34
Error: this program doesn't take any arguments.
35
>>>=1
b/test/htools-multi-group.test
1
# standard multi-group tests
2
./test/hinfo -v -v -p --print-instances -t$T/simu-twogroups.standard
3
>>>= 0
4
./test/hbal -t$T/simu-twogroups.standard
5
>>>= !0
6

  
7
# hbal should not be able to balance
8
./test/hbal -t$T/simu-twogroups.standard
9
>>>2 /Found multiple node groups/
10
>>>= !0
11

  
12
# but hbal should be able to balance one node group
13
./test/hbal -t$T/simu-twogroups.standard -G group-01
14
>>>= 0
15
# and it should not find an invalid group
16
./test/hbal -t$T/simu-twogroups.standard -G no-such-group
17
>>>= !0
18

  
19
# tiered allocs multi-group tests
20
./test/hinfo -v -v -p --print-instances -t$T/simu-twogroups.tiered
21
>>>= 0
22
./test/hbal -t$T/simu-twogroups.tiered
23
>>>= !0
24

  
25
# hbal should not be able to balance
26
./test/hbal -t$T/simu-twogroups.tiered
27
>>>2 /Found multiple node groups/
28
>>>= !0
29

  
30
# but hbal should be able to balance one node group
31
./test/hbal -t$T/simu-twogroups.tiered -G group-01
32
>>>= 0
33
# and it should not find an invalid group
34
./test/hbal -t$T/simu-twogroups.tiered -G no-such-group
35
>>>= !0
b/test/htools-no-backend.test
1
# hail no input file
2
./test/hail
3
>>>= 1
4

  
5
# hbal no backend
6
./test/hbal
7
>>>= 1
8

  
9
# hspace no backend
10
./test/hspace
11
>>>= 1
12

  
13
# hinfo no backend
14
./test/hinfo
15
>>>= 1
16

  
17
# hbal multiple backends
18
./test/hbal -t /dev/null -m localhost
19
>>>2
20
Error: Only one of the rapi, luxi, and data files options should be given.
21
>>>= 1
b/test/htools-rapi.test
1
# test loading data via RAPI
2
./test/hinfo -v -v -p --print-instances -m $RAPI_URL
3
>>>= 0
4

  
5
./test/hbal -v -v -p --print-instances -m $RAPI_URL
6
>>>= 0
7

  
8
# this compares generated files from hscan
9
diff -u $T/hscan/direct.hinfo $T/hscan/fromtext.hinfo
10
>>>
11
>>>= 0
b/test/htools-single-group.test
1
# standard single-group tests
2
./test/hinfo -v -v -p --print-instances -t$T/simu-onegroup.standard
3
>>>= 0
4

  
5
./test/hbal  -v -v -p --print-instances -t$T/simu-onegroup.standard
6
>>>= 0
7

  
8
# hbal should not be able to balance
9
./test/hbal -t$T/simu-onegroup.standard
10
>>> /(Nothing to do, exiting|No solution found)/
11
>>>= 0
12

  
13

  
14
# tiered single-group tests
15
./test/hinfo -v -v -p --print-instances -t$T/simu-onegroup.tiered
16
>>>= 0
17

  
18
./test/hbal  -v -v -p --print-instances -t$T/simu-onegroup.tiered
19
>>>= 0
20

  
21
# hbal should not be able to balance
22
./test/hbal -t$T/simu-onegroup.tiered
23
>>> /(Nothing to do, exiting|No solution found)/
24
>>>= 0
b/test/htools-text-backend.test
1
# missing resources test
2
./test/hbal -t $TESTDATA_DIR/missing-resources.data
3
>>>2 /node node2 is missing .* ram and .* disk/
4
>>>= 0
5
./test/hinfo -t $TESTDATA_DIR/missing-resources.data
6
>>>2 /node node2 is missing .* ram and .* disk/
7
>>>= 0
8

  
9

  
10
# common suffix test
11
./test/hbal -t $TESTDATA_DIR/common-suffix.data -v -v
12
>>>/Stripping common suffix of '\.example\.com' from names/
13
>>>= 0
14
./test/hinfo -t $TESTDATA_DIR/common-suffix.data -v -v
15
>>>/Stripping common suffix of '\.example\.com' from names/
16
>>>= 0
17

  
18

  
19
# invalid node test
20
./test/hbal -t $TESTDATA_DIR/invalid-node.data
21
>>>2 /Unknown node '.*' for instance new-0/
22
>>>= !0
23

  
24
./test/hspace -t $TESTDATA_DIR/invalid-node.data
25
>>>2 /Unknown node '.*' for instance new-0/
26
>>>= !0
27

  
28
./test/hinfo -t $TESTDATA_DIR/invalid-node.data
29
>>>2 /Unknown node '.*' for instance new-0/
30
>>>= !0

Also available in: Unified diff