From 88b7d3e726c4e42c6bf2cfe87f7d2de22646ba0a Mon Sep 17 00:00:00 2001 From: ckishimo Date: Fri, 8 Jan 2021 16:10:38 +0100 Subject: tests: move redistribute function into lib Signed-off-by: ckishimo --- .../ospf_basic_functionality/test_ospf_rte_calc.py | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'tests/topotests/ospf_basic_functionality/test_ospf_rte_calc.py') diff --git a/tests/topotests/ospf_basic_functionality/test_ospf_rte_calc.py b/tests/topotests/ospf_basic_functionality/test_ospf_rte_calc.py index fd2da83064..5aa2779aee 100644 --- a/tests/topotests/ospf_basic_functionality/test_ospf_rte_calc.py +++ b/tests/topotests/ospf_basic_functionality/test_ospf_rte_calc.py @@ -61,6 +61,7 @@ from lib.ospf import ( clear_ospf, verify_ospf_rib, create_router_ospf, + redistribute_ospf, ) # Global variables @@ -183,19 +184,6 @@ def teardown_module(mod): logger.info("=" * 40) -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. # ################################## @@ -463,8 +451,8 @@ def test_ospf_redistribution_tc8_p1(request): "advertised/exchaged via ospf" ) for rtr in topo["routers"]: - redistribute(rtr, "static") - redistribute(rtr, "connected") + redistribute_ospf(tgen, topo, rtr, "static") + redistribute_ospf(tgen, topo, rtr, "connected") for node in topo["routers"]: input_dict = { "r0": { @@ -521,7 +509,7 @@ def test_ospf_redistribution_tc8_p1(request): ) for rtr in topo["routers"]: - redistribute(rtr, "static", delete=True) + redistribute_ospf(tgen, topo, rtr, "static", delete=True) input_dict = { "r0": { -- cgit v1.2.3