| # test that on invalid files it can't parse the request |
| ./test/hs/hail /dev/null |
| >>>2 /Invalid JSON/ |
| >>>= !0 |
| |
| # another invalid example |
| echo '[]' | ./test/hs/hail - |
| >>>2 /Unable to read JSObject/ |
| >>>= !0 |
| |
| # empty dict |
| echo '{}' | ./test/hs/hail - |
| >>>2 /key 'request' not found/ |
| >>>= !0 |
| |
| echo '{"request": 0}' | ./test/hs/hail - |
| >>>2 /key 'request'/ |
| >>>= !0 |
| |
| ./test/hs/hail $TESTDATA_DIR/hail-invalid-reloc.json |
| >>>2 /key 'name': Unable to read String/ |
| >>>= !0 |
| |
| # and now start the real tests |
| ./test/hs/hail $TESTDATA_DIR/hail-alloc-drbd.json |
| >>> /"success":true,.*,"result":\["node2","node1"\]/ |
| >>>= 0 |
| |
| ./test/hs/hail $TESTDATA_DIR/hail-reloc-drbd.json |
| >>> /"success":true,.*,"result":\["node1"\]/ |
| >>>= 0 |
| |
| ./test/hs/hail $TESTDATA_DIR/hail-node-evac.json |
| >>> /"success":true,"info":"Request successful: 0 instances failed to move and 1 were moved successfully"/ |
| >>>= 0 |
| |
| ./test/hs/hail $TESTDATA_DIR/hail-change-group.json |
| >>> /"success":true,"info":"Request successful: 0 instances failed to move and 1 were moved successfully"/ |
| >>>= 0 |
| |
| # check that hail correctly applies the disk policy on a per-disk basis |
| ./test/hs/hail $TESTDATA_DIR/hail-alloc-twodisks.json |
| >>> /"success":true,.*,"result":\["node1"\]/ |
| >>>= 0 |
| |
| ./test/hs/hail $TESTDATA_DIR/hail-alloc-invalid-twodisks.json |
| >>> /"success":false,.*FailDisk: 1/ |
| >>>= 0 |
| |
| # check that hail honors network requirements |
| ./test/hs/hail $TESTDATA_DIR/hail-alloc-restricted-network.json |
| >>> /"success":true,"info":"Request successful: Selected group: Group 1.*/ |
| >>>= 0 |
| |
| # check that hail fails if no nodegroup can meet network and disk template requirements |
| ./test/hs/hail $TESTDATA_DIR/hail-alloc-invalid-network.json |
| >>> /"success":false,/ |
| >>>= 0 |
| |
| # check that hail succeeds with the same test data, but with the network restrictions removed |
| cat $TESTDATA_DIR/hail-alloc-invalid-network.json | grep -v -e '"network":"uuid-net-1-."' | ./test/hs/hail - |
| >>> /"success":true,"info":"Request successful: Selected group: Group 2.*/ |
| >>>= 0 |
| |
| # Run some of the tests above, with exclusive storage enabled |
| ./test/hs/hail $T/hail-alloc-drbd.json.excl-stor |
| >>> /"success":true,.*,"result":\["node2","node1"\]/ |
| >>>= 0 |
| |
| ./test/hs/hail $T/hail-reloc-drbd.json.excl-stor |
| >>> /"success":true,.*,"result":\["node1"\]/ |
| >>>= 0 |
| |
| ./test/hs/hail $T/hail-node-evac.json.excl-stor |
| >>> /"success":true,"info":"Request successful: 0 instances failed to move and 1 were moved successfully"/ |
| >>>= 0 |
| |
| ./test/hs/hail $T/hail-change-group.json.excl-stor |
| >>> /"success":true,"info":"Request successful: 0 instances failed to move and 1 were moved successfully"/ |
| >>>= 0 |
| |
| ./test/hs/hail $T/hail-alloc-twodisks.json.excl-stor |
| >>> /"success":true,.*,"result":\["node1"\]/ |
| >>>= 0 |
| |
| ./test/hs/hail $T/hail-alloc-invalid-twodisks.json.excl-stor |
| >>> /"success":false,.*FailDisk: 1"/ |
| >>>= 0 |
| |
| # Same tests with exclusive storage enabled, but no spindles info in instances |
| ./test/hs/hail $T/hail-alloc-drbd.json.fail-excl-stor |
| >>> /"success":false,.*FailSpindles: 12"/ |
| >>>= 0 |
| |
| ./test/hs/hail $T/hail-reloc-drbd.json.fail-excl-stor |
| >>> /"success":false,.*FailSpindles/ |
| >>>= 0 |
| |
| ./test/hs/hail $T/hail-node-evac.json.fail-excl-stor |
| >>> /"success":true,"info":"Request successful: 1 instances failed to move and 0 were moved successfully",.*FailSpindles/ |
| >>>= 0 |
| |
| ./test/hs/hail $T/hail-change-group.json.fail-excl-stor |
| >>> /"success":true,"info":"Request successful: 1 instances failed to move and 0 were moved successfully",.*FailSpindles: 2"/ |
| >>>= 0 |
| |
| ./test/hs/hail $T/hail-alloc-twodisks.json.fail-excl-stor |
| >>> /"success":false,.*FailSpindles: 1"/ |
| >>>= 0 |
| |
| # check that hail correctly parses admin state |
| ./test/hs/hail -v -v $TESTDATA_DIR/hail-alloc-drbd.json |
| >>>2 /runSt = StatusDown/ |
| >>>=0 |
| |
| # check that hail can use the simu backend |
| ./test/hs/hail --simu p,8,8T,16g,16 $TESTDATA_DIR/hail-alloc-drbd.json |
| >>> /"success":true,/ |
| >>>= 0 |
| |
| # check that hail can use the text backend |
| ./test/hs/hail -t $T/simu-rebal-merged.standard $TESTDATA_DIR/hail-alloc-drbd.json |
| >>> /"success":true,/ |
| >>>= 0 |
| |
| # check that hail can use the simu backend |
| ./test/hs/hail -t $T/simu-rebal-merged.standard $TESTDATA_DIR/hail-alloc-drbd.json |
| >>> /"success":true,/ |
| >>>= 0 |
| |
| # check that hail pre/post saved state differs after allocation |
| ./test/hs/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 |
| >>> /Files .* and .* differ/ |
| >>>= 0 |
| |
| # check that hail pre/post saved state differs after relocation |
| ./test/hs/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 |
| >>> /Files .* and .* differ/ |
| >>>= 0 |
| |
| # evac tests |
| ./test/hs/hail $T/hail-node-evac.json.primary-only |
| >>> /"success":true,"info":"Request successful: 0 instances failed to move and 1 were moved successfully"/ |
| >>>= 0 |
| |
| ./test/hs/hail $T/hail-node-evac.json.secondary-only |
| >>> /"success":true,"info":"Request successful: 0 instances failed to move and 1 were moved successfully"/ |
| >>>= 0 |
| |
| ./test/hs/hail $T/hail-node-evac.json.all |
| >>> /"success":true,"info":"Request successful: 0 instances failed to move and 1 were moved successfully"/ |
| >>>= 0 |
| |
| # Check interaction between policies and spindles |
| ./test/hs/hail $TESTDATA_DIR/hail-alloc-spindles.json |
| >>> /"success":true,"info":"Request successful: Selected group: group2,.*FailSpindles: 2,.*"result":\["node4"\]/ |
| >>>= 0 |
| |
| ./test/hs/hail $T/hail-alloc-spindles.json.excl-stor |
| >>> /"success":true,"info":"Request successful: Selected group: group1,.*FailSpindles: 2",.*"result":\["node1"\]/ |
| >>>= 0 |