]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
test: fix docker test for lvm
authorSébastien Han <seb@redhat.com>
Fri, 12 Oct 2018 16:58:41 +0000 (18:58 +0200)
committermergify[bot] <mergify[bot]@users.noreply.github.com>
Fri, 12 Oct 2018 20:33:01 +0000 (20:33 +0000)
The CI is still running ceph-disk tests upstream. So until
https://github.com/ceph/ceph-ansible/pull/3187 is merged nothing will
pass anymore.

Signed-off-by: Sébastien Han <seb@redhat.com>
tests/functional/tests/osd/test_osds.py

index feafc219b7da9eb9f4b61fa5705f951a4bd2364f..851c7d7f520117661bdb2750c5a1b726fe3778b1 100644 (file)
@@ -71,8 +71,15 @@ class TestOSDs(object):
 
     @pytest.mark.docker
     def test_all_docker_osds_are_up_and_in(self, node, host):
-        cmd = "sudo docker exec ceph-osd-0 ceph --cluster={cluster} --connect-timeout 5 --keyring /var/lib/ceph/bootstrap-osd/{cluster}.keyring -n client.bootstrap-osd osd tree -f json".format(
-            hostname=node["vars"]["inventory_hostname"],
+        osd_scenario = node["vars"].get('osd_scenario', False)
+        if osd_scenario in ['lvm', 'lvm-batch']:
+            osd_id = "0"
+        else:
+            hostname = node["vars"]["inventory_hostname"]
+            osd_id = os.path.join(hostname+"-sda")
+
+        cmd = "sudo docker exec ceph-osd-{osd_id} ceph --cluster={cluster} --connect-timeout 5 --keyring /var/lib/ceph/bootstrap-osd/{cluster}.keyring -n client.bootstrap-osd osd tree -f json".format(
+            osd_id=osd_id,
             cluster=node["cluster_name"]
         )
         output = json.loads(host.check_output(cmd))