summaryrefslogtreecommitdiff
path: root/tests/topotests/ospf6_topo2/test_ospf6_topo2.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/topotests/ospf6_topo2/test_ospf6_topo2.py')
-rw-r--r--tests/topotests/ospf6_topo2/test_ospf6_topo2.py33
1 files changed, 16 insertions, 17 deletions
diff --git a/tests/topotests/ospf6_topo2/test_ospf6_topo2.py b/tests/topotests/ospf6_topo2/test_ospf6_topo2.py
index 6f7daf533d..3738a0c33e 100644
--- a/tests/topotests/ospf6_topo2/test_ospf6_topo2.py
+++ b/tests/topotests/ospf6_topo2/test_ospf6_topo2.py
@@ -83,10 +83,7 @@ def expect_ospfv3_routes(router, routes, wait=5, detail=False):
logger.info("waiting OSPFv3 router '{}' route".format(router))
test_func = partial(
- topotest.router_json_cmp,
- tgen.gears[router],
- cmd,
- {"routes": routes}
+ topotest.router_json_cmp, tgen.gears[router], cmd, {"routes": routes}
)
_, result = topotest.run_and_expect(test_func, None, count=wait, wait=1)
assertmsg = '"{}" convergence failure'.format(router)
@@ -254,11 +251,13 @@ def test_redistribute_metrics():
route = {
"2001:db8:500::/64": {
- "metricType":2,
- "metricCost":10,
+ "metricType": 2,
+ "metricCost": 10,
}
}
- logger.info("Expecting AS-external route 2001:db8:500::/64 to show up with default metrics")
+ logger.info(
+ "Expecting AS-external route 2001:db8:500::/64 to show up with default metrics"
+ )
expect_ospfv3_routes("r2", route, wait=30, detail=True)
# Change the metric of redistributed routes of the static type on r3.
@@ -272,15 +271,16 @@ def test_redistribute_metrics():
# Check if r3 reinstalled 2001:db8:500::/64 using the new metric type and value.
route = {
"2001:db8:500::/64": {
- "metricType":1,
- "metricCost":60,
+ "metricType": 1,
+ "metricCost": 60,
}
}
- logger.info("Expecting AS-external route 2001:db8:500::/64 to show up with updated metric type and value")
+ logger.info(
+ "Expecting AS-external route 2001:db8:500::/64 to show up with updated metric type and value"
+ )
expect_ospfv3_routes("r2", route, wait=30, detail=True)
-
def test_nssa_lsa_type7():
"""
Test that static route gets announced as external route when redistributed
@@ -310,9 +310,7 @@ def test_nssa_lsa_type7():
route = {
"2001:db8:100::/64": {
"pathType": "E1",
- "nextHops": [
- {"nextHop": "::", "interfaceName": "r4-eth0"}
- ]
+ "nextHops": [{"nextHop": "::", "interfaceName": "r4-eth0"}],
}
}
@@ -331,8 +329,10 @@ def test_nssa_lsa_type7():
def dont_expect_lsa(unexpected_lsa):
"Specialized test function to expect LSA go missing"
- output = tgen.gears["r4"].vtysh_cmd("show ipv6 ospf6 database type-7 detail json", isjson=True)
- for lsa in output['areaScopedLinkStateDb'][0]['lsa']:
+ output = tgen.gears["r4"].vtysh_cmd(
+ "show ipv6 ospf6 database type-7 detail json", isjson=True
+ )
+ for lsa in output["areaScopedLinkStateDb"][0]["lsa"]:
if lsa["prefix"] == unexpected_lsa["prefix"]:
if lsa["forwardingAddress"] == unexpected_lsa["forwardingAddress"]:
return lsa
@@ -345,7 +345,6 @@ def test_nssa_lsa_type7():
return output["routes"][unexpected_route]
return None
-
logger.info("Expecting LSA type-7 and OSPFv3 route 2001:db8:100::/64 to go away")
# Test that LSA doesn't exist.