]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tasks/ceph: make cephfs_setup() cluster-aware
authorJosh Durgin <jdurgin@redhat.com>
Fri, 18 Mar 2016 03:06:44 +0000 (20:06 -0700)
committerJosh Durgin <jdurgin@redhat.com>
Fri, 20 May 2016 18:08:52 +0000 (11:08 -0700)
Note that cephfs tests using the Filesystem abstractions will need to
be converted to understand multiple clusters later. This just updates
the ceph task portion.

Signed-off-by: Josh Durgin <jdurgin@redhat.com>
(cherry picked from commit b0dd04736eed2822d1584eb8f6f7839e7f02ffc9)

tasks/ceph.py

index 1329261fc8dfd4a3ccff6f9d3e245c0743376979..3c67f4266ff5419d12756eea229019c5e72de88e 100644 (file)
@@ -272,22 +272,23 @@ def crush_setup(ctx, config):
 
 @contextlib.contextmanager
 def cephfs_setup(ctx, config):
+    cluster_name = config['cluster']
     testdir = teuthology.get_testdir(ctx)
     coverage_dir = '{tdir}/archive/coverage'.format(tdir=testdir)
 
-    first_mon = teuthology.get_first_mon(ctx, config)
+    first_mon = teuthology.get_first_mon(ctx, config, cluster_name)
     (mon_remote,) = ctx.cluster.only(first_mon).remotes.iterkeys()
-    mdss = ctx.cluster.only(teuthology.is_type('mds'))
+    mdss = ctx.cluster.only(teuthology.is_type('mds', cluster_name))
     # If there are any MDSs, then create a filesystem for them to use
     # Do this last because requires mon cluster to be up and running
     if mdss.remotes:
         log.info('Setting up CephFS filesystem...')
 
-        ceph_fs = Filesystem(ctx)
+        ceph_fs = Filesystem(ctx) # TODO: make Filesystem cluster-aware
         if not ceph_fs.legacy_configured():
             ceph_fs.create()
 
-        is_active_mds = lambda role: role.startswith('mds.') and not role.endswith('-s') and role.find('-s-') == -1
+        is_active_mds = lambda role: 'mds.' in role and not role.endswith('-s') and '-s-' not in role
         all_roles = [item for remote_roles in mdss.remotes.values() for item in remote_roles]
         num_active = len([r for r in all_roles if is_active_mds(r)])
         mon_remote.run(
@@ -306,6 +307,7 @@ def cephfs_setup(ctx, config):
             'ceph-coverage',
             coverage_dir,
             'ceph',
+            '--cluster', cluster_name,
             'mds', 'set_max_mds', str(num_active)])
 
     yield