tests: account for multiple osd hosts when testing if all are up and in

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
pull/1150/head
Andrew Schoen 2016-12-07 14:31:31 -06:00
parent f5fb924189
commit 26a0e8a084
2 changed files with 5 additions and 2 deletions

View File

@ -36,6 +36,8 @@ def node(Ansible, Interface, Command, request):
subnet = ".".join(ansible_vars["public_network"].split(".")[0:-1])
num_mons = len(ansible_vars["groups"]["mons"])
num_devices = len(ansible_vars["devices"])
num_osd_hosts = len(ansible_vars["groups"]["osds"])
total_osds = num_devices * num_osd_hosts
cluster_name = ansible_vars.get("cluster", "ceph")
conf_path = "/etc/ceph/{}.conf".format(cluster_name)
data = dict(
@ -45,6 +47,8 @@ def node(Ansible, Interface, Command, request):
osd_ids=osd_ids,
num_mons=num_mons,
num_devices=num_devices,
num_osd_hosts=num_osd_hosts,
total_osds=total_osds,
cluster_name=cluster_name,
conf_path=conf_path,
cluster_address=cluster_address,

View File

@ -30,6 +30,5 @@ class TestOSDs(object):
def test_all_osds_are_up_and_in(self, node, Command):
cmd = "sudo ceph --cluster={} --connect-timeout 5 -s".format(node["cluster_name"])
output = Command.check_output(cmd)
num_osds = len(node["vars"]["devices"])
phrase = "{num_osds} osds: {num_osds} up, {num_osds} in".format(num_osds=num_osds)
phrase = "{num_osds} osds: {num_osds} up, {num_osds} in".format(num_osds=node["total_osds"])
assert phrase in output