diff --git a/tests/conftest.py b/tests/conftest.py index f980dcfd1..a3d8bea75 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -28,11 +28,15 @@ def node(Ansible, Interface, Command, request): # boxes we test with use that interface address = Interface("eth1").addresses[0] subnet = ".".join(ansible_vars["public_network"].split(".")[0:-1]) + num_mons = len(ansible_vars["groups"]["mons"]) + cluster_name = ansible_vars.get("cluster", "ceph") + conf_path = "/etc/ceph/{}.conf".format(cluster_name) data = dict( address=address, subnet=subnet, vars=ansible_vars, osd_ids=osd_ids, + num_mons=num_mons, ) return data diff --git a/tests/functional/tests/test_install.py b/tests/functional/tests/test_install.py index d12f6123b..c019276b6 100644 --- a/tests/functional/tests/test_install.py +++ b/tests/functional/tests/test_install.py @@ -32,9 +32,8 @@ class TestCephConf(object): assert File("/etc/ceph/ceph.conf").contains("^mon host = .*$") def test_mon_host_line_has_correct_value(self, node, File): - num_mons = len(node["vars"]["groups"]["mons"]) mon_ips = [] - for x in range(0, num_mons): + for x in range(0, node["num_mons"]): mon_ips.append("{}.1{}".format(node["subnet"], x)) line = "mon host = {}".format(",".join(mon_ips)) assert File("/etc/ceph/ceph.conf").contains(line)