Skip to content
Snippets Groups Projects
Commit 53bddadd authored by Iustin Pop's avatar Iustin Pop
Browse files

Fix Node_addPriFD test for arbitrary disk templates


Currently, this test assumes localStorageTemplates, so let's make sure
we enforce that on the given instance

Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 0c8cef35
No related branches found
No related tags found
No related merge requests found
......@@ -990,15 +990,20 @@ prop_Node_addPriFM node inst =
inst' = setInstanceSmallerThanNode node inst
inst'' = inst' { Instance.mem = Instance.mem inst }
-- | Check that adding a primary instance with too much disk fails
-- with type FailDisk.
prop_Node_addPriFD node inst =
forAll (elements Instance.localStorageTemplates) $ \dt ->
Instance.dsk inst >= Node.fDsk node && not (Node.failN1 node) ==>
case Node.addPri node inst'' of
Types.OpFail Types.FailDisk -> True
_ -> False
where _types = (node::Node.Node, inst::Instance.Instance)
inst' = setInstanceSmallerThanNode node inst
inst'' = inst' { Instance.dsk = Instance.dsk inst }
let inst' = setInstanceSmallerThanNode node inst
inst'' = inst' { Instance.dsk = Instance.dsk inst
, Instance.diskTemplate = dt }
in case Node.addPri node inst'' of
Types.OpFail Types.FailDisk -> True
_ -> False
-- | Check that adding a primary instance with too many VCPUs fails
-- with type FailCPU.
prop_Node_addPriFC =
forAll (choose (1, maxCpu)) $ \extra ->
forAll genOnlineNode $ \node ->
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment