[#200] Validate object get range hash with different nodes

Validate object get range hash with different nodes

Signed-off-by: Mikhail Kadilov m.kadilov@yadro.com
Mikhail Kadilov 2024-02-26 12:18:08 +03:00
parent ae9b6caf3d
commit e963c4200c
1 changed files with 14 additions and 13 deletions

View File

@ -463,29 +463,29 @@ class TestObjectApi(ClusterTestBase):
)
@allure.title("Trying to execute object get range hash command on node from container and node not from container")
def test_object_get_range_hash_with_different_nodes(self, default_wallet: str, object_size: ObjectSize):
def test_object_get_range_hash_with_different_nodes(self, default_wallet: str, object_size: ObjectSize, client_shell: Shell):
"""
Validate get range hash command with node from container and node not from container
"""
shell = client_shell
wallet = default_wallet
cid = create_container(wallet, self.shell, self.cluster.default_rpc_endpoint, self.PLACEMENT_RULE_1)
cid = create_container(wallet, shell, self.cluster.default_rpc_endpoint, self.PLACEMENT_RULE_1)
file_path = generate_file(object_size.value)
oid = put_object_to_random_node(wallet, file_path, cid, self.shell, self.cluster)
oid = put_object_to_random_node(wallet, file_path, cid, shell, self.cluster)
# taking node from container
nodes = search_nodes_with_container(
wallet=wallet,
cid=cid,
shell=self.shell,
shell=shell,
endpoint=self.cluster.default_rpc_endpoint,
cluster=self.cluster,
)
container_node = nodes[0]
range_cut="0:10"
with reporter.step("Execute command on container node"):
result = get_range_hash(wallet, cid, oid, range_cut, container_node.host, container_node.storage_node.get_rpc_endpoint)
result = get_range_hash(wallet, cid, oid, range_cut, container_node.host.get_shell(), container_node.storage_node.get_rpc_endpoint)
assert "object not found" not in result
@ -496,36 +496,37 @@ class TestObjectApi(ClusterTestBase):
break
range_cut="0:10"
with reporter.step("Execute command on not container node"):
result = get_range_hash(wallet, cid, oid, range_cut, not_container_node.host, not_container_node.storage_node.get_rpc_endpoint)
result = get_range_hash(wallet, cid, oid, range_cut, container_node.host.get_shell(), not_container_node.storage_node.get_rpc_endpoint)
assert "object not found" not in result
@allure.title("Trying to execute object get range hash command on node from container and node not from container")
def test_object_get_range_with_different_nodes(self, default_wallet: str, object_size: ObjectSize):
def test_object_get_range_with_different_nodes(self, default_wallet: str, object_size: ObjectSize, client_shell: Shell):
"""
Validate get range command with node from container and node not from container
"""
shell = client_shell
wallet = default_wallet
cid = create_container(wallet, self.shell, self.cluster.default_rpc_endpoint, self.PLACEMENT_RULE_1)
cid = create_container(wallet, shell, self.cluster.default_rpc_endpoint, self.PLACEMENT_RULE_1)
file_path = generate_file(object_size.value)
oid = put_object_to_random_node(wallet, file_path, cid, self.shell, self.cluster)
oid = put_object_to_random_node(wallet, file_path, cid, shell, self.cluster)
# taking node from container
nodes = search_nodes_with_container(
wallet=wallet,
cid=cid,
shell=self.shell,
shell=shell,
endpoint=self.cluster.default_rpc_endpoint,
cluster=self.cluster,
)
container_node = nodes[0]
range_cut="0:10"
with reporter.step("Execute command on container node"):
result = get_range(wallet, cid, oid, range_cut, container_node.host, self.cluster.default_rpc_endpoint)
result = get_range(wallet, cid, oid, range_cut, container_node.host.get_shell(), self.cluster.default_rpc_endpoint)
assert "object not found" not in result
# taking node NOT from container
@ -535,7 +536,7 @@ class TestObjectApi(ClusterTestBase):
break
range_cut="0:10"
with reporter.step("Execute command on not container node"):
result = get_range(wallet, cid, oid, range_cut, not_container_node.host, self.cluster.default_rpc_endpoint)
result = get_range(wallet, cid, oid, range_cut, container_node.host.get_shell(), self.cluster.default_rpc_endpoint)
assert "object not found" not in result
def check_header_is_presented(self, head_info: dict, object_header: dict) -> None: