[#326] add deny morph tests ape

This commit is contained in:
Ekaterina Chernitsyna 2024-11-21 23:58:12 +03:00
parent 392408e7fe
commit 11de6a4c55

View file

@ -74,15 +74,22 @@ def morph_on_node(node: ClusterNode, id_chains_for_remove: list[str]):
frostfs_adm_exec_path=FROSTFS_ADM_EXEC, frostfs_adm_exec_path=FROSTFS_ADM_EXEC,
config_file=FROSTFS_ADM_CONFIG_PATH, config_file=FROSTFS_ADM_CONFIG_PATH,
) )
rules = adm.morph.list_rules(endpoint=node.storage_node.get_control_endpoint(), target_name="kapusta", target_type="namespace").stdout
chain_ids = [i.split(" ")[2].strip() for i in rules.split("\n") if "Chain ID" in i]
need_wait = False
with reporter.step("Delete rules on {node.storage_node.id} node"): with reporter.step("Delete rules on {node.storage_node.id} node"):
for chain_id in id_chains_for_remove: for chain_id in chain_ids:
if not chain_id in id_chains_for_remove:
continue
adm.morph.remove_rule( adm.morph.remove_rule(
target_type="namespace", target_type="namespace",
target_name="root", target_name="root",
chain_id=chain_id, chain_id=chain_id,
) )
with reporter.step("Wait for one block"): need_wait = True
time.sleep(datetime_utils.parse_time(MORPH_BLOCK_TIME)) if need_wait:
with reporter.step("Wait for one block"):
time.sleep(datetime_utils.parse_time(MORPH_BLOCK_TIME))
@pytest.fixture(scope="session") @pytest.fixture(scope="session")