From d82c2d86c90233c63d337aca3332c01f0e9ca096 Mon Sep 17 00:00:00 2001 From: anikeev-yadro Date: Tue, 13 Feb 2024 16:39:30 +0300 Subject: [PATCH] [#195] Add except bucket node --- .../testsuites/failovers/test_failover_storage.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pytest_tests/testsuites/failovers/test_failover_storage.py b/pytest_tests/testsuites/failovers/test_failover_storage.py index 99afd0f3..4fcf154a 100644 --- a/pytest_tests/testsuites/failovers/test_failover_storage.py +++ b/pytest_tests/testsuites/failovers/test_failover_storage.py @@ -20,6 +20,7 @@ from frostfs_testlib.steps.node_management import ( wait_for_node_to_be_ready, ) from frostfs_testlib.steps.s3 import s3_helper +from frostfs_testlib.steps.s3.s3_helper import search_nodes_with_bucket from frostfs_testlib.storage.cluster import Cluster, ClusterNode, S3Gate, StorageNode from frostfs_testlib.storage.controllers import ClusterStateController, ShardsWatcher from frostfs_testlib.storage.dataclasses.object_size import ObjectSize @@ -126,6 +127,7 @@ class TestFailoverStorage(ClusterTestBase): def test_unhealthy_tree( self, s3_client: S3ClientWrapper, + default_wallet: str, simple_object_size: ObjectSize, cluster_state_controller: ClusterStateController, after_run_return_all_stopped_services, @@ -155,8 +157,16 @@ class TestFailoverStorage(ClusterTestBase): put_object = s3_client.put_object(bucket, file_path) s3_helper.check_objects_in_bucket(s3_client, bucket, expected_objects=[file_name]) - with reporter.step("Turn off all storage nodes except default"): - for node in self.cluster.cluster_nodes[1:]: + node_bucket = search_nodes_with_bucket( + cluster=self.cluster, + bucket_name=bucket, + wallet=default_wallet, + shell=self.shell, + endpoint=self.cluster.storage_nodes[0].get_rpc_endpoint(), + )[0] + + with reporter.step("Turn off all storage nodes except bucket node"): + for node in [node_to_stop for node_to_stop in self.cluster.cluster_nodes if node_to_stop != node_bucket]: with reporter.step(f"Stop storage service on node: {node}"): cluster_state_controller.stop_service_of_type(node, StorageNode) -- 2.45.2