summaryrefslogtreecommitdiffstats
path: root/tests/topotests/ospf6_topo2
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2021-09-18 02:45:02 +0200
committerRenato Westphal <renato@opensourcerouting.org>2021-09-20 18:06:35 +0200
commitf4f0098ca0da45eb5516ccaaed2a793173cdd224 (patch)
treefb91ddad090c9a0e2be52074a04d0d06536a9c16 /tests/topotests/ospf6_topo2
parentMerge pull request #9632 from donaldsharp/no_forced_wait (diff)
downloadfrr-f4f0098ca0da45eb5516ccaaed2a793173cdd224.tar.xz
frr-f4f0098ca0da45eb5516ccaaed2a793173cdd224.zip
ospf6d: rework filtering commands to be in line with ospfd
Issue #9535 describes how the export-list/import-list commands work differently on ospfd and ospf6d. In short: * On ospfd, "area A.B.C.D export-list" filters which internal routes an ABR exports to other areas. On ospf6d, instead, that command filters which inter-area routes an ABR exports to the configured area (which is quite counter-intuitive). In other words, both commands do the same but in opposite directions. * On ospfd, "area A.B.C.D import-list" filters which inter-area routes an ABR imports into the configured area. On ospf6d, that command filters which inter-area routes an interior router accepts. * On both daemons, "area A.B.C.D filter-list prefix NAME <in|out>" works exactly the same as import/export lists, but using prefix-lists instead of ACLs. The inconsistency on how those commands work is undesirable. This PR proposes to adapt the ospf6d commands to behave like they do in ospfd. These changes are obviously backward incompatible and this PR doesn't propose any mitigation strategy other than warning users about the changes in the next release notes. Since these ospf6d commands are undocumented and work in such a peculiar way, it's unlikely many users will be affected (if any at all). Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'tests/topotests/ospf6_topo2')
-rw-r--r--tests/topotests/ospf6_topo2/test_ospf6_topo2.py69
1 files changed, 69 insertions, 0 deletions
diff --git a/tests/topotests/ospf6_topo2/test_ospf6_topo2.py b/tests/topotests/ospf6_topo2/test_ospf6_topo2.py
index bea3aeaaf..acaa3b8a9 100644
--- a/tests/topotests/ospf6_topo2/test_ospf6_topo2.py
+++ b/tests/topotests/ospf6_topo2/test_ospf6_topo2.py
@@ -431,6 +431,75 @@ def test_nssa_no_summary():
assert result is None, assertmsg
+def test_area_filters():
+ """
+ Test ABR import/export filters.
+ """
+ tgen = get_topogen()
+ if tgen.routers_have_failure():
+ pytest.skip(tgen.errors)
+
+ #
+ # Configure import/export filters on r2 (ABR for area 1).
+ #
+ config = """
+ configure terminal
+ ipv6 access-list ACL_IMPORT seq 5 permit 2001:db8:2::/64
+ ipv6 access-list ACL_IMPORT seq 10 deny any
+ ipv6 access-list ACL_EXPORT seq 10 deny any
+ router ospf6
+ area 1 import-list ACL_IMPORT
+ area 1 export-list ACL_EXPORT
+ """
+ tgen.gears["r2"].vtysh_cmd(config)
+
+ logger.info("Expecting inter-area routes to be removed on r1")
+ for route in ["::/0", "2001:db8:3::/64"]:
+ test_func = partial(dont_expect_route, "r1", route, type="inter-area")
+ _, result = topotest.run_and_expect(test_func, None, count=130, wait=1)
+ assertmsg = "{}'s {} inter-area route still exists".format("r1", route)
+ assert result is None, assertmsg
+
+ logger.info("Expecting inter-area routes to be removed on r3")
+ for route in ["2001:db8:1::/64"]:
+ test_func = partial(dont_expect_route, "r3", route, type="inter-area")
+ _, result = topotest.run_and_expect(test_func, None, count=130, wait=1)
+ assertmsg = "{}'s {} inter-area route still exists".format("r3", route)
+ assert result is None, assertmsg
+
+ #
+ # Update the ACLs used by the import/export filters.
+ #
+ config = """
+ configure terminal
+ ipv6 access-list ACL_IMPORT seq 6 permit 2001:db8:3::/64
+ ipv6 access-list ACL_EXPORT seq 5 permit 2001:db8:1::/64
+ """
+ tgen.gears["r2"].vtysh_cmd(config)
+
+ logger.info("Expecting 2001:db8:3::/64 to be re-added on r1")
+ routes = {"2001:db8:3::/64": {}}
+ expect_ospfv3_routes("r1", routes, wait=30, type="inter-area")
+ logger.info("Expecting 2001:db8:1::/64 to be re-added on r3")
+ routes = {"2001:db8:1::/64": {}}
+ expect_ospfv3_routes("r3", routes, wait=30, type="inter-area")
+
+ #
+ # Unconfigure r2's ABR import/export filters.
+ #
+ config = """
+ configure terminal
+ router ospf6
+ no area 1 import-list ACL_IMPORT
+ no area 1 export-list ACL_EXPORT
+ """
+ tgen.gears["r2"].vtysh_cmd(config)
+
+ logger.info("Expecting ::/0 to be re-added on r1")
+ routes = {"::/0": {}}
+ expect_ospfv3_routes("r1", routes, wait=30, type="inter-area")
+
+
def teardown_module(_mod):
"Teardown the pytest environment"
tgen = get_topogen()