]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Detect multi-region test cases
authorJoe Buck <jbbuck@gmail.com>
Thu, 15 Aug 2013 19:51:51 +0000 (12:51 -0700)
committerJoe Buck <jbbuck@gmail.com>
Fri, 16 Aug 2013 16:09:46 +0000 (09:09 -0700)
Enable multi-region calls and tests only if
the configuration has specified a
radosgw-agent tastk.

Signed-off-by: Joe Buck <jbbuck@gmail.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
teuthology/task/radosgw-admin.py
teuthology/task/radosgw-agent.py

index 090c4fec39c72aa53e69ca7a12134bd9c9ac79d0..0a385c8f817e9446946b2ad930fc709a6884d931 100644 (file)
@@ -28,6 +28,12 @@ def successful_ops(out):
     entry = summary[0]
     return entry['total']['successful_ops']
 
+# simple test to indicate if multi-region testing should occur
+def multi_region_enabled(ctx):
+    # this is populated by the radosgw_agent task, seems reasonable to use that as an indicator that
+    # we're testing multi-region sync 
+    return 'radosgw_agent' in ctx
+
 def task(ctx, config):
     """
     Test radosgw-admin functionality against a running rgw instance.
@@ -43,11 +49,11 @@ def task(ctx, config):
         config = dict.fromkeys(config)
     clients = config.keys()
 
-    client = rgw_utils.get_master_client(ctx, clients)
+    multi_region_run = multi_region_enabled(ctx)
 
-    if not client:
-        # oh, well, just use the first client... multiregion stuff might not work correctly
-        client = clients[0];
+    client = clients[0]; # default choice, multi-region code may overwrite this
+    if multi_region_run:
+        client = rgw_utils.get_master_client(ctx, clients)
 
     ##
     user1='foo'
@@ -220,7 +226,8 @@ def task(ctx, config):
     assert not err
     assert len(out) == 0
 
-    rgw_utils.radosgw_agent_sync_all(ctx)
+    if multi_region_run:
+        rgw_utils.radosgw_agent_sync_all(ctx)
 
     # connect to rgw
     (remote,) = ctx.cluster.only(client).remotes.iterkeys()
index 7e5ca1c14c6080cef0c4937c5cc28514df2d9045..19105ad4877daf7c3dfd09289736097fab84153d 100644 (file)
@@ -167,6 +167,7 @@ def task(ctx, config):
             teuthology.deep_merge(config[client], overrides.get('radosgw-agent', {}))
 
     ctx.radosgw_agent = argparse.Namespace()
+    ctx.radosgw_agent.config = config
 
     procs = run_radosgw_agent(ctx, config)