Fixed typo in test_s3_delete_versioning case assertion #47

Merged
ylukoyan merged 1 commit from ylukoyan/frostfs-testcases:typo into master 2023-05-25 15:58:05 +00:00

View file

@ -315,7 +315,7 @@ class TestS3GateObject:
version.get("VersionId") for version in versions if version.get("Key") == obj_key version.get("VersionId") for version in versions if version.get("Key") == obj_key
} }
assert obj_versions == {version_id_2}, f"Object should have versions: {version_id_2}" assert obj_versions == {version_id_2}, f"Object should have versions: {version_id_2}"
assert "DeleteMarkers" not in delete_obj.keys(), "Delete markers not found" assert "DeleteMarker" not in delete_obj.keys(), "Delete markers should not be created"
abereziny marked this conversation as resolved
Review

There is no DeleteMarker field in DeleteObject response, Delete Marker is returned as VersionId field.
https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html

According to https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectVersions.html
DeleteMarkers may be returned in List_Object_Version call.

And it is in the test results:

COMMAND: 'S3 List objects versions result'
OUTPUT:
{'ResponseMetadata': {'RequestId': '629cff54-020a-4632-980f-da468c80d499', 'HostId': '', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amz-request-id': '629cff54-020a-4632-980f-da468c80d499', 'date': 'Mon, 22 May 2023 04:40:40 GMT', 'content-length': '1029', 'content-type': 'text/xml; charset=utf-8'}, 'RetryAttempts': 0}, 'IsTruncated': False, 'KeyMarker': '', 'VersionIdMarker': '', 'Versions': [{'ETag': '78d5be015ffb4cf0a4da12f9f6dcf4eb898143910c6f90a9492bf0d243431966', 'Size': 201327592, 'Key': 'edd13d46-b134-4c63-89b5-0ae1f8ab390e', 'VersionId': 'C6rRavrqKXWGL17G8G8YqX3yx5886wgzrgAoyUhZLeVx', 'IsLatest': False, 'LastModified': datetime.datetime(2023, 5, 22, 4, 39, 4, tzinfo=tzlocal()), 'Owner': {'DisplayName': 'NajEagWVc43VD6A6oHspof6CN8sVf8m3XB', 'ID': 'NajEagWVc43VD6A6oHspof6CN8sVf8m3XB'}}], 'DeleteMarkers': [{'Owner': {'DisplayName': 'NajEagWVc43VD6A6oHspof6CN8sVf8m3XB', 'ID': 'NajEagWVc43VD6A6oHspof6CN8sVf8m3XB'}, 'Key': 'edd13d46-b134-4c63-89b5-0ae1f8ab390e', 'VersionId': 'AMZmZ9gtZXGriAtorkctp6TJC1B7EN2EtQ4crpwAzYhk', 'IsLatest': True, 'LastModified': datetime.datetime(2023, 5, 22, 4, 39, 9, tzinfo=tzlocal())}], 'Name': 'f7b6a53d-0143-48b2-812f-5af9a11c631f'}

Could you please clarify?

There is no `DeleteMarker` field in DeleteObject response, Delete Marker is returned as `VersionId` field. https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html According to https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectVersions.html `DeleteMarkers` may be returned in List_Object_Version call. And it is in the test results: ``` COMMAND: 'S3 List objects versions result' OUTPUT: {'ResponseMetadata': {'RequestId': '629cff54-020a-4632-980f-da468c80d499', 'HostId': '', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amz-request-id': '629cff54-020a-4632-980f-da468c80d499', 'date': 'Mon, 22 May 2023 04:40:40 GMT', 'content-length': '1029', 'content-type': 'text/xml; charset=utf-8'}, 'RetryAttempts': 0}, 'IsTruncated': False, 'KeyMarker': '', 'VersionIdMarker': '', 'Versions': [{'ETag': '78d5be015ffb4cf0a4da12f9f6dcf4eb898143910c6f90a9492bf0d243431966', 'Size': 201327592, 'Key': 'edd13d46-b134-4c63-89b5-0ae1f8ab390e', 'VersionId': 'C6rRavrqKXWGL17G8G8YqX3yx5886wgzrgAoyUhZLeVx', 'IsLatest': False, 'LastModified': datetime.datetime(2023, 5, 22, 4, 39, 4, tzinfo=tzlocal()), 'Owner': {'DisplayName': 'NajEagWVc43VD6A6oHspof6CN8sVf8m3XB', 'ID': 'NajEagWVc43VD6A6oHspof6CN8sVf8m3XB'}}], 'DeleteMarkers': [{'Owner': {'DisplayName': 'NajEagWVc43VD6A6oHspof6CN8sVf8m3XB', 'ID': 'NajEagWVc43VD6A6oHspof6CN8sVf8m3XB'}, 'Key': 'edd13d46-b134-4c63-89b5-0ae1f8ab390e', 'VersionId': 'AMZmZ9gtZXGriAtorkctp6TJC1B7EN2EtQ4crpwAzYhk', 'IsLatest': True, 'LastModified': datetime.datetime(2023, 5, 22, 4, 39, 9, tzinfo=tzlocal())}], 'Name': 'f7b6a53d-0143-48b2-812f-5af9a11c631f'} ``` Could you please clarify?
Review

Clarified in DM

Clarified in DM
with allure.step("Delete second version of object"): with allure.step("Delete second version of object"):
delete_obj = s3_client.delete_object(bucket, obj_key, version_id=version_id_2) delete_obj = s3_client.delete_object(bucket, obj_key, version_id=version_id_2)
@ -324,7 +324,7 @@ class TestS3GateObject:
version.get("VersionId") for version in versions if version.get("Key") == obj_key version.get("VersionId") for version in versions if version.get("Key") == obj_key
} }
assert not obj_versions, "Expected object not found" assert not obj_versions, "Expected object not found"
assert "DeleteMarkers" not in delete_obj.keys(), "Delete markers not found" assert "DeleteMarker" not in delete_obj.keys(), "Delete markers should not be created"
with allure.step("Put new object into bucket"): with allure.step("Put new object into bucket"):
file_name_simple = generate_file(complex_object_size) file_name_simple = generate_file(complex_object_size)