From: Josh Durgin Date: Mon, 10 Mar 2014 07:16:28 +0000 (-0700) Subject: radosgw-admin: ignore 301 test against the same src and dest regions X-Git-Tag: 1.1.0~1599 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=a74cf330894922f3a53f6cdaab4c457e18f586ec;p=teuthology.git radosgw-admin: ignore 301 test against the same src and dest regions Signed-off-by: Josh Durgin --- diff --git a/teuthology/task/radosgw-admin.py b/teuthology/task/radosgw-admin.py index 65dc5c6e42..64b2f9ed96 100644 --- a/teuthology/task/radosgw-admin.py +++ b/teuthology/task/radosgw-admin.py @@ -249,10 +249,20 @@ def task(ctx, config): del out2['data']['bucket_info']['bucket']['index_pool'] assert out1 == out2 + same_region = 0 for agent_client, c_config in ctx.radosgw_agent.config.iteritems(): source_client = c_config['src'] dest_client = c_config['dest'] + source_region = rgw_utils.region_for_client(ctx, source_client) + dest_region = rgw_utils.region_for_client(ctx, dest_client) + + # 301 is only returned for requests to something in a different region + if source_region == dest_region: + log.debug('301 is only returned for requests to something in a different region') + same_region += 1 + continue + # Attempt to create a new connection with user1 to the destination RGW log.debug('Attempt to create a new connection with user1 to the destination RGW') # and use that to attempt a delete (that should fail) @@ -282,6 +292,10 @@ def task(ctx, config): bucket.delete() rgw_utils.radosgw_agent_sync_all(ctx) + if same_region == len(ctx.radosgw_agent.config): + bucket.delete() + rgw_utils.radosgw_agent_sync_all(ctx) + # make sure that the bucket no longer exists in either region log.debug('make sure that the bucket no longer exists in either region') for agent_client, c_config in ctx.radosgw_agent.config.iteritems(): @@ -387,6 +401,9 @@ def task(ctx, config): log.debug('now we delete the bucket') bucket.delete() + log.debug('sync to propagate the deleted bucket') + rgw_utils.radosgw_agent_sync_all(ctx) + # Delete user2 as later tests do not expect it to exist. # Verify that it is gone on both regions for agent_client, c_config in ctx.radosgw_agent.config.iteritems():