From: Casey Bodley Date: Thu, 26 Jul 2018 19:43:23 +0000 (-0400) Subject: qa/rgw: fix 'policy show' tests in radosgw_admin_rest task X-Git-Tag: v14.0.1~707^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b696c8493cc673c97ed92c019896186feb9f840a;p=ceph.git 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 --- diff --git a/qa/tasks/radosgw_admin_rest.py b/qa/tasks/radosgw_admin_rest.py index dfd76b3792bd..e802632d6cdc 100644 --- a/qa/tasks/radosgw_admin_rest.py +++ b/qa/tasks/radosgw_admin_rest.py @@ -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)