summaryrefslogtreecommitdiff
path: root/tests/topotests/ospf_basic_functionality/test_ospf_ecmp.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/topotests/ospf_basic_functionality/test_ospf_ecmp.py')
-rw-r--r--tests/topotests/ospf_basic_functionality/test_ospf_ecmp.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/topotests/ospf_basic_functionality/test_ospf_ecmp.py b/tests/topotests/ospf_basic_functionality/test_ospf_ecmp.py
index 5ef6b9b0be..7569629a9c 100644
--- a/tests/topotests/ospf_basic_functionality/test_ospf_ecmp.py
+++ b/tests/topotests/ospf_basic_functionality/test_ospf_ecmp.py
@@ -216,6 +216,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.
# ##################################