Revision 41085bd3
b/htools/Ganeti/HTools/QC.hs | ||
---|---|---|
406 | 406 |
_ -> False |
407 | 407 |
|
408 | 408 |
prop_Instance_shrinkMF inst = |
409 |
Instance.mem inst < 2 * Types.unitMem ==> |
|
410 |
Types.isBad $ Instance.shrinkByType inst Types.FailMem |
|
409 |
forAll (choose (0, 2 * Types.unitMem - 1)) $ \mem -> |
|
410 |
let inst' = inst { Instance.mem = mem} |
|
411 |
in Types.isBad $ Instance.shrinkByType inst' Types.FailMem |
|
411 | 412 |
|
412 | 413 |
prop_Instance_shrinkCG inst = |
413 | 414 |
Instance.vcpus inst >= 2 * Types.unitCpu ==> |
... | ... | |
417 | 418 |
_ -> False |
418 | 419 |
|
419 | 420 |
prop_Instance_shrinkCF inst = |
420 |
Instance.vcpus inst < 2 * Types.unitCpu ==> |
|
421 |
Types.isBad $ Instance.shrinkByType inst Types.FailCPU |
|
421 |
forAll (choose (0, 2 * Types.unitCpu - 1)) $ \vcpus -> |
|
422 |
let inst' = inst { Instance.vcpus = vcpus } |
|
423 |
in Types.isBad $ Instance.shrinkByType inst' Types.FailCPU |
|
422 | 424 |
|
423 | 425 |
prop_Instance_shrinkDG inst = |
424 | 426 |
Instance.dsk inst >= 2 * Types.unitDsk ==> |
... | ... | |
428 | 430 |
_ -> False |
429 | 431 |
|
430 | 432 |
prop_Instance_shrinkDF inst = |
431 |
Instance.dsk inst < 2 * Types.unitDsk ==> |
|
432 |
Types.isBad $ Instance.shrinkByType inst Types.FailDisk |
|
433 |
forAll (choose (0, 2 * Types.unitDsk - 1)) $ \dsk -> |
|
434 |
let inst' = inst { Instance.dsk = dsk } |
|
435 |
in Types.isBad $ Instance.shrinkByType inst' Types.FailDisk |
|
433 | 436 |
|
434 | 437 |
prop_Instance_setMovable inst m = |
435 | 438 |
Instance.movable inst' == m |
... | ... | |
591 | 594 |
inst' = setInstanceSmallerThanNode node inst |
592 | 595 |
inst'' = inst' { Instance.dsk = Instance.dsk inst } |
593 | 596 |
|
594 |
prop_Node_addPriFC node inst = Instance.vcpus inst > Node.availCpu node && |
|
595 |
not (Node.failN1 node) |
|
596 |
==> |
|
597 |
case Node.addPri node inst'' of |
|
598 |
Types.OpFail Types.FailCPU -> True |
|
599 |
_ -> False |
|
597 |
prop_Node_addPriFC node inst (Positive extra) = |
|
598 |
not (Node.failN1 node) ==> |
|
599 |
case Node.addPri node inst'' of |
|
600 |
Types.OpFail Types.FailCPU -> True |
|
601 |
_ -> False |
|
600 | 602 |
where _types = (node::Node.Node, inst::Instance.Instance) |
601 | 603 |
inst' = setInstanceSmallerThanNode node inst |
602 |
inst'' = inst' { Instance.vcpus = Instance.vcpus inst }
|
|
604 |
inst'' = inst' { Instance.vcpus = Node.availCpu node + extra }
|
|
603 | 605 |
|
604 | 606 |
-- | Check that an instance add with too high memory or disk will be rejected |
605 | 607 |
prop_Node_addSec node inst pdx = |
Also available in: Unified diff