]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/rgw: add multisite test_set_bucket_policy 15736/head
authorCasey Bodley <cbodley@redhat.com>
Fri, 16 Jun 2017 18:14:28 +0000 (14:14 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 16 Jun 2017 18:44:51 +0000 (14:44 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/test/rgw/rgw_multi/tests.py

index 58426dfbfe1b8083bc98660a76e4873fd8d0bf37..90ddb83cd7665a267a169f10488f90768756c13c 100644 (file)
@@ -802,4 +802,17 @@ def test_set_bucket_website():
         except boto.exception.S3ResponseError as e:
             if e.error_code == 'MethodNotAllowed':
                 raise SkipTest("test_set_bucket_website skipped. Requires rgw_enable_static_website = 1.")
-        assert(bucket.get_website_configuration_with_xml()[1] == website_cfg.to_xml())
\ No newline at end of file
+        assert(bucket.get_website_configuration_with_xml()[1] == website_cfg.to_xml())
+
+def test_set_bucket_policy():
+    policy = '''{
+  "Version": "2012-10-17",
+  "Statement": [{
+    "Effect": "Allow",
+    "Principal": "*"
+  }]
+}'''
+    buckets, zone_bucket = create_bucket_per_zone_in_realm()
+    for _, bucket in zone_bucket:
+        bucket.set_policy(policy)
+        assert(bucket.get_policy() == policy)