summaryrefslogtreecommitdiff
path: root/tests/topotests/lib/ospf.py
diff options
context:
space:
mode:
authornguggarigoud <nguggarigoud@vmware.com>2021-02-23 10:34:28 +0530
committernguggarigoud <nguggarigoud@vmware.com>2021-05-17 19:23:15 -0700
commit8694dd78db72e9050f62420da128c437d1039fd3 (patch)
tree51131fda004545fa66b0e237bce734da08521818 /tests/topotests/lib/ospf.py
parent5e6f6c964d70a2afbafeae50cb0ce5c343734973 (diff)
tests: adding ospf basic 2 testcases.
Test cases included are 1 ospf cost, 1 ospf mtu. Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
Diffstat (limited to 'tests/topotests/lib/ospf.py')
-rw-r--r--tests/topotests/lib/ospf.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/topotests/lib/ospf.py b/tests/topotests/lib/ospf.py
index 04a12d0eec..7ad64de4a1 100644
--- a/tests/topotests/lib/ospf.py
+++ b/tests/topotests/lib/ospf.py
@@ -352,6 +352,7 @@ def config_ospf_interface(tgen, topo, input_dict=None, build=False, load_config=
data_ospf_auth = ospf_data.setdefault("authentication", None)
data_ospf_dr_priority = ospf_data.setdefault("priority", None)
data_ospf_cost = ospf_data.setdefault("cost", None)
+ data_ospf_mtu = ospf_data.setdefault("mtu_ignore", None)
try:
intf = topo["routers"][router]["links"][lnk]["interface"]
@@ -400,19 +401,26 @@ def config_ospf_interface(tgen, topo, input_dict=None, build=False, load_config=
config_data.append(cmd)
# interface ospf dr priority
- if data_ospf_dr_priority in ospf_data:
+ if data_ospf_dr_priority:
cmd = "ip ospf priority {}".format(ospf_data["priority"])
if "del_action" in ospf_data:
cmd = "no {}".format(cmd)
config_data.append(cmd)
# interface ospf cost
- if data_ospf_cost in ospf_data:
+ if data_ospf_cost:
cmd = "ip ospf cost {}".format(ospf_data["cost"])
if "del_action" in ospf_data:
cmd = "no {}".format(cmd)
config_data.append(cmd)
+ # interface ospf mtu
+ if data_ospf_mtu:
+ cmd = "ip ospf mtu-ignore"
+ if 'del_action' in ospf_data:
+ cmd = "no {}".format(cmd)
+ config_data.append(cmd)
+
if build:
return config_data
else: