Skip to content

Commit

Permalink
test: ospf_multiarea: Test interface type point-to-point and router-id
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mattiaswal committed Oct 9, 2024
1 parent f8edd21 commit 8809141
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
7 changes: 6 additions & 1 deletion test/case/ietf_routing/ospf_multiarea/Readme.adoc
Original file line number Diff line number Diff line change
@@ -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]
Expand All @@ -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
Expand Down
21 changes: 16 additions & 5 deletions test/case/ietf_routing/ospf_multiarea/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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),
Expand Down

0 comments on commit 8809141

Please sign in to comment.