def test_make_topology_without_replicas_unused_role(self): nodes = { "node1": { "roles": ["controller"] }, } expected_topology = {"mysql": ["node1"], "keystone": ["node1"]} topology = deploy._make_topology(nodes, self._roles, None) self.assertDictEqual(expected_topology, topology)
def test_make_topology_without_replicas_unused_role(self): nodes = _yaml.AttrDict({ "node1": { "roles": ["controller"] }, }) expected_topology = { "_ccp_jobs": ["node1"], "mysql": ["node1"], "keystone": ["node1"] } topology = deploy._make_topology(nodes, self._roles, _yaml.AttrDict()) self.assertDictEqual(expected_topology, topology)
def test_make_topology_without_replicas_twice_used_role(self): nodes = { "node1": { "roles": ["controller", "compute"] }, "node[2-3]": { "roles": ["compute"] } } expected_topology = { "mysql": ["node1"], "keystone": ["node1"], "nova-compute": ["node1", "node2", "node3"], "libvirtd": ["node1", "node2", "node3"] } topology = deploy._make_topology(nodes, self._roles, None) self.assertDictEqual(expected_topology, topology)
def test_make_topology_without_replicas_twice_used_role(self): nodes = _yaml.AttrDict({ "node1": { "roles": ["controller", "compute"] }, "node[2-3]": { "roles": ["compute"] } }) expected_topology = { "_ccp_jobs": ["node1", "node2", "node3"], "mysql": ["node1"], "keystone": ["node1"], "nova-compute": ["node1", "node2", "node3"], "libvirtd": ["node1", "node2", "node3"] } topology = deploy._make_topology(nodes, self._roles, _yaml.AttrDict()) self.assertDictEqual(expected_topology, topology)
def test_make_topology_without_replicas_twice_used_node(self): nodes = _yaml.AttrDict({ "node1": { "roles": ["controller"] }, "node[1-3]": { "roles": ["compute"] } }) expected_topology = { "_ccp_jobs": ["node1", "node2", "node3"], "mysql": ["node1"], "keystone": ["node1"], "nova-compute": ["node1", "node2", "node3"], "libvirtd": ["node1", "node2", "node3"] } topology = deploy._make_topology(nodes, self._roles, _yaml.AttrDict()) self.assertDictEqual(expected_topology, topology)