Revision 53bddadd
b/htools/Ganeti/HTools/QC.hs | ||
---|---|---|
990 | 990 |
inst' = setInstanceSmallerThanNode node inst |
991 | 991 |
inst'' = inst' { Instance.mem = Instance.mem inst } |
992 | 992 |
|
993 |
-- | Check that adding a primary instance with too much disk fails |
|
994 |
-- with type FailDisk. |
|
993 | 995 |
prop_Node_addPriFD node inst = |
996 |
forAll (elements Instance.localStorageTemplates) $ \dt -> |
|
994 | 997 |
Instance.dsk inst >= Node.fDsk node && not (Node.failN1 node) ==> |
995 |
case Node.addPri node inst'' of
|
|
996 |
Types.OpFail Types.FailDisk -> True
|
|
997 |
_ -> False
|
|
998 |
where _types = (node::Node.Node, inst::Instance.Instance)
|
|
999 |
inst' = setInstanceSmallerThanNode node inst
|
|
1000 |
inst'' = inst' { Instance.dsk = Instance.dsk inst }
|
|
998 |
let inst' = setInstanceSmallerThanNode node inst
|
|
999 |
inst'' = inst' { Instance.dsk = Instance.dsk inst
|
|
1000 |
, Instance.diskTemplate = dt }
|
|
1001 |
in case Node.addPri node inst'' of
|
|
1002 |
Types.OpFail Types.FailDisk -> True
|
|
1003 |
_ -> False
|
|
1001 | 1004 |
|
1005 |
-- | Check that adding a primary instance with too many VCPUs fails |
|
1006 |
-- with type FailCPU. |
|
1002 | 1007 |
prop_Node_addPriFC = |
1003 | 1008 |
forAll (choose (1, maxCpu)) $ \extra -> |
1004 | 1009 |
forAll genOnlineNode $ \node -> |
Also available in: Unified diff