Commit d5dfae0a authored by Iustin Pop's avatar Iustin Pop
Browse files

htools: re-indent QC.hs


Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent fd7a7c73
......@@ -91,8 +91,7 @@ maxCpu = 1024
defGroup :: Group.Group
defGroup = flip Group.setIdx 0 $
Group.create "default" Utils.defaultGroupID
Types.AllocPreferred
Group.create "default" Utils.defaultGroupID Types.AllocPreferred
defGroupList :: Group.List
defGroupList = Container.fromList [(Group.idx defGroup, defGroup)]
......@@ -178,7 +177,6 @@ getName = do
dn <- vector n::Gen [DNSChar]
return (map dnsGetChar dn)
getFQDN :: Gen String
getFQDN = do
felem <- getName
......@@ -259,8 +257,7 @@ instance Arbitrary OpCodes.OpCode where
arbitrary
"OP_INSTANCE_MIGRATE" ->
liftM5 OpCodes.OpInstanceMigrate arbitrary arbitrary
arbitrary arbitrary
arbitrary
arbitrary arbitrary arbitrary
_ -> fail "Wrong opcode")
instance Arbitrary Jobs.OpStatus where
......@@ -357,7 +354,7 @@ prop_Utils_parseUnit (NonNegative n) =
Utils.parseUnit (show n ++ "m") == Types.Ok n &&
(case Utils.parseUnit (show n ++ "M") of
Types.Ok m -> if n > 0
then m < n -- for positive values, X MB is less than X MiB
then m < n -- for positive values, X MB is < than X MiB
else m == 0 -- but for 0, 0 MB == 0 MiB
Types.Bad _ -> False) &&
Utils.parseUnit (show n ++ "g") == Types.Ok (n*1024) &&
......@@ -505,8 +502,7 @@ prop_Instance_setBoth inst pdx sdx =
prop_Instance_shrinkMG inst =
Instance.mem inst >= 2 * Types.unitMem ==>
case Instance.shrinkByType inst Types.FailMem of
Types.Ok inst' ->
Instance.mem inst' == Instance.mem inst - Types.unitMem
Types.Ok inst' -> Instance.mem inst' == Instance.mem inst - Types.unitMem
_ -> False
prop_Instance_shrinkMF inst =
......@@ -588,8 +584,7 @@ prop_Text_Load_Instance name mem dsk vcpus status
, vcpus::Int, status::Types.InstanceStatus
, snode::String
, autobal::Bool)
in
case inst of
in case inst of
Types.Bad msg -> printTestCase ("Failed to load instance: " ++ msg)
False
Types.Ok (_, i) -> printTestCase "Mismatch in some field while\
......@@ -683,10 +678,9 @@ prop_Node_setMcpu node mc =
-- | Check that an instance add with too high memory or disk will be
-- rejected.
prop_Node_addPriFM node inst = Instance.mem inst >= Node.fMem node &&
not (Node.failN1 node) &&
not (Instance.instanceOffline inst)
==>
prop_Node_addPriFM node inst =
Instance.mem inst >= Node.fMem node && not (Node.failN1 node) &&
not (Instance.instanceOffline inst) ==>
case Node.addPri node inst'' of
Types.OpFail Types.FailMem -> True
_ -> False
......@@ -694,9 +688,8 @@ prop_Node_addPriFM node inst = Instance.mem inst >= Node.fMem node &&
inst' = setInstanceSmallerThanNode node inst
inst'' = inst' { Instance.mem = Instance.mem inst }
prop_Node_addPriFD node inst = Instance.dsk inst >= Node.fDsk node &&
not (Node.failN1 node)
==>
prop_Node_addPriFD node inst =
Instance.dsk inst >= Node.fDsk node && not (Node.failN1 node) ==>
case Node.addPri node inst'' of
Types.OpFail Types.FailDisk -> True
_ -> False
......@@ -705,8 +698,7 @@ prop_Node_addPriFD node inst = Instance.dsk inst >= Node.fDsk node &&
inst'' = inst' { Instance.dsk = Instance.dsk inst }
prop_Node_addPriFC node inst (Positive extra) =
not (Node.failN1 node) &&
not (Instance.instanceOffline inst) ==>
not (Node.failN1 node) && not (Instance.instanceOffline inst) ==>
case Node.addPri node inst'' of
Types.OpFail Types.FailCPU -> True
_ -> False
......@@ -720,8 +712,8 @@ prop_Node_addSec node inst pdx =
((Instance.mem inst >= (Node.fMem node - Node.rMem node) &&
not (Instance.instanceOffline inst)) ||
Instance.dsk inst >= Node.fDsk node) &&
not (Node.failN1 node)
==> isFailure (Node.addSec node inst pdx)
not (Node.failN1 node) ==>
isFailure (Node.addSec node inst pdx)
where _types = (node::Node.Node, inst::Instance.Instance, pdx::Int)
-- | Check that an offline instance with reasonable disk size can always
......@@ -772,8 +764,7 @@ prop_Node_rMem inst =
-- test as any
inst_idx `elem` Node.sList a_ab &&
not (inst_idx `elem` Node.sList d_ab)
x -> printTestCase ("Failed to add/remove instances: " ++ show x)
False
x -> printTestCase ("Failed to add/remove instances: " ++ show x) False
-- | Check mdsk setting.
prop_Node_setMdsk node mx =
......@@ -1028,7 +1019,8 @@ prop_Loader_assignIndices nodes =
(if not (null nodes)
then maximum (IntMap.keys kt) == length nodes - 1
else True)
where (nassoc, kt) = Loader.assignIndices (map (\n -> (Node.name n, n)) nodes)
where (nassoc, kt) =
Loader.assignIndices (map (\n -> (Node.name n, n)) nodes)
-- | Checks that the number of primary instances recorded on the nodes
-- is zero.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment