]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
tests: adds an osds parameter to the node fixture 1150/head
authorAndrew Schoen <aschoen@redhat.com>
Thu, 8 Dec 2016 01:24:40 +0000 (19:24 -0600)
committerAndrew Schoen <aschoen@redhat.com>
Thu, 8 Dec 2016 01:27:42 +0000 (19:27 -0600)
The osds are named differently for systemd in containerized deployments
so this new parameter is used to make that change transparent in the
tests.

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

index 815727c590969a47615052dec1edb1a16f6202e7..5fd2c155db909c945983d4235461a8d5af0682a4 100644 (file)
@@ -25,6 +25,7 @@ def node(Ansible, Interface, Command, request):
         pytest.skip("Scenario is not using journal collocation")
 
     osd_ids = []
+    osds = []
     cluster_address = ""
     if node_type == "osds":
         result = Command.check_output('sudo ls /var/lib/ceph/osd/ | grep -oP "\d+$"')
@@ -33,6 +34,9 @@ def node(Ansible, Interface, Command, request):
         # boxes we test with use that interface. OSDs are the only
         # nodes that have this interface.
         cluster_address = Interface("eth2").addresses[0]
+        osds = osd_ids
+        if docker:
+            osds = [device.split("/")[-1] for device in ansible_vars["devices"]]
 
     # I can assume eth1 because I know all the vagrant
     # boxes we test with use that interface
@@ -57,6 +61,7 @@ def node(Ansible, Interface, Command, request):
         conf_path=conf_path,
         cluster_address=cluster_address,
         docker=docker,
+        osds=osds,
     )
     return data
 
index b754a0d4b22afb198c9101028bda88569ba7fc46..4ae18165bc8d8380927eecd1f24ea4ba8c4e49f0 100644 (file)
@@ -26,14 +26,14 @@ class TestOSDs(object):
             )).is_listening
 
     def test_osd_services_are_running(self, node, Service):
-        # TODO: figure out way to paramaterize node['osd_ids'] for this test
-        for osd_id in node["osd_ids"]:
-            assert Service("ceph-osd@%s" % osd_id).is_running
+        # TODO: figure out way to paramaterize node['osds'] for this test
+        for osd in node["osds"]:
+            assert Service("ceph-osd@%s" % osd).is_running
 
     def test_osd_services_are_enabled(self, node, Service):
-        # TODO: figure out way to paramaterize node['osd_ids'] for this test
-        for osd_id in node["osd_ids"]:
-            assert Service("ceph-osd@%s" % osd_id).is_enabled
+        # TODO: figure out way to paramaterize node['osds'] for this test
+        for osd in node["osds"]:
+            assert Service("ceph-osd@%s" % osd).is_enabled
 
     @pytest.mark.no_docker
     def test_osd_are_mounted(self, node, MountPoint):