]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
testing: CephNode should return osd_ids
authorAndrew Schoen <aschoen@redhat.com>
Mon, 5 Dec 2016 21:03:44 +0000 (15:03 -0600)
committerAndrew Schoen <aschoen@redhat.com>
Tue, 6 Dec 2016 20:56:19 +0000 (14:56 -0600)
This is an empty list on anything but an OSD node. These ids will be
used for further OSD testing.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
tests/conftest.py

index c9aacba062f5d6ba9ba306b45670f9a8b604a6cb..f970608cad9ee1841ea1d444c90554cc31b540bf 100644 (file)
@@ -2,12 +2,17 @@ import pytest
 
 
 @pytest.fixture()
-def CephNode(Ansible, Interface, request):
+def CephNode(Ansible, Interface, Command, request):
     vars = Ansible.get_variables()
     node_type = vars["group_names"][0]
     if not request.node.get_marker(node_type) and not request.node.get_marker('all'):
         pytest.skip("Not a valid test for node type")
 
+    osd_ids = []
+    if node_type == "osds":
+        result = Command.check_output('sudo ls /var/lib/ceph/osd/ | grep -oP "\d+$"')
+        osd_ids = result.split("\n")
+
     # I can assume eth1 because I know all the vagrant
     # boxes we test with use that interface
     address = Interface("eth1").addresses[0]
@@ -16,6 +21,7 @@ def CephNode(Ansible, Interface, request):
         address=address,
         subnet=subnet,
         vars=vars,
+        osd_ids=osd_ids,
     )
     return data