Commit 242ff179 authored by Matous Holinka's avatar Matous Holinka
Browse files

mh-ospf-single-area: missing parameter added to the file tests/kernel.py::test_kernel_routes

parent e0a3725a
......@@ -60,9 +60,9 @@ def save_stdout(cmd: str) -> str:
return proc_stdout.decode("utf-8")
def get_attributes_from_output(data: str) -> list:
def get_attributes_from_output(data: str, protocol: str) -> list:
"""Parse the string from parameter and return list"""
return [line.split() for line in data.split("\n") if line.startswith("ospf")]
return [line.split() for line in data.split("\n") if line.startswith(protocol)]
def check_running_protocols(data: list) -> None:
......@@ -70,7 +70,7 @@ def check_running_protocols(data: list) -> None:
assert "Running" in data
def check_protocol_state(dev: str) -> None:
def check_protocol_state(dev: str, protocol: str) -> None:
"""
1. Modify the specified bash command with proper variable
2. Send bash command into the function and return output as str
......@@ -79,15 +79,15 @@ def check_protocol_state(dev: str) -> None:
"""
command = modify_command(dev)
decoded = save_stdout(command)
clean_str = get_attributes_from_output(decoded)
clean_str = get_attributes_from_output(decoded, protocol)
for line in clean_str:
check_running_protocols(line)
def test_krt_routes(key, dev):
def test_krt_routes(key, dev, protocol):
if cf.save:
save_krt_routes(key, dev)
else:
check_krt_routes_timeout(key, dev)
check_protocol_state(dev)
check_protocol_state(dev, protocol)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment