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