From 2a1d40680a1253bc39b988b14ba1fe726d9e0a8e Mon Sep 17 00:00:00 2001 From: Dmitriy Zayakin Date: Mon, 18 Sep 2023 21:01:06 +0300 Subject: [PATCH] Add new fixture Signed-off-by: Dmitriy Zayakin --- pytest_tests/testsuites/conftest.py | 10 +++++----- .../testsuites/failovers/test_failover_network.py | 5 ++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/pytest_tests/testsuites/conftest.py b/pytest_tests/testsuites/conftest.py index 8b4f655..6bd729b 100644 --- a/pytest_tests/testsuites/conftest.py +++ b/pytest_tests/testsuites/conftest.py @@ -28,7 +28,6 @@ from frostfs_testlib.storage.dataclasses.object_size import ObjectSize from frostfs_testlib.storage.dataclasses.wallet import WalletFactory, WalletInfo from frostfs_testlib.testing.cluster_test_base import ClusterTestBase from frostfs_testlib.utils import env_utils, version_utils -from frostfs_testlib.utils.failover_utils import search_for_consensus_nodes from pytest_tests.resources.common import HOSTING_CONFIG_FILE, TEST_CYCLES_COUNT @@ -293,12 +292,13 @@ def default_wallet(wallet_factory: WalletFactory) -> str: @allure.step("[Class]: Container placement policy for keys") @pytest.fixture(scope="class") def auth_container_placement_policy(cluster: Cluster, request: pytest.FixtureRequest): - auth_container_placement_policy = None placeholders = { - "ALPHABET_NODE_COUNT": 4 if len(cluster.cluster_nodes) < 8 else 8, + "$ALPHABET_NODE_COUNT$": 4 if len(cluster.cluster_nodes) < 8 else 8, "$NODE_COUNT$": len(cluster.cluster_nodes), } + placement_policy = None if "param" in request.__dict__: + placement_policy = request.param for key, value in placeholders.items(): - auth_container_placement_policy.replace(key, value) - return auth_container_placement_policy + placement_policy = placement_policy.replace(key, str(value)) + return placement_policy diff --git a/pytest_tests/testsuites/failovers/test_failover_network.py b/pytest_tests/testsuites/failovers/test_failover_network.py index 1d15a13..ad62f91 100644 --- a/pytest_tests/testsuites/failovers/test_failover_network.py +++ b/pytest_tests/testsuites/failovers/test_failover_network.py @@ -24,7 +24,6 @@ from frostfs_testlib.storage.dataclasses.object_size import ObjectSize from frostfs_testlib.testing.cluster_test_base import ClusterTestBase from frostfs_testlib.utils import datetime_utils from frostfs_testlib.utils.failover_utils import ( - search_for_consensus_nodes, wait_all_storage_nodes_returned, wait_object_replication, ) @@ -189,7 +188,7 @@ class TestFailoverSplitBrain(ClusterTestBase): return tuple(s for s in splitted) @allure.title( - "Replication tree after split brain, versioning bucket (placement_policy={keys_placement_policy}, s3_client={s3_client})", + "Replication tree after split brain, versioning bucket (placement_policy={auth_container_placement_policy}, s3_client={s3_client})", ) def test_versioning_bucket_after_split_brain( self, @@ -325,7 +324,7 @@ class TestFailoverSplitBrain(ClusterTestBase): ) @allure.title( - "Replication tree after split brain, no version bucket (placement_policy={keys_placement_policy}, s3_client={s3_client})" + "Replication tree after split brain, no version bucket (placement_policy={auth_container_placement_policy}, s3_client={s3_client})" ) def test_no_version_bucket_after_split_brain( self,