diff --git a/pytest_tests/testsuites/ape/test_ape.py b/pytest_tests/testsuites/ape/test_ape.py index e029289e..d71e52bb 100644 --- a/pytest_tests/testsuites/ape/test_ape.py +++ b/pytest_tests/testsuites/ape/test_ape.py @@ -74,15 +74,22 @@ def morph_on_node(node: ClusterNode, id_chains_for_remove: list[str]): frostfs_adm_exec_path=FROSTFS_ADM_EXEC, 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"): - 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( target_type="namespace", target_name="root", chain_id=chain_id, ) - with reporter.step("Wait for one block"): - time.sleep(datetime_utils.parse_time(MORPH_BLOCK_TIME)) + need_wait = True + if need_wait: + with reporter.step("Wait for one block"): + time.sleep(datetime_utils.parse_time(MORPH_BLOCK_TIME)) @pytest.fixture(scope="session")