]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/ceph.py: fail test if osd devices not found 34256/head
authorNathan Cutler <ncutler@suse.com>
Tue, 22 Oct 2019 14:45:04 +0000 (16:45 +0200)
committerNathan Cutler <ncutler@suse.com>
Tue, 14 Apr 2020 16:15:55 +0000 (18:15 +0200)
Fixes: https://tracker.ceph.com/issues/42357
Signed-off-by: Nathan Cutler <ncutler@suse.com>
(cherry picked from commit bc76b39a30ba1301132b14dd65f0f9ee935c508b)

qa/tasks/ceph.py

index 09ca4972bcf7acdbc7e70105db8320ca57ad869d..78ef51ee6a11b54c79b5a21734e1d8d3735754af 100644 (file)
@@ -605,16 +605,17 @@ def cluster(ctx, config):
     osds = ctx.cluster.only(teuthology.is_type('osd', cluster_name))
     for remote, roles_for_host in osds.remotes.iteritems():
         devs = teuthology.get_scratch_devices(remote)
-        roles_to_devs = {}
-        if config.get('fs'):
-            log.info('fs option selected, checking for "scratch" (osd) devs')
-            log.info('found "scratch" (osd) devs: {}'.format(devs))
-            roles_to_devs = assign_devs(
-                teuthology.cluster_roles_of_type(roles_for_host, 'osd', cluster_name), devs
-            )
-            devs_to_clean[remote] = []
+        roles_to_devs = assign_devs(
+            teuthology.cluster_roles_of_type(roles_for_host, 'osd', cluster_name), devs
+        )
+        devs_to_clean[remote] = []
         log.info('osd dev map: {}'.format(roles_to_devs))
+        assert roles_to_devs, \
+            "remote {} has osd roles, but no osd devices were specified!".format(remote.hostname)
         remote_to_roles_to_devs[remote] = roles_to_devs
+    log.info("remote_to_roles_to_devs: {}".format(remote_to_roles_to_devs))
+    for osd_role, dev_name in remote_to_roles_to_devs.items():
+        assert dev_name, "{} has no associated device!".format(osd_role)
 
     log.info('Generating config...')
     remotes_and_roles = ctx.cluster.remotes.items()