1
# Copyright 2020 The CubeFS Authors.
3
# Licensed under the Apache License, Version 2.0 (the "License");
4
# you may not use this file except in compliance with the License.
5
# You may obtain a copy of the License at
7
# http://www.apache.org/licenses/LICENSE-2.0
9
# Unless required by applicable law or agreed to in writing, software
10
# distributed under the License is distributed on an "AS IS" BASIS,
11
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12
# implied. See the License for the specific language governing
13
# permissions and limitations under the License.
15
# -*- coding: utf-8 -*-
19
from base import S3TestCase, get_env_s3_client
23
class AclTest(S3TestCase):
26
def __init__(self, case):
27
super(AclTest, self).__init__(case)
28
self.s3 = get_env_s3_client()
30
def test_bucket_acl(self):
32
url=env.MASTER + '/client/vol?name=%s' % env.BUCKET,
34
'Skip-Owner-Validation': 'true'
36
content = json.loads(resp.content.decode())
37
OWNER = content['data']['Owner']
43
'Type': 'CanonicalUser'
45
'Permission': 'FULL_CONTROL'
53
# Put bucket acl configuration
54
self.assert_result_status_code(
55
result=self.s3.put_bucket_acl(Bucket=env.BUCKET, AccessControlPolicy=ACL))
56
# Get bucket acl configuration
57
self.assert_get_bucket_acl_result(
58
result=self.s3.get_bucket_acl(Bucket=env.BUCKET), acl=ACL)