Revision 7959cbb9 htools/Ganeti/HTools/QC.hs
b/htools/Ganeti/HTools/QC.hs | ||
---|---|---|
960 | 960 |
-- rejected. |
961 | 961 |
prop_Node_addPriFM node inst = |
962 | 962 |
Instance.mem inst >= Node.fMem node && not (Node.failN1 node) && |
963 |
not (Instance.instanceOffline inst) ==>
|
|
963 |
not (Instance.isOffline inst) ==>
|
|
964 | 964 |
case Node.addPri node inst'' of |
965 | 965 |
Types.OpFail Types.FailMem -> True |
966 | 966 |
_ -> False |
... | ... | |
980 | 980 |
prop_Node_addPriFC = |
981 | 981 |
forAll (choose (1, maxCpu)) $ \extra -> |
982 | 982 |
forAll genOnlineNode $ \node -> |
983 |
forAll (arbitrary `suchThat` Instance.instanceNotOffline) $ \inst ->
|
|
983 |
forAll (arbitrary `suchThat` Instance.notOffline) $ \inst ->
|
|
984 | 984 |
let inst' = setInstanceSmallerThanNode node inst |
985 | 985 |
inst'' = inst' { Instance.vcpus = Node.availCpu node + extra } |
986 | 986 |
in case Node.addPri node inst'' of |
... | ... | |
991 | 991 |
-- rejected. |
992 | 992 |
prop_Node_addSec node inst pdx = |
993 | 993 |
((Instance.mem inst >= (Node.fMem node - Node.rMem node) && |
994 |
not (Instance.instanceOffline inst)) ||
|
|
994 |
not (Instance.isOffline inst)) ||
|
|
995 | 995 |
Instance.dsk inst >= Node.fDsk node) && |
996 | 996 |
not (Node.failN1 node) ==> |
997 | 997 |
isFailure (Node.addSec node inst pdx) |
... | ... | |
1011 | 1011 |
|
1012 | 1012 |
-- | Checks for memory reservation changes. |
1013 | 1013 |
prop_Node_rMem inst = |
1014 |
not (Instance.instanceOffline inst) ==>
|
|
1014 |
not (Instance.isOffline inst) ==>
|
|
1015 | 1015 |
forAll (arbitrary `suchThat` ((> Types.unitMem) . Node.fMem)) $ \node -> |
1016 | 1016 |
-- ab = auto_balance, nb = non-auto_balance |
1017 | 1017 |
-- we use -1 as the primary node of the instance |
Also available in: Unified diff