Fix tests

Signed-off-by: Andrey Berezin <a.berezin@yadro.com>
This commit is contained in:
Andrey Berezin 2023-05-15 20:20:27 +03:00
parent c77123f301
commit 8a3d617c19
2 changed files with 6 additions and 6 deletions

View file

@ -51,7 +51,7 @@ def user_container(
endpoint=cluster.default_rpc_endpoint, endpoint=cluster.default_rpc_endpoint,
) )
# Deliberately using s3gate wallet here to test bearer token # Deliberately using s3gate wallet here to test bearer token
s3gate = cluster.s3gates[0] s3gate = cluster.s3_gates[0]
return StorageContainer( return StorageContainer(
StorageContainerInfo(container_id, WalletInfo.from_node(s3gate)), StorageContainerInfo(container_id, WalletInfo.from_node(s3gate)),
client_shell, client_shell,
@ -106,7 +106,7 @@ class TestObjectApiWithBearerToken(ClusterTestBase):
f"Object can be deleted from any node using s3gate wallet with bearer token for {request.node.callspec.id}" f"Object can be deleted from any node using s3gate wallet with bearer token for {request.node.callspec.id}"
) )
s3_gate_wallet = self.cluster.s3gates[0] s3_gate_wallet = self.cluster.s3_gates[0]
with allure.step("Try to delete each object from first storage node"): with allure.step("Try to delete each object from first storage node"):
for storage_object in storage_objects: for storage_object in storage_objects:
with expect_not_raises(): with expect_not_raises():
@ -142,7 +142,7 @@ class TestObjectApiWithBearerToken(ClusterTestBase):
f"Object can be fetched from any node using s3gate wallet with bearer token for {request.node.callspec.id}" f"Object can be fetched from any node using s3gate wallet with bearer token for {request.node.callspec.id}"
) )
s3_gate_wallet = self.cluster.s3gates[0] s3_gate_wallet = self.cluster.s3_gates[0]
with allure.step("Put one object to container"): with allure.step("Put one object to container"):
epoch = self.get_epoch() epoch = self.get_epoch()
storage_object = user_container.generate_object( storage_object = user_container.generate_object(

View file

@ -925,7 +925,7 @@ class TestS3GateObject:
obj_head.get("Metadata") == object_metadata obj_head.get("Metadata") == object_metadata
), f"Metadata of object is {object_metadata}" ), f"Metadata of object is {object_metadata}"
# Uncomment after https://github.com/nspcc-dev/neofs-s3-gw/issues/685 is solved # Uncomment after https://github.com/nspcc-dev/neofs-s3-gw/issues/685 is solved
# obj_acl = s3_client.get_object_acl(self.s3_client, bucket, obj_key) # obj_acl = s3_client.get_object_acl(bucket, obj_key)
# s3_helper.assert_s3_acl(acl_grants = obj_acl, permitted_users = "AllUsers") # s3_helper.assert_s3_acl(acl_grants = obj_acl, permitted_users = "AllUsers")
@allure.title("Test S3 Put 10 nested level object") @allure.title("Test S3 Put 10 nested level object")
@ -976,8 +976,8 @@ class TestS3GateObject:
s3_client.put_object(bucket, file_path) s3_client.put_object(bucket, file_path)
with allure.step("Delete the object from the bucket"): with allure.step("Delete the object from the bucket"):
delete_object = s3_client.delete_object(s3_client, bucket, file_name) delete_object = s3_client.delete_object(bucket, file_name)
versions = s3_client.list_objects_versions(s3_client, bucket) versions = s3_client.list_objects_versions(bucket)
obj_versions = { obj_versions = {
version.get("VersionId") for version in versions if version.get("Key") == file_name version.get("VersionId") for version in versions if version.get("Key") == file_name