Revision 942a9a6a htest/Test/Ganeti/HTools/Cluster.hs

b/htest/Test/Ganeti/HTools/Cluster.hs
266 266
      let moved = Cluster.esMoved es
267 267
          failed = Cluster.esFailed es
268 268
          opcodes = not . null $ Cluster.esOpCodes es
269
      in failmsg ("'failed' not empty: " ++ show failed) (null failed) .&&.
270
         failmsg "'opcodes' is null" opcodes .&&.
271
         case moved of
272
           [(idx', gdx, _)] -> failmsg "invalid instance moved" (idx == idx')
273
                               .&&.
274
                               failmsg "wrong target group"
275
                                         (gdx == Group.idx grp)
276
           v -> failmsg  ("invalid solution: " ++ show v) False
269
      in conjoin
270
           [ failmsg ("'failed' not empty: " ++ show failed) (null failed)
271
           , failmsg "'opcodes' is null" opcodes
272
           , case moved of
273
               [(idx', gdx, _)] ->
274
                 failmsg "invalid instance moved" (idx == idx') .&&.
275
                 failmsg "wrong target group" (gdx == Group.idx grp)
276
               v -> failmsg  ("invalid solution: " ++ show v) False
277
           ]
277 278
  where failmsg :: String -> Bool -> Property
278 279
        failmsg msg = printTestCase ("Failed to evacuate: " ++ msg)
279 280
        idx = Instance.idx inst

Also available in: Unified diff