forked from TrueCloudLab/frostfs-testcases
Update check Policy: REP 1 IN SPB REP 1 IN MSK REP 3
This commit is contained in:
parent
00f312dab9
commit
e8289a3f83
1 changed files with 10 additions and 6 deletions
|
@ -1460,6 +1460,7 @@ class TestPolicy(ClusterTestBase):
|
||||||
This test checks object's copies based on container's placement policy: REP 1 IN SPB REP 1 IN MSK REP 3.
|
This test checks object's copies based on container's placement policy: REP 1 IN SPB REP 1 IN MSK REP 3.
|
||||||
"""
|
"""
|
||||||
placement_rule = "REP 1 IN SPB REP 1 IN MSK REP 3 CBF 1 SELECT 2 FROM LED AS SPB SELECT 2 FROM MOW AS MSK FILTER Location EQ 'Saint Petersburg (ex Leningrad)' AS LED FILTER Location EQ Moskva AS MOW"
|
placement_rule = "REP 1 IN SPB REP 1 IN MSK REP 3 CBF 1 SELECT 2 FROM LED AS SPB SELECT 2 FROM MOW AS MSK FILTER Location EQ 'Saint Petersburg (ex Leningrad)' AS LED FILTER Location EQ Moskva AS MOW"
|
||||||
|
expected_params = {"location": ["Saint Petersburg (ex Leningrad)", "Moskva"]}
|
||||||
file_path = generate_file(simple_object_size.value)
|
file_path = generate_file(simple_object_size.value)
|
||||||
expected_copies = 3
|
expected_copies = 3
|
||||||
endpoint = self.cluster.default_rpc_endpoint
|
endpoint = self.cluster.default_rpc_endpoint
|
||||||
|
@ -1482,12 +1483,14 @@ class TestPolicy(ClusterTestBase):
|
||||||
), f"Expected {expected_copies} or {expected_copies + 1} copies, got {len(resulting_copies)}"
|
), f"Expected {expected_copies} or {expected_copies + 1} copies, got {len(resulting_copies)}"
|
||||||
|
|
||||||
with allure.step(f"Check the object appearance"):
|
with allure.step(f"Check the object appearance"):
|
||||||
nodes_without_object = get_nodes_without_object(
|
netmap = parse_netmap_output(get_netmap_snapshot(node=resulting_copies[0], shell=self.shell))
|
||||||
wallet=default_wallet, cid=cid, oid=oid, shell=self.shell, nodes=self.cluster.storage_nodes
|
netmap = self.get_netmap_param(netmap)
|
||||||
)
|
for node in resulting_copies:
|
||||||
assert set(resulting_copies) | set(nodes_without_object) == set(
|
node_address = node.get_rpc_endpoint().split(":")[0]
|
||||||
self.cluster.storage_nodes
|
assert expected_params["location"][0] == netmap[node_address]["location"] or (
|
||||||
), f"nodes filling error: nodes with object = {resulting_copies}, nodes witout object = {nodes_without_object}"
|
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]}"
|
||||||
|
|
||||||
self.check_for_the_uniqueness_of_the_nodes(resulting_copies)
|
self.check_for_the_uniqueness_of_the_nodes(resulting_copies)
|
||||||
|
|
||||||
with allure.step(f"Delete the object from the container"):
|
with allure.step(f"Delete the object from the container"):
|
||||||
|
@ -1517,5 +1520,6 @@ class TestPolicy(ClusterTestBase):
|
||||||
"price": node.price,
|
"price": node.price,
|
||||||
"continent": node.continent,
|
"continent": node.continent,
|
||||||
"un_locode": node.un_locode,
|
"un_locode": node.un_locode,
|
||||||
|
"location": node.location,
|
||||||
}
|
}
|
||||||
return dict_external
|
return dict_external
|
||||||
|
|
Loading…
Reference in a new issue