]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa/rgw: fix 'policy show' tests in radosgw_admin_rest task
authorCasey Bodley <cbodley@redhat.com>
Thu, 26 Jul 2018 19:43:23 +0000 (15:43 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 27 Jul 2018 18:29:48 +0000 (14:29 -0400)
'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>
qa/tasks/radosgw_admin_rest.py

index dfd76b3792bdd955a686702c6ab3abd2669acb15..e802632d6cdc1c8184638e19911769d2cfab23d1 100644 (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)