From 26a0e8a0849e81bfd557583ae4aad774e0e38a21 Mon Sep 17 00:00:00 2001 From: Andrew Schoen Date: Wed, 7 Dec 2016 14:31:31 -0600 Subject: [PATCH] tests: account for multiple osd hosts when testing if all are up and in Signed-off-by: Andrew Schoen --- tests/conftest.py | 4 ++++ tests/functional/tests/mon/test_mons.py | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index be43f6655..41233ff36 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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, diff --git a/tests/functional/tests/mon/test_mons.py b/tests/functional/tests/mon/test_mons.py index 5f98d372a..1942dbe54 100644 --- a/tests/functional/tests/mon/test_mons.py +++ b/tests/functional/tests/mon/test_mons.py @@ -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