[#186] Change call object nodes func

Signed-off-by: Dmitriy Zayakin <d.zayakin@yadro.com>
This commit is contained in:
Dmitriy Zayakin 2024-01-22 14:29:49 +03:00
parent f49d68a6e7
commit 0d7befe9a6
3 changed files with 14 additions and 29 deletions

View file

@ -7,7 +7,7 @@ import allure
import pytest import pytest
from frostfs_testlib import reporter from frostfs_testlib import reporter
from frostfs_testlib.healthcheck.interfaces import Healthcheck from frostfs_testlib.healthcheck.interfaces import Healthcheck
from frostfs_testlib.resources.wellknown_acl import PUBLIC_ACL from frostfs_testlib.resources.wellknown_acl import EACL_PUBLIC_READ_WRITE, PUBLIC_ACL
from frostfs_testlib.steps.cli.container import create_container from frostfs_testlib.steps.cli.container import create_container
from frostfs_testlib.steps.cli.object import ( from frostfs_testlib.steps.cli.object import (
get_object, get_object,
@ -88,6 +88,7 @@ class TestFailoverNetwork(ClusterTestBase):
endpoint=self.cluster.default_rpc_endpoint, endpoint=self.cluster.default_rpc_endpoint,
rule=placement_rule, rule=placement_rule,
await_mode=True, await_mode=True,
basic_acl=EACL_PUBLIC_READ_WRITE,
) )
storage_objects = [] storage_objects = []
@ -210,11 +211,9 @@ class TestFailoverNetwork(ClusterTestBase):
with reporter.step("Search nodes with object"): with reporter.step("Search nodes with object"):
nodes_with_object = get_object_nodes( nodes_with_object = get_object_nodes(
cluster=self.cluster, cluster=self.cluster,
wallet=default_wallet,
cid=storage_object.cid, cid=storage_object.cid,
oid=storage_object.oid, oid=storage_object.oid,
shell=self.shell, alive_node=self.cluster.cluster_nodes[0],
endpoint=self.cluster.default_rpc_endpoint,
) )
with reporter.step("Get data interface to node"): with reporter.step("Get data interface to node"):
@ -270,11 +269,9 @@ class TestFailoverNetwork(ClusterTestBase):
with reporter.step("Search nodes with object"): with reporter.step("Search nodes with object"):
nodes_with_object = get_object_nodes( nodes_with_object = get_object_nodes(
cluster=self.cluster, cluster=self.cluster,
wallet=default_wallet,
cid=storage_object.cid, cid=storage_object.cid,
oid=storage_object.oid, oid=storage_object.oid,
shell=self.shell, alive_node=self.cluster.cluster_nodes[0],
endpoint=self.cluster.default_rpc_endpoint,
) )
with reporter.step("Get internal interface to node"): with reporter.step("Get internal interface to node"):

View file

@ -156,12 +156,7 @@ class TestFailoverServer(ClusterTestBase):
) -> tuple[StorageObjectInfo, list[ClusterNode]]: ) -> tuple[StorageObjectInfo, list[ClusterNode]]:
object_info = container.generate_object(simple_object_size.value) object_info = container.generate_object(simple_object_size.value)
object_nodes = get_object_nodes( object_nodes = get_object_nodes(
cluster=self.cluster, cluster=self.cluster, cid=object_info.cid, oid=object_info.oid, alive_node=self.cluster.cluster_nodes[0]
wallet=default_wallet,
cid=object_info.cid,
oid=object_info.oid,
shell=self.shell,
endpoint=self.cluster.default_rpc_endpoint,
) )
return object_info, object_nodes return object_info, object_nodes
@ -313,12 +308,7 @@ class TestFailoverServer(ClusterTestBase):
) )
with reporter.step("Search nodes with object"): with reporter.step("Search nodes with object"):
object_nodes = get_object_nodes( object_nodes = get_object_nodes(
cluster=self.cluster, cluster=self.cluster, cid=cid_1, oid=oid, alive_node=self.cluster.cluster_nodes[0]
wallet=default_wallet,
cid=cid_1,
oid=oid,
shell=self.shell,
endpoint=self.cluster.default_rpc_endpoint,
) )
with reporter.step("Turn off random node with object"): with reporter.step("Turn off random node with object"):
cluster_state_controller.stop_node_host(node=random.choice(object_nodes[1:]), mode="hard") cluster_state_controller.stop_node_host(node=random.choice(object_nodes[1:]), mode="hard")

