Commit 309e7c9a authored by Iustin Pop's avatar Iustin Pop
Browse files

htools: fix corner case in prop_Text_Load_Instance

This unittest had a corner case where it could fail if the same
primary/secondary node names were generated.
Signed-off-by: default avatarIustin Pop <>
Reviewed-by: default avatarMichael Hanselmann <>
parent 509809db
......@@ -476,15 +476,13 @@ testInstance =
prop_Text_Load_Instance name mem dsk vcpus status
(NonEmpty pnode) snode
(NonNegative pdx) (NonNegative sdx) autobal =
pnode /= snode && pdx /= sdx ==>
let vcpus_s = show vcpus
dsk_s = show dsk
mem_s = show mem
rsdx = if pdx == sdx
then sdx + 1
else sdx
ndx = if null snode
then [(pnode, pdx)]
else [(pnode, pdx), (snode, rsdx)]
else [(pnode, pdx), (snode, sdx)]
nl = Data.Map.fromList ndx
tags = ""
sbal = if autobal then "Y" else "N"
......@@ -508,7 +506,7 @@ prop_Text_Load_Instance name mem dsk vcpus status
Instance.pNode i == pdx &&
Instance.sNode i == (if null snode
then Node.noSecondary
else rsdx) &&
else sdx) &&
Instance.auto_balance i == autobal &&
isNothing fail1
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