Revision eae69eee
b/htools/Ganeti/HTools/QC.hs | ||
---|---|---|
1077 | 1077 |
length (nub onlyuuid) == length onlyuuid && |
1078 | 1078 |
(null nodes || not (null ng)) |
1079 | 1079 |
|
1080 |
-- Check idempotence of add/remove operations |
|
1081 |
prop_Node_addPri_idempotent = |
|
1082 |
forAll genOnlineNode $ \node -> |
|
1083 |
forAll (genInstanceSmallerThanNode node) $ \inst -> |
|
1084 |
case Node.addPri node inst of |
|
1085 |
Types.OpGood node' -> Node.removePri node' inst ==? node |
|
1086 |
_ -> failTest "Can't add instance" |
|
1087 |
|
|
1088 |
prop_Node_addSec_idempotent = |
|
1089 |
forAll genOnlineNode $ \node -> |
|
1090 |
forAll (genInstanceSmallerThanNode node) $ \inst -> |
|
1091 |
let pdx = Node.idx node + 1 |
|
1092 |
inst' = Instance.setPri inst pdx |
|
1093 |
in case Node.addSec node inst' pdx of |
|
1094 |
Types.OpGood node' -> Node.removeSec node' inst' ==? node |
|
1095 |
_ -> failTest "Can't add instance" |
|
1096 |
|
|
1080 | 1097 |
testSuite "Node" |
1081 | 1098 |
[ 'prop_Node_setAlias |
1082 | 1099 |
, 'prop_Node_setOffline |
... | ... | |
1093 | 1110 |
, 'prop_Node_tagMaps_reject |
1094 | 1111 |
, 'prop_Node_showField |
1095 | 1112 |
, 'prop_Node_computeGroups |
1113 |
, 'prop_Node_addPri_idempotent |
|
1114 |
, 'prop_Node_addSec_idempotent |
|
1096 | 1115 |
] |
1097 | 1116 |
|
1098 | 1117 |
-- ** Cluster tests |
Also available in: Unified diff