View file

@ -7,6 +7,7 @@ from frostfs_testlib import reporter
from frostfs_testlib.cli import FrostfsCli from frostfs_testlib.cli import FrostfsCli
from frostfs_testlib.resources.cli import CLI_DEFAULT_TIMEOUT from frostfs_testlib.resources.cli import CLI_DEFAULT_TIMEOUT
from frostfs_testlib.resources.common import DEFAULT_WALLET_CONFIG from frostfs_testlib.resources.common import DEFAULT_WALLET_CONFIG
from frostfs_testlib.resources.wellknown_acl import EACL_PUBLIC_READ_WRITE
from frostfs_testlib.steps.cli.container import create_container, delete_container from frostfs_testlib.steps.cli.container import create_container, delete_container
from frostfs_testlib.steps.cli.object import delete_object, get_object, get_object_nodes, put_object from frostfs_testlib.steps.cli.object import delete_object, get_object, get_object_nodes, put_object
from frostfs_testlib.storage.cluster import Cluster, ClusterNode, StorageNode from frostfs_testlib.storage.cluster import Cluster, ClusterNode, StorageNode
@ -52,21 +53,18 @@ class TestControlShard(ClusterTestBase):
def oid_cid_node(self, default_wallet: str) -> tuple[str, str, ClusterNode]: def oid_cid_node(self, default_wallet: str) -> tuple[str, str, ClusterNode]:
with reporter.step("Create container, and put object"): with reporter.step("Create container, and put object"):
cid = create_container( cid = create_container(
wallet=default_wallet, shell=self.shell, endpoint=self.cluster.default_rpc_endpoint, rule="REP 1 CBF 1" wallet=default_wallet,
shell=self.shell,
endpoint=self.cluster.default_rpc_endpoint,
rule="REP 1 CBF 1",
basic_acl=EACL_PUBLIC_READ_WRITE,
) )
file = generate_file(5242880) file = generate_file(5242880)
oid = put_object( oid = put_object(
wallet=default_wallet, path=file, cid=cid, shell=self.shell, endpoint=self.cluster.default_rpc_endpoint wallet=default_wallet, path=file, cid=cid, shell=self.shell, endpoint=self.cluster.default_rpc_endpoint
) )
with reporter.step("Search node with object"): with reporter.step("Search node with object"):
nodes = get_object_nodes( nodes = get_object_nodes(cluster=self.cluster, cid=cid, oid=oid, alive_node=self.cluster.cluster_nodes[0])
cluster=self.cluster,
wallet=default_wallet,
cid=cid,
oid=oid,
shell=self.shell,
endpoint=self.cluster.default_rpc_endpoint,
)
yield oid, cid, nodes[0] yield oid, cid, nodes[0]
@ -136,7 +134,7 @@ class TestControlShard(ClusterTestBase):
revert_all_shards_mode: None, revert_all_shards_mode: None,
): ):
oid, cid, node = oid_cid_node oid, cid, node = oid_cid_node
object_path, object_name = self.get_object_path_and_name_file(oid, cid, node) object_path, object_name = self.get_object_path_and_name_file(*oid_cid_node)
with reporter.step("Block read file"): with reporter.step("Block read file"):
node.host.get_shell().exec(f"chmod a-r {object_path}/{object_name}") node.host.get_shell().exec(f"chmod a-r {object_path}/{object_name}")
with reporter.step("Get object, expect 6 errors"): with reporter.step("Get object, expect 6 errors"):