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

Generate clusters with unique node names in tests



Nothing breaks otherwise in the cluster routines, but serialisation
to/from text gets confused otherwise.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
parent d6f9f5bd
......@@ -154,8 +154,13 @@ createInstance mem dsk vcpus =
-- | Create a small cluster by repeating a node spec.
makeSmallCluster :: Node.Node -> Int -> Node.List
makeSmallCluster node count =
let fn = Node.buildPeers node Container.empty
namelst = map (\n -> (Node.name n, n)) (replicate count fn)
let origname = Node.name node
origalias = Node.alias node
nodes = map (\idx -> node { Node.name = origname ++ "-" ++ show idx
, Node.alias = origalias ++ "-" ++ show idx })
[1..count]
fn = flip Node.buildPeers Container.empty
namelst = map (\n -> (Node.name n, fn n)) nodes
(_, nlst) = Loader.assignIndices namelst
in nlst
......
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