From: Nathan Cutler Date: Tue, 22 Oct 2019 14:45:04 +0000 (+0200) Subject: qa/tasks/ceph.py: fail test if osd devices not found X-Git-Tag: v14.2.10~115^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b6c45d409c3b00ee958cc168609fdf277b16b6b2;p=ceph.git qa/tasks/ceph.py: fail test if osd devices not found Fixes: https://tracker.ceph.com/issues/42357 Signed-off-by: Nathan Cutler (cherry picked from commit bc76b39a30ba1301132b14dd65f0f9ee935c508b) --- diff --git a/qa/tasks/ceph.py b/qa/tasks/ceph.py index 09ca4972bcf7a..78ef51ee6a11b 100644 --- a/qa/tasks/ceph.py +++ b/qa/tasks/ceph.py @@ -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()