Commit f9649b3d authored by Klaus Aehlig's avatar Klaus Aehlig
Browse files

Only generate node lists with nodes having different names

genNodeList is used in testing to generate list of nodes
that could come up in cluster configurations. Since names
are used to assign indices to nodes, they have to be unique;
this is also the case in all real clusters.
Signed-off-by: default avatarKlaus Aehlig <>
Reviewed-by: default avatarIustin Pop <>
Reviewed-by: default avatarGuido Trotter <>
parent 69ac3b74
......@@ -112,7 +112,9 @@ instance Arbitrary Node.Node where
-- lists here.
genNodeList :: Gen Node.Node -> Gen Node.List
genNodeList ngen = fmap (snd . Loader.assignIndices) names_nodes
where names_nodes = (fmap . map) (\n -> ( n, n)) $ listOf1 ngen
where names_nodes = (fmap . map) (\n -> ( n, n)) nodes
nodes = listOf1 ngen `suchThat`
((\ns -> ns == nub ns) . map
-- | Generate a node list, an instance list, and a node graph.
-- We choose instances with nodes contained in the node list.
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