summaryrefslogtreecommitdiff
path: root/tests/topotests/lib/ospf.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/topotests/lib/ospf.py')
-rw-r--r--tests/topotests/lib/ospf.py27
1 files changed, 20 insertions, 7 deletions
diff --git a/tests/topotests/lib/ospf.py b/tests/topotests/lib/ospf.py
index 92d29ad1ab..e7ea7d32ba 100644
--- a/tests/topotests/lib/ospf.py
+++ b/tests/topotests/lib/ospf.py
@@ -1668,7 +1668,7 @@ def verify_ospf6_rib(
logger.info("Checking router %s RIB:", router)
# Verifying RIB routes
- command = "show ipv6 ospf route"
+ command = "show ipv6 ospf route detail"
found_routes = []
missing_routes = []
@@ -1710,6 +1710,8 @@ def verify_ospf6_rib(
# Generating IPs for verification
ip_list = generate_ips(network, no_of_ip)
+ if len(ip_list) == 1:
+ ip_list = [network]
st_found = False
nh_found = False
for st_rt in ip_list:
@@ -1846,7 +1848,7 @@ def verify_ospf6_rib(
return errormsg
if metric is not None:
- if "type2cost" not in ospf_rib_json[st_rt]:
+ if "metricCostE2" not in ospf_rib_json[st_rt]:
errormsg = (
"[DUT: {}]: metric is"
" not present for"
@@ -1854,7 +1856,7 @@ def verify_ospf6_rib(
)
return errormsg
- if metric != ospf_rib_json[st_rt]["type2cost"]:
+ if metric != ospf_rib_json[st_rt]["metricCostE2"]:
errormsg = (
"[DUT: {}]: metric value "
"{} is not matched for "
@@ -1933,7 +1935,7 @@ def verify_ospf6_interface(tgen, topo=None, dut=None, lan=False, input_dict=None
True or False (Error Message)
"""
- logger.debug("Entering lib API: {}".format(sys._getframe().f_code.co_name))
+ logger.debug("Entering lib API: verify_ospf6_interface")
result = False
if topo is None:
@@ -2311,6 +2313,7 @@ def config_ospf6_interface(
-------
True or False
"""
+
logger.debug("Entering lib API: {}".format(sys._getframe().f_code.co_name))
result = False
if topo is None:
@@ -2337,6 +2340,7 @@ def config_ospf6_interface(
ospf_data = input_dict[router]["links"][lnk]["ospf6"]
data_ospf_area = ospf_data.setdefault("area", None)
data_ospf_auth = ospf_data.setdefault("hash-algo", None)
+ data_ospf_keychain = ospf_data.setdefault("keychain", 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)
@@ -2369,9 +2373,18 @@ def config_ospf6_interface(
ospf_data["hash-algo"],
ospf_data["key"],
)
- if "del_action" in ospf_data:
- cmd = "no {}".format(cmd)
- config_data.append(cmd)
+ config_data.append(cmd)
+
+ # interface ospf auth with keychain
+ if data_ospf_keychain:
+ cmd = "ipv6 ospf6 authentication"
+
+ if "del_action" in ospf_data:
+ cmd = "no {}".format(cmd)
+
+ if "keychain" in ospf_data:
+ cmd = "{} keychain {}".format(cmd, ospf_data["keychain"])
+ config_data.append(cmd)
# interface ospf dr priority
if data_ospf_dr_priority: