Adopt teardown for S3 services without versioning support #1

Open
opened 2023-07-18 09:53:05 +00:00 by alexvanin · 0 comments
Owner

If S3 server does not support versioning, then teardown fails on every test. Teardown uses client.list_object_versions which throws exception on S3 servers without versioning support.

s3tests_boto3/functional/init.py#L103

s3tests_boto3/functional/__init__.py:320:                                                                                                                                                                                                                                                                                                                   
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _                                                                                                                                                                                                                                                                             
s3tests_boto3/functional/__init__.py:290: in teardown                                                                                                                                                                                                                                                                                                       
    nuke_prefixed_buckets(prefix=prefix)                                                                                                                                      
s3tests_boto3/functional/__init__.py:164: in nuke_prefixed_buckets                                                                                                            
    raise err                                                                                                                                                                                                                                                                                                                                               
s3tests_boto3/functional/__init__.py:155: in nuke_prefixed_buckets                                                                                                                                                                                                                                                                                          
    nuke_bucket(client, bucket_name)                                                                                                                                          
s3tests_boto3/functional/__init__.py:108: in nuke_bucket                                                                                                                      
    for objects in list_versions(client, bucket, batch_size):                                                                                                                 
s3tests_boto3/functional/__init__.py:93: in list_versions                                                                                                                     
    MaxKeys=batch_size)                                                                                                                                                                                                                                                                                                                                     
.tox/py/lib/python3.7/site-packages/botocore/client.py:530: in _api_call                                                                                                                                                                                                                                                                                    
    return self._make_api_call(operation_name, kwargs)
...
        if http.status_code >= 300:
            error_code = parsed_response.get("Error", {}).get("Code")
            error_class = self.exceptions.from_code(error_code)
>           raise error_class(parsed_response, operation_name)
E           botocore.exceptions.ClientError: An error occurred (NotImplemented) when calling the ListObjectVersions operation: Subresources not implemented

Teardown might be a bit smarter and use list_objects if bucket versioning is disabled.

If S3 server does not support versioning, then teardown fails on every test. Teardown uses client.list_object_versions which throws exception on S3 servers without versioning support. [s3tests_boto3/functional/__init__.py#L103]( https://git.frostfs.info/TrueCloudLab/s3-tests/src/commit/73b340a0e2042d48753f16e0c9bc050040af27cc/s3tests_boto3/functional/__init__.py#L103) ``` s3tests_boto3/functional/__init__.py:320: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ s3tests_boto3/functional/__init__.py:290: in teardown nuke_prefixed_buckets(prefix=prefix) s3tests_boto3/functional/__init__.py:164: in nuke_prefixed_buckets raise err s3tests_boto3/functional/__init__.py:155: in nuke_prefixed_buckets nuke_bucket(client, bucket_name) s3tests_boto3/functional/__init__.py:108: in nuke_bucket for objects in list_versions(client, bucket, batch_size): s3tests_boto3/functional/__init__.py:93: in list_versions MaxKeys=batch_size) .tox/py/lib/python3.7/site-packages/botocore/client.py:530: in _api_call return self._make_api_call(operation_name, kwargs) ... if http.status_code >= 300: error_code = parsed_response.get("Error", {}).get("Code") error_class = self.exceptions.from_code(error_code) > raise error_class(parsed_response, operation_name) E botocore.exceptions.ClientError: An error occurred (NotImplemented) when calling the ListObjectVersions operation: Subresources not implemented ``` Teardown might be a bit smarter and use list_objects if bucket versioning is disabled.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/s3-tests#1
No description provided.