From 2c8a609d62e236a2d2e854b156c36db01efb58c5 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 5 Mar 2024 12:51:15 +0300 Subject: [PATCH 1/2] [#190] Add PlacementPolicy dataclass Allow to parametrize tests with placement policy. Signed-off-by: Evgenii Stratonikov --- src/frostfs_testlib/storage/dataclasses/policy.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/frostfs_testlib/storage/dataclasses/policy.py diff --git a/src/frostfs_testlib/storage/dataclasses/policy.py b/src/frostfs_testlib/storage/dataclasses/policy.py new file mode 100644 index 0000000..872ee05 --- /dev/null +++ b/src/frostfs_testlib/storage/dataclasses/policy.py @@ -0,0 +1,13 @@ +from dataclasses import dataclass + + +@dataclass +class PlacementPolicy: + name: str + value: str + + def __str__(self) -> str: + return self.name + + def __repr__(self) -> str: + return self.__str__() -- 2.45.2 From cc5d36c5af67da85edfdc9383499447d41eb0140 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 5 Mar 2024 12:52:19 +0300 Subject: [PATCH 2/2] [#190] Introduce default EC placement policy The default policy which is similar to REP 2, but uses EC instead. Signed-off-by: Evgenii Stratonikov --- src/frostfs_testlib/steps/cli/container.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/frostfs_testlib/steps/cli/container.py b/src/frostfs_testlib/steps/cli/container.py index fc643e2..fa739a8 100644 --- a/src/frostfs_testlib/steps/cli/container.py +++ b/src/frostfs_testlib/steps/cli/container.py @@ -95,6 +95,7 @@ class StorageContainer: DEFAULT_PLACEMENT_RULE = "REP 2 IN X CBF 1 SELECT 4 FROM * AS X" SINGLE_PLACEMENT_RULE = "REP 1 IN X CBF 1 SELECT 4 FROM * AS X" REP_2_FOR_3_NODES_PLACEMENT_RULE = "REP 2 IN X CBF 1 SELECT 3 FROM * AS X" +DEFAULT_EC_PLACEMENT_RULE = "EC 3.1" @reporter.step("Create Container") -- 2.45.2