summaryrefslogtreecommitdiff
path: root/tests/topotests/ospf_basic_functionality/test_ospf_nssa.py
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2021-01-13 13:31:32 -0500
committerGitHub <noreply@github.com>2021-01-13 13:31:32 -0500
commitf2aee6967c9311f521601b01d4ec36d7dc8f6c91 (patch)
tree0d7c7908577b9f4b3cf8ea8cc36e58f6823feabb /tests/topotests/ospf_basic_functionality/test_ospf_nssa.py
parentd7ceaa8f5a9d83eddc784e395bb719dc59d4b4be (diff)
parent88b7d3e726c4e42c6bf2cfe87f7d2de22646ba0a (diff)
Merge pull request #7837 from ckishimo/tests_ospf
tests: fix redistribute key in ospf tests
Diffstat (limited to 'tests/topotests/ospf_basic_functionality/test_ospf_nssa.py')
-rw-r--r--tests/topotests/ospf_basic_functionality/test_ospf_nssa.py35
1 files changed, 2 insertions, 33 deletions
diff --git a/tests/topotests/ospf_basic_functionality/test_ospf_nssa.py b/tests/topotests/ospf_basic_functionality/test_ospf_nssa.py
index 82a34d046c..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,38 +182,6 @@ def teardown_module(mod):
logger.info("=" * 40)
-def red_static(dut, config=True):
- """Local def for Redstribute static routes inside ospf."""
- global topo
- tgen = get_topogen()
- if config:
- ospf_red = {dut: {"ospf": {"redistribute": [{"redist_type": "static"}]}}}
- else:
- ospf_red = {
- dut: {"ospf": {"redistribute": [{"redist_type": "static", "delete": True}]}}
- }
- result = create_router_ospf(tgen, topo, ospf_red)
- assert result is True, "Testcase : Failed \n Error: {}".format(result)
-
-
-def red_connected(dut, config=True):
- """Local def for Redstribute connected routes inside ospf."""
- global topo
- tgen = get_topogen()
- if config:
- ospf_red = {dut: {"ospf": {"redistribute": [{"redist_type": "connected"}]}}}
- else:
- ospf_red = {
- dut: {
- "ospf": {
- "redistribute": [{"redist_type": "connected", "del_action": True}]
- }
- }
- }
- result = create_router_ospf(tgen, topo, ospf_red)
- assert result is True, "Testcase: Failed \n Error: {}".format(result)
-
-
# ##################################
# Test cases start here.
# ##################################
@@ -268,7 +237,7 @@ def test_ospf_learning_tc15_p0(request):
step("Redistribute static route in R2 ospf.")
dut = "r2"
- red_static(dut)
+ redistribute_ospf(tgen, topo, dut, "static")
step("Verify that Type 5 LSA is originated by R2.")
dut = "r0"