diff options
author | Russ White <russ@riw.us> | 2021-09-24 19:42:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-24 19:42:49 +0200 |
commit | b8beb67ef5a1c6e276a11ee346ea4a84c1c0b76f (patch) | |
tree | d471f2d6c8d8b7c50e09207a37e695e6138629c8 /tests | |
parent | Merge pull request #9660 from pguibert6WIND/bgp_error_swap (diff) | |
parent | ospf6d: implement Type-7 default routes for NSSA areas (diff) | |
download | frr-b8beb67ef5a1c6e276a11ee346ea4a84c1c0b76f.tar.xz frr-b8beb67ef5a1c6e276a11ee346ea4a84c1c0b76f.zip |
Merge pull request #9585 from opensourcerouting/ospf6d-nssa-dflt-originate
ospf6d: add a knob to generate Type-7 default routes
Diffstat (limited to 'tests')
-rw-r--r-- | tests/topotests/ospf6_topo2/test_ospf6_topo2.py | 50 |
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 acaa3b8a9..303bcd014 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. |