qa/rgw: fix 'policy show' tests in radosgw_admin_rest task

'policy show' returns a json-encoded representation of
RGWAccessControlPolicy, while key.get_xml_acl() returns
RGWAccessControlPolicy_S3 encoded as xml. so even with '&format=xml',
the strings won't match

Signed-off-by: Casey Bodley <cbodley@redhat.com>
This commit is contained in:
Casey Bodley 2018-07-26 15:43:23 -04:00
parent 638fa1de42
commit b696c8493c

View File

@ -591,18 +591,14 @@ def task(ctx, config):
(ret, out) = rgwadmin_rest(admin_conn, ['policy', 'show'], {'bucket' : bucket.name, 'object' : key.key})
assert ret == 200
acl = key.get_xml_acl()
assert acl == out.strip('\n')
assert len(out['acl']['grant_map']) == 1
# add another grantee by making the object public read
key.set_acl('public-read')
(ret, out) = rgwadmin_rest(admin_conn, ['policy', 'show'], {'bucket' : bucket.name, 'object' : key.key})
assert ret == 200
acl = key.get_xml_acl()
assert acl == out.strip('\n')
assert len(out['acl']['grant_map']) == 2
# TESTCASE 'rm-bucket', 'bucket', 'rm', 'bucket with objects', 'succeeds'
bucket = connection.create_bucket(bucket_name)