mirror of
https://github.com/ceph/s3-tests.git
synced 2024-11-21 23:29:47 +00:00
boto3/test_s3: add ranges around part boundary for encryption tests
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
(cherry picked from commit 00cdcaf056
)
This commit is contained in:
parent
7682983704
commit
610192c033
1 changed files with 9 additions and 1 deletions
|
@ -9326,6 +9326,7 @@ def test_encryption_sse_c_multipart_upload():
|
|||
key = "multipart_enc"
|
||||
content_type = 'text/plain'
|
||||
objlen = 30 * 1024 * 1024
|
||||
partlen = 5*1024*1024
|
||||
metadata = {'foo': 'bar'}
|
||||
enc_headers = {
|
||||
'x-amz-server-side-encryption-customer-algorithm': 'AES256',
|
||||
|
@ -9336,7 +9337,7 @@ def test_encryption_sse_c_multipart_upload():
|
|||
resend_parts = []
|
||||
|
||||
(upload_id, data, parts) = _multipart_upload_enc(client, bucket_name, key, objlen,
|
||||
part_size=5*1024*1024, init_headers=enc_headers, part_headers=enc_headers, metadata=metadata, resend_parts=resend_parts)
|
||||
part_size=partlen, init_headers=enc_headers, part_headers=enc_headers, metadata=metadata, resend_parts=resend_parts)
|
||||
|
||||
lf = (lambda **kwargs: kwargs['params']['headers'].update(enc_headers))
|
||||
client.meta.events.register('before-call.s3.CompleteMultipartUpload', lf)
|
||||
|
@ -9362,6 +9363,8 @@ def test_encryption_sse_c_multipart_upload():
|
|||
|
||||
_check_content_using_range_enc(client, bucket_name, key, data, size, 1000000, enc_headers=enc_headers)
|
||||
_check_content_using_range_enc(client, bucket_name, key, data, size, 10000000, enc_headers=enc_headers)
|
||||
for i in range(-1,2):
|
||||
_check_content_using_range_enc(client, bucket_name, key, data, size, partlen + i, enc_headers=enc_headers)
|
||||
|
||||
@pytest.mark.encryption
|
||||
def test_encryption_sse_c_unaligned_multipart_upload():
|
||||
|
@ -9405,6 +9408,11 @@ def test_encryption_sse_c_unaligned_multipart_upload():
|
|||
size = response['ContentLength']
|
||||
assert len(body) == size
|
||||
|
||||
_check_content_using_range_enc(client, bucket_name, key, data, size, 1000000, enc_headers=enc_headers)
|
||||
_check_content_using_range_enc(client, bucket_name, key, data, size, 10000000, enc_headers=enc_headers)
|
||||
for i in range(-1,2):
|
||||
_check_content_using_range_enc(client, bucket_name, key, data, size, partlen + i, enc_headers=enc_headers)
|
||||
|
||||
@pytest.mark.encryption
|
||||
# TODO: remove this fails_on_rgw when I fix it
|
||||
@pytest.mark.fails_on_rgw
|
||||
|
|
Loading…
Reference in a new issue