[#219] Add bucket/container listing check in multipart test case
This commit is contained in:
parent
370c1059f1
commit
048f713f3f
1 changed files with 17 additions and 1 deletions
|
@ -17,13 +17,18 @@ class TestS3GateMultipart(ClusterTestBase):
|
||||||
|
|
||||||
@allure.title("Object Multipart API (s3_client={s3_client})")
|
@allure.title("Object Multipart API (s3_client={s3_client})")
|
||||||
@pytest.mark.parametrize("versioning_status", [VersioningStatus.ENABLED], indirect=True)
|
@pytest.mark.parametrize("versioning_status", [VersioningStatus.ENABLED], indirect=True)
|
||||||
def test_s3_object_multipart(self, s3_client: S3ClientWrapper, bucket: str):
|
def test_s3_object_multipart(self, s3_client: S3ClientWrapper, bucket: str, default_wallet: str):
|
||||||
parts_count = 5
|
parts_count = 5
|
||||||
file_name_large = generate_file(PART_SIZE * parts_count) # 5Mb - min part
|
file_name_large = generate_file(PART_SIZE * parts_count) # 5Mb - min part
|
||||||
object_key = s3_helper.object_key_from_file_path(file_name_large)
|
object_key = s3_helper.object_key_from_file_path(file_name_large)
|
||||||
part_files = split_file(file_name_large, parts_count)
|
part_files = split_file(file_name_large, parts_count)
|
||||||
parts = []
|
parts = []
|
||||||
|
|
||||||
|
with allure.step(f"Get related container_id for bucket"):
|
||||||
|
for cluster_node in self.cluster.cluster_nodes:
|
||||||
|
container_id = search_container_by_name(bucket, cluster_node)
|
||||||
|
if container_id:
|
||||||
|
break
|
||||||
with allure.step("Upload first part"):
|
with allure.step("Upload first part"):
|
||||||
upload_id = s3_client.create_multipart_upload(bucket, object_key)
|
upload_id = s3_client.create_multipart_upload(bucket, object_key)
|
||||||
uploads = s3_client.list_multipart_uploads(bucket)
|
uploads = s3_client.list_multipart_uploads(bucket)
|
||||||
|
@ -48,6 +53,17 @@ class TestS3GateMultipart(ClusterTestBase):
|
||||||
got_object = s3_client.get_object(bucket, object_key)
|
got_object = s3_client.get_object(bucket, object_key)
|
||||||
assert get_file_hash(got_object) == get_file_hash(file_name_large)
|
assert get_file_hash(got_object) == get_file_hash(file_name_large)
|
||||||
|
|
||||||
|
with allure.step("Delete the object"):
|
||||||
|
s3_client.delete_object(bucket, object_key)
|
||||||
|
|
||||||
|
with allure.step("List objects in the bucket, expect to be empty"):
|
||||||
|
objects_list = s3_client.list_objects(bucket)
|
||||||
|
assert not objects_list, f"Expected empty bucket, got {objects_list}"
|
||||||
|
|
||||||
|
with allure.step("List objects in the container via rpc, expect to be empty"):
|
||||||
|
objects = list_objects(default_wallet, self.shell, container_id, self.cluster.default_rpc_endpoint)
|
||||||
|
assert len(objects) == 0, f"Expected no objects in container, got\n{objects}"
|
||||||
|
|
||||||
@allure.title("Abort Multipart Upload (s3_client={s3_client})")
|
@allure.title("Abort Multipart Upload (s3_client={s3_client})")
|
||||||
@pytest.mark.parametrize("versioning_status", [VersioningStatus.ENABLED], indirect=True)
|
@pytest.mark.parametrize("versioning_status", [VersioningStatus.ENABLED], indirect=True)
|
||||||
def test_s3_abort_multipart(
|
def test_s3_abort_multipart(
|
||||||
|
|
Loading…
Reference in a new issue