From b696c8493cc673c97ed92c019896186feb9f840a Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Thu, 26 Jul 2018 15:43:23 -0400 Subject: [PATCH] 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 --- qa/tasks/radosgw_admin_rest.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/qa/tasks/radosgw_admin_rest.py b/qa/tasks/radosgw_admin_rest.py index dfd76b3792b..e802632d6cd 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)