[#326] add deny morph tests ape

This commit is contained in:
Ekaterina Chernitsyna 2024-11-22 16:41:24 +03:00
parent 392408e7fe
commit 72b4fcf182

View file

@ -55,7 +55,7 @@ def local_overrides_on_node(node: ClusterNode, id_chains_for_remove: list[str]):
shell: Shell = node.host.get_shell()
remote_config: str = node.storage_node.get_remote_wallet_config_path()
cli = FrostfsCli(shell=shell, frostfs_cli_exec_path=FROSTFS_CLI_EXEC, config_file=remote_config)
with reporter.step("Delete rules on {node.storage_node.id} node"):
with reporter.step(f"Delete rules on {node.storage_node.id} node"):
for chain_id in id_chains_for_remove:
cli.control.remove_rule(
endpoint=node.storage_node.get_control_endpoint(),
@ -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,
)
with reporter.step("Delete rules on {node.storage_node.id} node"):
for chain_id in id_chains_for_remove:
rules = adm.morph.list_rules(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(f"Delete rules on {node.storage_node.id} node"):
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")
@ -197,6 +204,9 @@ class TestApeMorphRuleChain(ClusterTestBase):
chain_id=chain_id,
)
with reporter.step("Wait for one block"):
time.sleep(datetime_utils.parse_time(MORPH_BLOCK_TIME))
with reporter.step("Check get the container property on the first node"):
with expect_not_raises():
frostfs_cli.container.get(self.cluster.storage_nodes[0].get_rpc_endpoint(), cid)
@ -246,6 +256,9 @@ class TestApeMorphRuleChain(ClusterTestBase):
chain_id=chain_id,
)
with reporter.step("Wait for one block"):
time.sleep(datetime_utils.parse_time(MORPH_BLOCK_TIME))
with reporter.step("Check create a container on the first node"):
with expect_not_raises():
frostfs_cli.container.create(
@ -304,6 +317,9 @@ class TestApeMorphRuleChain(ClusterTestBase):
chain_id=chain_id,
)
with reporter.step("Wait for one block"):
time.sleep(datetime_utils.parse_time(MORPH_BLOCK_TIME))
with reporter.step("Check display a list of containers on the first node"):
with expect_not_raises():
frostfs_cli.container.list(rpc_endpoint=self.cluster.storage_nodes[0].get_rpc_endpoint(), ttl=1)
@ -355,6 +371,9 @@ class TestApeMorphRuleChain(ClusterTestBase):
chain_id=chain_id,
)
with reporter.step("Wait for one block"):
time.sleep(datetime_utils.parse_time(MORPH_BLOCK_TIME))
with reporter.step("Check delete first container from the first node"):
with expect_not_raises():
frostfs_cli.container.delete(self.cluster.storage_nodes[0].get_rpc_endpoint(), cid, ttl=1)