Revision 06fb841e Ganeti/HTools/QC.hs
b/Ganeti/HTools/QC.hs | ||
---|---|---|
85 | 85 |
isFailure (Types.OpFail _) = True |
86 | 86 |
isFailure _ = False |
87 | 87 |
|
88 |
-- | Simple checker for whether Result is fail or pass |
|
89 |
isOk :: Types.Result a -> Bool |
|
90 |
isOk (Types.Ok _ ) = True |
|
91 |
isOk _ = False |
|
92 |
|
|
93 |
isBad :: Types.Result a -> Bool |
|
94 |
isBad = not . isOk |
|
95 |
|
|
96 | 88 |
-- | Update an instance to be smaller than a node |
97 | 89 |
setInstanceSmallerThanNode node inst = |
98 | 90 |
inst { Instance.mem = Node.availMem node `div` 2 |
... | ... | |
388 | 380 |
|
389 | 381 |
prop_Instance_shrinkMF inst = |
390 | 382 |
Instance.mem inst < 2 * Types.unitMem ==> |
391 |
isBad $ Instance.shrinkByType inst Types.FailMem |
|
383 |
Types.isBad $ Instance.shrinkByType inst Types.FailMem
|
|
392 | 384 |
|
393 | 385 |
prop_Instance_shrinkCG inst = |
394 | 386 |
Instance.vcpus inst >= 2 * Types.unitCpu ==> |
... | ... | |
399 | 391 |
|
400 | 392 |
prop_Instance_shrinkCF inst = |
401 | 393 |
Instance.vcpus inst < 2 * Types.unitCpu ==> |
402 |
isBad $ Instance.shrinkByType inst Types.FailCPU |
|
394 |
Types.isBad $ Instance.shrinkByType inst Types.FailCPU
|
|
403 | 395 |
|
404 | 396 |
prop_Instance_shrinkDG inst = |
405 | 397 |
Instance.dsk inst >= 2 * Types.unitDsk ==> |
... | ... | |
410 | 402 |
|
411 | 403 |
prop_Instance_shrinkDF inst = |
412 | 404 |
Instance.dsk inst < 2 * Types.unitDsk ==> |
413 |
isBad $ Instance.shrinkByType inst Types.FailDisk |
|
405 |
Types.isBad $ Instance.shrinkByType inst Types.FailDisk
|
|
414 | 406 |
|
415 | 407 |
prop_Instance_setMovable inst m = |
416 | 408 |
Instance.movable inst' == m |
Also available in: Unified diff