From 0d7befe9a6fcb6152f3f7d371a893b78d761913d Mon Sep 17 00:00:00 2001 From: Dmitriy Zayakin Date: Mon, 22 Jan 2024 14:29:49 +0300 Subject: [PATCH] [#186] Change call object nodes func Signed-off-by: Dmitriy Zayakin --- .../failovers/test_failover_network.py | 11 ++++------- .../failovers/test_failover_server.py | 14 ++------------ .../testsuites/shard/test_control_shard.py | 18 ++++++++---------- 3 files changed, 14 insertions(+), 29 deletions(-) diff --git a/pytest_tests/testsuites/failovers/test_failover_network.py b/pytest_tests/testsuites/failovers/test_failover_network.py index 1ca34a1..833771b 100644 --- a/pytest_tests/testsuites/failovers/test_failover_network.py +++ b/pytest_tests/testsuites/failovers/test_failover_network.py @@ -7,7 +7,7 @@ import allure import pytest from frostfs_testlib import reporter 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.object import ( get_object, @@ -88,6 +88,7 @@ class TestFailoverNetwork(ClusterTestBase): endpoint=self.cluster.default_rpc_endpoint, rule=placement_rule, await_mode=True, + basic_acl=EACL_PUBLIC_READ_WRITE, ) storage_objects = [] @@ -210,11 +211,9 @@ class TestFailoverNetwork(ClusterTestBase): with reporter.step("Search nodes with object"): nodes_with_object = get_object_nodes( cluster=self.cluster, - wallet=default_wallet, cid=storage_object.cid, oid=storage_object.oid, - shell=self.shell, - endpoint=self.cluster.default_rpc_endpoint, + alive_node=self.cluster.cluster_nodes[0], ) with reporter.step("Get data interface to node"): @@ -270,11 +269,9 @@ class TestFailoverNetwork(ClusterTestBase): with reporter.step("Search nodes with object"): nodes_with_object = get_object_nodes( cluster=self.cluster, - wallet=default_wallet, cid=storage_object.cid, oid=storage_object.oid, - shell=self.shell, - endpoint=self.cluster.default_rpc_endpoint, + alive_node=self.cluster.cluster_nodes[0], ) with reporter.step("Get internal interface to node"): diff --git a/pytest_tests/testsuites/failovers/test_failover_server.py b/pytest_tests/testsuites/failovers/test_failover_server.py index 38cf9db..c5b5c41 100644 --- a/pytest_tests/testsuites/failovers/test_failover_server.py +++ b/pytest_tests/testsuites/failovers/test_failover_server.py @@ -156,12 +156,7 @@ class TestFailoverServer(ClusterTestBase): ) -> tuple[StorageObjectInfo, list[ClusterNode]]: object_info = container.generate_object(simple_object_size.value) object_nodes = get_object_nodes( - cluster=self.cluster, - wallet=default_wallet, - cid=object_info.cid, - oid=object_info.oid, - shell=self.shell, - endpoint=self.cluster.default_rpc_endpoint, + cluster=self.cluster, cid=object_info.cid, oid=object_info.oid, alive_node=self.cluster.cluster_nodes[0] ) return object_info, object_nodes @@ -313,12 +308,7 @@ class TestFailoverServer(ClusterTestBase): ) with reporter.step("Search nodes with object"): object_nodes = get_object_nodes( - cluster=self.cluster, - wallet=default_wallet, - cid=cid_1, - oid=oid, - shell=self.shell, - endpoint=self.cluster.default_rpc_endpoint, + cluster=self.cluster, cid=cid_1, oid=oid, alive_node=self.cluster.cluster_nodes[0] ) with reporter.step("Turn off random node with object"): cluster_state_controller.stop_node_host(node=random.choice(object_nodes[1:]), mode="hard") diff --git a/pytest_tests/testsuites/shard/test_control_shard.py b/pytest_tests/testsuites/shard/test_control_shard.py index 0f3297b..92b37d1 100644 --- a/pytest_tests/testsuites/shard/test_control_shard.py +++ b/pytest_tests/testsuites/shard/test_control_shard.py @@ -7,6 +7,7 @@ from frostfs_testlib import reporter from frostfs_testlib.cli import FrostfsCli from frostfs_testlib.resources.cli import CLI_DEFAULT_TIMEOUT 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.object import delete_object, get_object, get_object_nodes, put_object 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]: with reporter.step("Create container, and put object"): 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) oid = put_object( wallet=default_wallet, path=file, cid=cid, shell=self.shell, endpoint=self.cluster.default_rpc_endpoint ) with reporter.step("Search node with object"): - nodes = get_object_nodes( - cluster=self.cluster, - wallet=default_wallet, - cid=cid, - oid=oid, - shell=self.shell, - endpoint=self.cluster.default_rpc_endpoint, - ) + nodes = get_object_nodes(cluster=self.cluster, cid=cid, oid=oid, alive_node=self.cluster.cluster_nodes[0]) yield oid, cid, nodes[0] @@ -136,7 +134,7 @@ class TestControlShard(ClusterTestBase): revert_all_shards_mode: None, ): 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"): node.host.get_shell().exec(f"chmod a-r {object_path}/{object_name}") with reporter.step("Get object, expect 6 errors"):