From 9f8485f5eb4110d681dd878574a2b845728a0b6f Mon Sep 17 00:00:00 2001 From: Ekaterina Chernitsyna Date: Thu, 9 Nov 2023 23:49:27 +0300 Subject: [PATCH] Update check Policy: REP 1 IN SPB REP 1 IN MSK REP 3 Signed-off-by: Ekaterina Chernitsyna --- pytest_tests/testsuites/container/test_policy.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pytest_tests/testsuites/container/test_policy.py b/pytest_tests/testsuites/container/test_policy.py index 8989431..20a0e85 100644 --- a/pytest_tests/testsuites/container/test_policy.py +++ b/pytest_tests/testsuites/container/test_policy.py @@ -1485,11 +1485,16 @@ class TestPolicy(ClusterTestBase): with allure.step(f"Check the object appearance"): netmap = parse_netmap_output(get_netmap_snapshot(node=resulting_copies[0], shell=self.shell)) netmap = self.get_netmap_param(netmap) + list_of_location = [] for node in resulting_copies: node_address = node.get_rpc_endpoint().split(":")[0] - assert expected_params["location"][0] == netmap[node_address]["location"] or ( - expected_params["location"][1] == netmap[node_address]["location"] - ), f"The node is selected from the wrong location. Expected {expected_params} and got {netmap[node_address]}" + list_of_location.append(netmap[node_address]["location"]) + + assert ( + expected_params["location"][0] in list_of_location + and expected_params["location"][1] in list_of_location + and len(resulting_copies) > 2 + ), f"The node is selected from the wrong location. Expected {expected_params} and got {netmap[node_address]}" self.check_for_the_uniqueness_of_the_nodes(resulting_copies)