Revision cc532bdd htools/Ganeti/HTools/QC.hs

b/htools/Ganeti/HTools/QC.hs
260 260
    -- a found key will be returned as is, not with default
261 261
    Utils.fromObjWithDefault [(random_key, J.showJSON def_value)]
262 262
         random_key (def_value+1) == Just def_value
263
        where _types = (def_value :: Integer)
263
        where _types = def_value :: Integer
264 264

  
265 265
testUtils =
266 266
  [ run prop_Utils_commaJoinSplit
......
487 487
      case inst of
488 488
        Nothing -> False
489 489
        Just (_, i) ->
490
            (Instance.name i == name &&
491
             Instance.vcpus i == vcpus &&
492
             Instance.mem i == mem &&
493
             Instance.pNode i == pdx &&
494
             Instance.sNode i == (if null snode
495
                                  then Node.noSecondary
496
                                  else rsdx) &&
497
             Instance.auto_balance i == autobal &&
498
             isNothing fail1)
490
            Instance.name i == name &&
491
            Instance.vcpus i == vcpus &&
492
            Instance.mem i == mem &&
493
            Instance.pNode i == pdx &&
494
            Instance.sNode i == (if null snode
495
                                 then Node.noSecondary
496
                                 else rsdx) &&
497
            Instance.auto_balance i == autobal &&
498
            isNothing fail1
499 499

  
500 500
prop_Text_Load_InstanceFail ktn fields =
501 501
    length fields /= 9 ==>
......
615 615
prop_Node_rMem node inst =
616 616
    -- ab = auto_balance, nb = non-auto_balance
617 617
    -- we use -1 as the primary node of the instance
618
    let inst' = inst { Instance.pNode = (-1), Instance.auto_balance = True}
618
    let inst' = inst { Instance.pNode = -1, Instance.auto_balance = True }
619 619
        inst_ab = setInstanceSmallerThanNode node inst'
620 620
        inst_nb = inst_ab { Instance.auto_balance = False }
621 621
        -- now we have the two instances, identical except the
......
680 680
  in length nodes == sum (map (length . snd) ng) &&
681 681
     all (\(guuid, ns) -> all ((== guuid) . Node.group) ns) ng &&
682 682
     length (nub onlyuuid) == length onlyuuid &&
683
     if null nodes then True else not (null ng)
683
     (null nodes || not (null ng))
684 684

  
685 685
testNode =
686 686
    [ run prop_Node_setAlias

Also available in: Unified diff