1 # test that on invalid files it can't parse the request
6 # another invalid example
7 echo '[]' | ./test/hail -
8 >>>2 /Unable to read JSObject/
12 echo '{}' | ./test/hail -
13 >>>2 /key 'request' not found/
16 echo '{"request": 0}' | ./test/hail -
20 ./test/hail $TESTDATA_DIR/hail-invalid-reloc.json
21 >>>2 /key 'name': Unable to read String/
24 # and now start the real tests
25 ./test/hail $TESTDATA_DIR/hail-alloc-drbd.json
26 >>> /"success":true,.*,"result":\["node2","node1"\]/
29 ./test/hail $TESTDATA_DIR/hail-reloc-drbd.json
30 >>> /"success":true,.*,"result":\["node1"\]/
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"/
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"/
41 # check that hail can use the simu backend
42 ./test/hail --simu p,8,8T,16g,16 $TESTDATA_DIR/hail-alloc-drbd.json
46 # check that hail can use the text backend
47 ./test/hail -t $T/simu-rebal-merged.standard $TESTDATA_DIR/hail-alloc-drbd.json
51 # check that hail can use the simu backend
52 ./test/hail -t $T/simu-rebal-merged.standard $TESTDATA_DIR/hail-alloc-drbd.json
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/
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/
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"/
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"/
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"/