Revision 7018af9c htools/Ganeti/HTools/QC.hs

b/htools/Ganeti/HTools/QC.hs
1236 1236
prop_ClusterAllocRelocate =
1237 1237
  forAll (choose (4, 8)) $ \count ->
1238 1238
  forAll (genOnlineNode `suchThat` (isNodeBig 4)) $ \node ->
1239
  forAll (genInstanceSmallerThanNode node) $ \inst ->
1239
  forAll (genInstanceSmallerThanNode node `suchThat` isMirrored) $ \inst ->
1240 1240
  case genClusterAlloc count node inst of
1241 1241
    Types.Bad msg -> failTest msg
1242 1242
    Types.Ok (nl, il, inst') ->
1243 1243
      case IAlloc.processRelocate defGroupList nl il
1244
             (Instance.idx inst) 1 [Instance.sNode inst'] of
1245
        Types.Ok _ -> printTestCase "??" True  -- huh, how to make
1246
                                               -- this nicer...
1244
             (Instance.idx inst) 1
1245
             [(if Instance.diskTemplate inst' == Types.DTDrbd8
1246
                 then Instance.sNode
1247
                 else Instance.pNode) inst'] of
1248
        Types.Ok _ -> property True
1247 1249
        Types.Bad msg -> failTest $ "Failed to relocate: " ++ msg
1248 1250

  
1249 1251
-- | Helper property checker for the result of a nodeEvac or

Also available in: Unified diff