From 02ee15041a9a1c66edfc9ebcdff66a43a1b75cc2 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Fri, 30 Sep 2022 12:28:28 -0400 Subject: [PATCH] add test_object_copy_16m to test refcounting of tail objects i don't think any of our CopyObj test cases were large enough to have tail objects, so weren't exercising our tail object ref counting strategy Signed-off-by: Casey Bodley (cherry picked from commit defb8eb9778a338d855d8fa8aa3e8f8b1b468630) --- s3tests_boto3/functional/test_s3.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/s3tests_boto3/functional/test_s3.py b/s3tests_boto3/functional/test_s3.py index 0bd901b..20ae4f1 100644 --- a/s3tests_boto3/functional/test_s3.py +++ b/s3tests_boto3/functional/test_s3.py @@ -6287,6 +6287,23 @@ def test_object_copy_zero_size(): response = client.get_object(Bucket=bucket_name, Key='bar321foo') eq(response['ContentLength'], 0) +@attr(resource='object') +@attr(method='put') +@attr(operation='copy 16mb object in same bucket') +@attr(assertion='works') +@attr('fails_on_dbstore') +def test_object_copy_16m(): + bucket_name = get_new_bucket() + key1 = 'obj1' + client = get_client() + client.put_object(Bucket=bucket_name, Key=key1, Body=bytearray(16*1024*1024)) + + copy_source = {'Bucket': bucket_name, 'Key': key1} + key2 = 'obj2' + client.copy_object(Bucket=bucket_name, Key=key2, CopySource=copy_source) + response = client.get_object(Bucket=bucket_name, Key=key2) + eq(response['ContentLength'], 16*1024*1024) + @attr(resource='object') @attr(method='put') @attr(operation='copy object in same bucket')