diff options
| author | Renato Westphal <renato@opensourcerouting.org> | 2021-09-06 19:52:32 -0300 |
|---|---|---|
| committer | Renato Westphal <renato@opensourcerouting.org> | 2021-09-21 17:47:13 -0300 |
| commit | 6735622c24a3510032e40aaf4b9f419e9efbea3d (patch) | |
| tree | 21c37b02d6b5833e47a7601c9879f323021b0ec4 /tests/topotests/ospf6_topo2/test_ospf6_topo2.py | |
| parent | 210429c74722d85f392cbee344ffd30bea83a004 (diff) | |
ospf6d: implement Type-7 default routes for NSSA areas
Add the "default-information-originate" option to the "area X nssa"
command. That option allows the origination of Type-7 default routes
on NSSA ABRs and ASBRs.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'tests/topotests/ospf6_topo2/test_ospf6_topo2.py')
| -rw-r--r-- | tests/topotests/ospf6_topo2/test_ospf6_topo2.py | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/topotests/ospf6_topo2/test_ospf6_topo2.py b/tests/topotests/ospf6_topo2/test_ospf6_topo2.py index 997058f926..303bcd014d 100644 --- a/tests/topotests/ospf6_topo2/test_ospf6_topo2.py +++ b/tests/topotests/ospf6_topo2/test_ospf6_topo2.py @@ -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. |
