summaryrefslogtreecommitdiff
path: root/tests/topotests/ospf_basic_functionality/test_ospf_nssa.py
diff options
context:
space:
mode:
authorckishimo <carles.kishimoto@gmail.com>2021-01-08 16:10:38 +0100
committerckishimo <carles.kishimoto@gmail.com>2021-01-12 11:18:22 +0100
commit88b7d3e726c4e42c6bf2cfe87f7d2de22646ba0a (patch)
tree51ea63a9ea065dad3b1f0309badd0e48ba3fd68b /tests/topotests/ospf_basic_functionality/test_ospf_nssa.py
parent9458be1aecca7c69aff6c9168cf2277209684fab (diff)
tests: move redistribute function into lib
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
Diffstat (limited to 'tests/topotests/ospf_basic_functionality/test_ospf_nssa.py')
-rw-r--r--tests/topotests/ospf_basic_functionality/test_ospf_nssa.py16
1 files changed, 2 insertions, 14 deletions
diff --git a/tests/topotests/ospf_basic_functionality/test_ospf_nssa.py b/tests/topotests/ospf_basic_functionality/test_ospf_nssa.py
index 7ec80e4560..3644bff3dc 100644
--- a/tests/topotests/ospf_basic_functionality/test_ospf_nssa.py
+++ b/tests/topotests/ospf_basic_functionality/test_ospf_nssa.py
@@ -30,6 +30,7 @@ from lib.ospf import (
verify_ospf_rib,
create_router_ospf,
verify_ospf_interface,
+ redistribute_ospf,
)
from lib.topojson import build_topo_from_json, build_config_from_json
from lib.topolog import logger
@@ -181,19 +182,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.
# ##################################
@@ -249,7 +237,7 @@ def test_ospf_learning_tc15_p0(request):
step("Redistribute static route in R2 ospf.")
dut = "r2"
- redistribute(dut, "static")
+ redistribute_ospf(tgen, topo, dut, "static")
step("Verify that Type 5 LSA is originated by R2.")
dut = "r0"