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.py50
1 files changed, 47 insertions, 3 deletions
diff --git a/tests/topotests/ospf6_topo2/test_ospf6_topo2.py b/tests/topotests/ospf6_topo2/test_ospf6_topo2.py
index acaa3b8a9b..303bcd014d 100644
--- a/tests/topotests/ospf6_topo2/test_ospf6_topo2.py
+++ b/tests/topotests/ospf6_topo2/test_ospf6_topo2.py
@@ -217,8 +217,8 @@ def test_ospfv3_expected_route_types():
{
"numberOfIntraAreaRoutes": 1,
"numberOfInterAreaRoutes": 2,
- "numberOfExternal1Routes": 4,
- "numberOfExternal2Routes": 0,
+ "numberOfExternal1Routes": 0,
+ "numberOfExternal2Routes": 3,
},
)
@@ -330,7 +330,7 @@ def test_nssa_lsa_type7():
]
route = {
"2001:db8:100::/64": {
- "pathType": "E1",
+ "pathType": "E2",
"nextHops": [{"nextHop": "::", "interfaceName": "r4-eth0"}],
}
}
@@ -431,6 +431,50 @@ def test_nssa_no_summary():
assert result is None, assertmsg
+def test_nssa_default_originate():
+ """
+ Test the following:
+ * A type-7 default route should be originated into the NSSA area
+ when the default-information-originate option is configured;
+ * Once the default-information-originate option is unconfigured, the
+ previously originated Type-7 default route should be removed.
+ """
+ tgen = get_topogen()
+ if tgen.routers_have_failure():
+ pytest.skip(tgen.errors)
+
+ #
+ # Configure r2 to announce a Type-7 default route.
+ #
+ config = """
+ configure terminal
+ router ospf6
+ no default-information originate
+ area 2 nssa default-information-originate
+ """
+ tgen.gears["r2"].vtysh_cmd(config)
+
+ logger.info("Expecting Type-7 default-route to be added")
+ routes = {"::/0": {}}
+ expect_ospfv3_routes("r4", routes, wait=30, type="external-2")
+
+ #
+ # Configure r2 to stop announcing a Type-7 default route.
+ #
+ config = """
+ configure terminal
+ router ospf6
+ area 2 nssa
+ """
+ tgen.gears["r2"].vtysh_cmd(config)
+
+ logger.info("Expecting Type-7 default route to be removed")
+ test_func = partial(dont_expect_route, "r4", "::/0", type="external-2")
+ _, result = topotest.run_and_expect(test_func, None, count=30, wait=1)
+ assertmsg = "r4's Type-7 default route still exists"
+ assert result is None, assertmsg
+
+
def test_area_filters():
"""
Test ABR import/export filters.