Commit 2e287f99 authored by Matous Holinka's avatar Matous Holinka Committed by Ondřej Zajíček
Browse files

mh-ospf-vrf: test-suite added

parent 1d15a06f
import os
import sys
import pickle
import pytest
from inspect import getsourcefile
current_dir = os.path.dirname(os.path.abspath(getsourcefile(lambda: 0)))
sys.path.insert(0, current_dir.rsplit(os.path.sep, 2)[0])
import tests.kernel as tk
sys.path.pop(0)
_LIMIT = 60
LIMIT = 60
EXPECTED_DEVICES = ("m1", "m2", "m3", "m4", "m5", "m6", "m7", "m8", "m9", "m10")
@pytest.mark.skipif(tk.cf.save == False, reason="mode: save")
def test_wait():
"""Wait until the time (limit) runs out"""
tk.wait(_LIMIT)
tk.wait(LIMIT)
@pytest.mark.skipif(tk.cf.save == False, reason="mode: save")
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
def test_save_krt_tables(exp_devs):
tk.save_krt_routes("krt", exp_devs)
@pytest.mark.skipif(tk.cf.save == True, reason="mode: check")
def test_checking_wait():
"""
Temporary solution. Test are failing without this function.
The state of specific protocols return "Alone". They need a while for connection
"""
tk.wait(10)
@pytest.mark.parametrize(
"expected_device", ["m1", "m2", "m3", "m4", "m5", "m6", "m7", "m8", "m9", "m10"],
)
def test_krt_routes(expected_device):
"""Testing of kernel route tables"""
tk.test_krt_routes("krt", expected_device, "ospf")
@pytest.mark.parametrize("exp_devs", EXPECTED_DEVICES)
def test_check_krt_routes_timeout(exp_devs):
tk.check_krt_routes_timeout("krt", exp_devs)
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