]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
tests: allow defining arbitrary number of OSDs
authorAlfredo Deza <adeza@redhat.com>
Fri, 31 Aug 2018 19:29:17 +0000 (12:29 -0700)
committermergify[bot] <mergify[bot]@users.noreply.github.com>
Fri, 31 Aug 2018 21:23:20 +0000 (21:23 +0000)
Some tests might want to set this since number of devices will not
necessarily map to number of OSDs

Signed-off-by: Alfredo Deza <adeza@redhat.com>
tests/conftest.py

index f35783a6151344cd6251557c28c933b2b40877ce..a89ff260ecd0be0be55394b9abfc64b14bc3b901 100644 (file)
@@ -91,6 +91,9 @@ def node(host, request):
         num_devices = len(ansible_vars.get("devices", []))
     if not num_devices:
         num_devices = len(ansible_vars.get("lvm_volumes", []))
+    # If number of devices doesn't map to number of OSDs, allow tests to define
+    # that custom number, defaulting it to ``num_devices``
+    num_osds = ansible_vars.get('num_osds', num_devices)
     cluster_name = ansible_vars.get("cluster", "ceph")
     conf_path = "/etc/ceph/{}.conf".format(cluster_name)
     if "osds" in group_names:
@@ -116,6 +119,7 @@ def node(host, request):
         osd_ids=osd_ids,
         num_mons=num_mons,
         num_devices=num_devices,
+        num_osds=num_osds,
         cluster_name=cluster_name,
         conf_path=conf_path,
         cluster_address=cluster_address,