From: Christophe Courtaut Date: Thu, 10 Oct 2013 10:28:46 +0000 (+0200) Subject: Adds radosgw-agent small file sync test X-Git-Tag: 1.1.0~1605 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4d3c1a19974ffd9f8f313cb6526e2fb43581934e;p=teuthology.git Adds radosgw-agent small file sync test Signed-off-by: Christophe Courtaut --- diff --git a/teuthology/task/radosgw-admin.py b/teuthology/task/radosgw-admin.py index e5945bf42..dd55f53d1 100644 --- a/teuthology/task/radosgw-admin.py +++ b/teuthology/task/radosgw-admin.py @@ -376,6 +376,34 @@ def task(ctx, config): (err, out) = rgwadmin(ctx, dest_client, ['user', 'info', '--uid', user2]) assert out is None + # Test data sync + + # First create a bucket for data sync test purpose + bucket = connection.create_bucket(bucket_name + 'data') + + # Create a tiny file and check if in sync + for agent_client, c_config in ctx.radosgw_agent.config.iteritems(): + source_client = c_config['src'] + dest_client = c_config['dest'] + k = boto.s3.key.Key(bucket) + k.Key = 'tiny_file' + k.set_contents_from_string("123456789") + rgw_utils.radosgw_agent_sync_all(ctx, data=True) + (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(), + ) + dest_k = dest_connection.get_bucket(bucket_name + 'data').lookup('tiny_file') + assert k.get_contents() == dest_k.get_contents() + + # finally we delete the bucket + bucket.delete() + # end of 'if multi_region_run:' # TESTCASE 'suspend-ok','user','suspend','active user','succeeds'