From 7cb750c4cc5dec31cafbcd963e8ebb2e4752f3aa Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Mon, 10 Mar 2014 00:22:11 -0700 Subject: [PATCH] radosgw-admin: test data sync with more than max-entries objects For now hard code the max-entries for the radosgw-agent, since this is the only test that is affected by it. Signed-off-by: Josh Durgin --- teuthology/task/radosgw-admin.py | 38 ++++++++++++++++++++++++++++++++ teuthology/task/radosgw-agent.py | 1 + 2 files changed, 39 insertions(+) diff --git a/teuthology/task/radosgw-admin.py b/teuthology/task/radosgw-admin.py index 858726873b..ae82c84e44 100644 --- a/teuthology/task/radosgw-admin.py +++ b/teuthology/task/radosgw-admin.py @@ -457,6 +457,44 @@ def task(ctx, config): # finally we delete the bucket bucket.delete() + bucket = connection.create_bucket(bucket_name + 'data2') + for agent_client, c_config in ctx.radosgw_agent.config.iteritems(): + source_client = c_config['src'] + dest_client = c_config['dest'] + (dest_host, dest_port) = ctx.rgw.role_endpoints[dest_client] + dest_connection = boto.s3.connection.S3Connection( + aws_access_key_id=access_key, + aws_secret_access_key=secret_key, + is_secure=False, + port=dest_port, + host=dest_host, + calling_format=boto.s3.connection.OrdinaryCallingFormat(), + ) + for i in range(20): + k = boto.s3.key.Key(bucket) + k.key = 'tiny_file_' + str(i) + k.set_contents_from_string(str(i) * 100) + + time.sleep(rgw_utils.radosgw_data_log_window(ctx, source_client)) + rgw_utils.radosgw_agent_sync_all(ctx, data=True) + + for i in range(20): + dest_k = dest_connection.get_bucket(bucket_name + 'data2').get_key('tiny_file_' + str(i)) + assert (str(i) * 100) == dest_k.get_contents_as_string() + k = boto.s3.key.Key(bucket) + k.key = 'tiny_file_' + str(i) + k.delete() + + # check that deleting removes the objects from the dest zone + time.sleep(rgw_utils.radosgw_data_log_window(ctx, source_client)) + rgw_utils.radosgw_agent_sync_all(ctx, data=True) + + for i in range(20): + dest_bucket = dest_connection.get_bucket(bucket_name + 'data2') + dest_k = dest_bucket.get_key('tiny_file_' + str(i)) + assert dest_k == None, 'object %d not deleted from destination zone' % i + bucket.delete() + # end of 'if multi_region_run:' # TESTCASE 'suspend-ok','user','suspend','active user','succeeds' diff --git a/teuthology/task/radosgw-agent.py b/teuthology/task/radosgw-agent.py index 3807d8308e..1d8bdec930 100644 --- a/teuthology/task/radosgw-agent.py +++ b/teuthology/task/radosgw-agent.py @@ -87,6 +87,7 @@ def run_radosgw_agent(ctx, config): '--source', "http://{addr}:{port}".format(addr=src_host, port=src_port), '--dest-access-key', dest_access, '--dest-secret-key', dest_secret, + '--max-entries', '10', '--log-file', '{tdir}/archive/rgw_sync_agent.{client}.log'.format( tdir=testdir, client=client), -- 2.39.5