pn <- arbitrary
sn <- arbitrary
vcpus <- arbitrary
- return $ Instance.create name mem dsk vcpus run_st pn sn
+ return $ Instance.create name mem dsk vcpus run_st [] pn sn
-- and a random node
instance Arbitrary Node.Node where
let run_st = Instance.running inst
run_tx = Instance.runSt inst
in
- run_tx == "running" || run_tx == "ERROR_up" ==> run_st == True
+ run_tx `elem` Instance.runningStates ==> run_st
prop_Instance_runStatus_False inst =
let run_st = Instance.running inst
run_tx = Instance.runSt inst
in
- run_tx /= "running" && run_tx /= "ERROR_up" ==> run_st == False
+ run_tx `notElem` Instance.runningStates ==> not run_st
testInstance =
[ run prop_Instance_setIdx
then sdx + 1
else sdx
ndx = [(pnode, pdx), (rsnode, rsdx)]
+ tags = ""
inst = Text.loadInst ndx
- (name:mem_s:dsk_s:vcpus_s:status:pnode:rsnode:[])::
+ [name, mem_s, dsk_s, vcpus_s, status, pnode, rsnode, tags]::
Maybe (String, Instance.Instance)
_types = ( name::String, mem::Int, dsk::Int
, vcpus::Int, status::String
-- | Check that the cluster score is close to zero for a homogeneous cluster
prop_Score_Zero node count =
- ((not $ Node.offline node) && (not $ Node.failN1 node) && (count > 0) &&
+ (not (Node.offline node) && not (Node.failN1 node) && (count > 0) &&
(Node.tDsk node > 0) && (Node.tMem node > 0)) ==>
let fn = Node.buildPeers node Container.empty
- nlst = (zip [1..] $ replicate count fn)::[(Types.Ndx, Node.Node)]
+ nlst = zip [1..] $ replicate count fn::[(Types.Ndx, Node.Node)]
nl = Container.fromAssocList nlst
score = Cluster.compCV nl
-- we can't say == 0 here as the floating point errors accumulate;