Add new fixture

Signed-off-by: Dmitriy Zayakin <d.zayakin@yadro.com>
This commit is contained in:
Dmitriy Zayakin 2023-09-18 21:01:06 +03:00 committed by Dmitriy Zayakin
parent ed15485b72
commit 2a1d40680a
2 changed files with 7 additions and 8 deletions

View file

@ -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

View file

@ -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,