Revision a1cd7c1e

b/htools/Ganeti/HTools/QC.hs
257 257

  
258 258
-- If the list is not just an empty element, and if the elements do
259 259
-- not contain commas, then join+split should be idepotent
260
prop_Utils_commaJoinSplit lst = lst /= [""] &&
261
                                all (not . elem ',') lst ==>
262
                                Utils.sepSplit ',' (Utils.commaJoin lst) == lst
260
prop_Utils_commaJoinSplit =
261
    forAll (arbitrary `suchThat`
262
            (\l -> l /= [""] && all (not . elem ',') l )) $ \lst ->
263
    Utils.sepSplit ',' (Utils.commaJoin lst) == lst
264

  
263 265
-- Split and join should always be idempotent
264 266
prop_Utils_commaSplitJoin s = Utils.commaJoin (Utils.sepSplit ',' s) == s
265 267

  
......
399 401
    where _types = (inst::Instance.Instance, pdx::Types.Ndx, sdx::Types.Ndx)
400 402
          si = Instance.setBoth inst pdx sdx
401 403

  
402
prop_Instance_runStatus_True inst =
403
    let run_st = Instance.running inst
404
        run_tx = Instance.runSt inst
405
    in
406
      run_tx `elem` Instance.runningStates ==> run_st
404
prop_Instance_runStatus_True =
405
    forAll (arbitrary `suchThat`
406
            ((`elem` Instance.runningStates) . Instance.runSt))
407
    Instance.running
407 408

  
408 409
prop_Instance_runStatus_False inst =
409 410
    let run_st = Instance.running inst
......
472 473

  
473 474
-- Instance text loader tests
474 475

  
475
prop_Text_Load_Instance name mem dsk vcpus status pnode snode pdx sdx autobal =
476
    not (null pnode) && pdx >= 0 && sdx >= 0 ==>
476
prop_Text_Load_Instance name mem dsk vcpus status
477
                        (NonEmpty pnode) snode
478
                        (NonNegative pdx) (NonNegative sdx) autobal =
477 479
    let vcpus_s = show vcpus
478 480
        dsk_s = show dsk
479 481
        mem_s = show mem
......
494 496
                sbal, pnode, pnode, tags]:: Maybe (String, Instance.Instance)
495 497
        _types = ( name::String, mem::Int, dsk::Int
496 498
                 , vcpus::Int, status::String
497
                 , pnode::String, snode::String
498
                 , pdx::Types.Ndx, sdx::Types.Ndx
499
                 , snode::String
499 500
                 , autobal::Bool)
500 501
    in
501 502
      case inst of

Also available in: Unified diff