From 881fa68f057acd52905ca7c917e65f9b895290fa Mon Sep 17 00:00:00 2001 From: ckishimo Date: Fri, 8 Jan 2021 10:25:49 +0100 Subject: tests: add new def for redistribution in ospf Signed-off-by: ckishimo --- tests/topotests/ospf_basic_functionality/test_ospf_nssa.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests/topotests/ospf_basic_functionality/test_ospf_nssa.py') diff --git a/tests/topotests/ospf_basic_functionality/test_ospf_nssa.py b/tests/topotests/ospf_basic_functionality/test_ospf_nssa.py index 82a34d046c..44eaf81437 100644 --- a/tests/topotests/ospf_basic_functionality/test_ospf_nssa.py +++ b/tests/topotests/ospf_basic_functionality/test_ospf_nssa.py @@ -213,6 +213,19 @@ def red_connected(dut, config=True): assert result is True, "Testcase: Failed \n Error: {}".format(result) +def redistribute(dut, route_type, **kwargs): + """Local def for redstribution of routes inside ospf.""" + global topo + tgen = get_topogen() + + ospf_red = {dut: {"ospf": {"redistribute": [{"redist_type": route_type}]}}} + for k, v in kwargs.items(): + ospf_red[dut]["ospf"]["redistribute"][0][k] = v + + result = create_router_ospf(tgen, topo, ospf_red) + assert result is True, "Testcase : Failed \n Error: {}".format(result) + + # ################################## # Test cases start here. # ################################## -- cgit v1.2.3