From 8809141b1cb5046ba05a936f890f0f82320c0ed8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= Date: Tue, 8 Oct 2024 18:46:49 +0200 Subject: [PATCH] test: ospf_multiarea: Test interface type point-to-point and router-id Test point-to-point on /30-links, verify the interface type set explicit-router-id and verify that it gets set and sent over OSPF. --- .../ietf_routing/ospf_multiarea/Readme.adoc | 7 ++++++- test/case/ietf_routing/ospf_multiarea/test.py | 21 ++++++++++++++----- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/test/case/ietf_routing/ospf_multiarea/Readme.adoc b/test/case/ietf_routing/ospf_multiarea/Readme.adoc index 984279087..04321cc6a 100644 --- a/test/case/ietf_routing/ospf_multiarea/Readme.adoc +++ b/test/case/ietf_routing/ospf_multiarea/Readme.adoc @@ -1,9 +1,12 @@ === OSPF with multiple areas ==== Description -This test test alot of features inside OSPF using 3 areas (one NSSA area) +This test test alot of features inside OSPF using 3 areas (one NSSA area, with no summary) to test the distribution of routes is deterministic (using cost), also test link breaks using BFD (not implemented in infamy though) +This test also verify broadcast and point-to-point interface type on /30 network and +explicit router-id. + ==== Topology ifdef::topdoc[] image::../../test/case/ietf_routing/ospf_multiarea/topology.png[OSPF with multiple areas topology] @@ -21,6 +24,8 @@ endif::topdoc[] . Wait for all neighbor to peer . Wait for routes from OSPF on all routers . Verify Area 0.0.0.1 on R3 is NSSA area +. Verify R1:ring2 is of type point-to-point +. Verify R4:ring1 is of type point-to-point . Verify on R3, there are no routes beyond 10.0.23.1, just a default route . Testing connectivitiy through NSSA area, from PC:data3 to 11.0.8.1 . Verify that the route to 10.0.0.3 from PC:data4, go through 10.0.41.2 diff --git a/test/case/ietf_routing/ospf_multiarea/test.py b/test/case/ietf_routing/ospf_multiarea/test.py index ee846ef0c..5c478ff1b 100755 --- a/test/case/ietf_routing/ospf_multiarea/test.py +++ b/test/case/ietf_routing/ospf_multiarea/test.py @@ -28,9 +28,12 @@ """ OSPF with multiple areas -This test test alot of features inside OSPF using 3 areas (one NSSA area) +This test test alot of features inside OSPF using 3 areas (one NSSA area, with no summary) to test the distribution of routes is deterministic (using cost), also test link breaks using BFD (not implemented in infamy though) + +This test also verify broadcast and point-to-point interface type on /30 network and +explicit router-id. """ import infamy @@ -137,7 +140,8 @@ def config_target1(target, ring1, ring2, cross): }, "name": ring2, "hello-interval": 1, - "enabled": True + "enabled": True, + "interface-type": "point-to-point" }, { "name": "lo", @@ -239,7 +243,7 @@ def config_target2(target, ring1, ring2, cross): "type": "infix-routing:ospfv2", "name": "default", "ospf": { - "explicit-router-id": "10.0.0.2", + "explicit-router-id": "1.1.1.1", "areas": { "area": [{ "area-id": "0.0.0.0", @@ -471,7 +475,8 @@ def config_target4(target, ring1, cross, link): }, "name": ring1, "hello-interval": 1, - "enabled": True + "enabled": True, + "interface-type": "point-to-point" }, { "bfd": { "enabled": True @@ -536,7 +541,7 @@ def disable_link(target, link): with test.step("Wait for all neighbor to peer"): print("Waiting for neighbors to peer") - until(lambda: route.ospf_get_neighbor(R1, "0.0.0.0", R1ring1, "10.0.0.2"), attempts=200) + until(lambda: route.ospf_get_neighbor(R1, "0.0.0.0", R1ring1, "1.1.1.1"), attempts=200) until(lambda: route.ospf_get_neighbor(R1, "0.0.0.1", R1cross, "10.0.0.3"), attempts=200) until(lambda: route.ospf_get_neighbor(R2, "0.0.0.1", R2ring1, "10.0.0.3"), attempts=200) until(lambda: route.ospf_get_neighbor(R2, "0.0.0.0", R2ring2, "10.0.0.1"), attempts=200) @@ -559,6 +564,12 @@ def disable_link(target, link): with test.step("Verify Area 0.0.0.1 on R3 is NSSA area"): assert(route.ospf_is_area_nssa(R3, "0.0.0.1")) + with test.step("Verify R1:ring2 is of type point-to-point"): + assert(route.ospf_get_interface_type(R1, "0.0.0.2", R1ring2) == "point-to-point") + + with test.step("Verify R4:ring1 is of type point-to-point"): + assert(route.ospf_get_interface_type(R4, "0.0.0.2", R4ring1) == "point-to-point") + with test.step("Verify on R3, there are no routes beyond 10.0.23.1, just a default route"): # Should be only default route out of the area. parallel(until(lambda: route.ipv4_route_exist(R3, "0.0.0.0/0"), attempts=200),