mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 13:27:53 +00:00
topotests: add tests for OSPFv3 NSSA/Stub
New test verification: * Stub and NSSA areas contain no external routes Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
This commit is contained in:
parent
4f785c075e
commit
d87586c6d6
@ -6,12 +6,18 @@ interface r2-eth1
|
||||
ipv6 ospf6 hello-interval 2
|
||||
ipv6 ospf6 dead-interval 10
|
||||
!
|
||||
interface r2-eth2
|
||||
ipv6 ospf6 hello-interval 2
|
||||
ipv6 ospf6 dead-interval 10
|
||||
!
|
||||
router ospf6
|
||||
ospf6 router-id 10.254.254.2
|
||||
redistribute connected
|
||||
redistribute static
|
||||
default-information originate always metric 123
|
||||
area 0.0.0.1 stub
|
||||
area 0.0.0.2 nssa
|
||||
interface r2-eth0 area 0.0.0.1
|
||||
interface r2-eth1 area 0.0.0.0
|
||||
interface r2-eth2 area 0.0.0.2
|
||||
!
|
||||
|
@ -6,3 +6,6 @@ interface r2-eth0
|
||||
interface r2-eth1
|
||||
ipv6 address 2001:db8:2::2/64
|
||||
!
|
||||
interface r2-eth2
|
||||
ipv6 address 2001:db8:3::1/64
|
||||
!
|
||||
|
9
tests/topotests/ospf6_topo2/r4/ospf6d.conf
Normal file
9
tests/topotests/ospf6_topo2/r4/ospf6d.conf
Normal file
@ -0,0 +1,9 @@
|
||||
interface r4-eth0
|
||||
ipv6 ospf6 hello-interval 2
|
||||
ipv6 ospf6 dead-interval 10
|
||||
!
|
||||
router ospf6
|
||||
ospf6 router-id 10.254.254.4
|
||||
area 0.0.0.2 nssa
|
||||
interface r4-eth0 area 0.0.0.2
|
||||
!
|
5
tests/topotests/ospf6_topo2/r4/zebra.conf
Normal file
5
tests/topotests/ospf6_topo2/r4/zebra.conf
Normal file
@ -0,0 +1,5 @@
|
||||
ipv6 forwarding
|
||||
!
|
||||
interface r4-eth0
|
||||
ipv6 address 2001:db8:3::2/64
|
||||
!
|
@ -34,6 +34,12 @@ graph template {
|
||||
fillcolor="#f08080",
|
||||
style=filled,
|
||||
];
|
||||
r4 [
|
||||
shape=doubleoctagon
|
||||
label="r4",
|
||||
fillcolor="#f08080",
|
||||
style=filled,
|
||||
];
|
||||
|
||||
# Switches
|
||||
sw1 [
|
||||
@ -62,10 +68,16 @@ graph template {
|
||||
}
|
||||
|
||||
subgraph cluster1 {
|
||||
label="area 0.0.0.2";
|
||||
r4 -- sw3 [label="eth0\n.2"];
|
||||
}
|
||||
|
||||
subgraph cluster2 {
|
||||
label="area 0.0.0.0";
|
||||
r2 -- sw1 [label="eth0\n.1"];
|
||||
r2 -- sw2 [label="eth1\n.2"];
|
||||
r2 -- sw3 [label="eth2\n.1"];
|
||||
|
||||
r3 -- sw2 [label="eth0\n.1"];
|
||||
r3 -- sw3 [label="eth1\n.2"];
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 43 KiB |
@ -54,8 +54,8 @@ class OSPFv3Topo2(Topo):
|
||||
"Build function"
|
||||
tgen = get_topogen(self)
|
||||
|
||||
# Create 3 routers
|
||||
for routern in range(1, 4):
|
||||
# Create 4 routers
|
||||
for routern in range(1, 5):
|
||||
tgen.add_router("r{}".format(routern))
|
||||
|
||||
switch = tgen.add_switch("s1")
|
||||
@ -66,6 +66,10 @@ class OSPFv3Topo2(Topo):
|
||||
switch.add_link(tgen.gears["r2"])
|
||||
switch.add_link(tgen.gears["r3"])
|
||||
|
||||
switch = tgen.add_switch("s3")
|
||||
switch.add_link(tgen.gears["r2"])
|
||||
switch.add_link(tgen.gears["r4"])
|
||||
|
||||
|
||||
def setup_module(mod):
|
||||
"Sets up the pytest environment"
|
||||
@ -110,7 +114,52 @@ def test_wait_protocol_convergence():
|
||||
expect_neighbor_full("r1", "10.254.254.2")
|
||||
expect_neighbor_full("r2", "10.254.254.1")
|
||||
expect_neighbor_full("r2", "10.254.254.3")
|
||||
expect_neighbor_full("r2", "10.254.254.4")
|
||||
expect_neighbor_full("r3", "10.254.254.2")
|
||||
expect_neighbor_full("r4", "10.254.254.2")
|
||||
|
||||
|
||||
def test_ospfv3_expected_route_types():
|
||||
"Test routers route type to determine if NSSA/Stub is working as expected."
|
||||
tgen = get_topogen()
|
||||
if tgen.routers_have_failure():
|
||||
pytest.skip(tgen.errors)
|
||||
|
||||
logger.info("waiting for protocols to converge")
|
||||
|
||||
def expect_ospf6_route_types(router, expected_summary):
|
||||
"Expect the correct route types."
|
||||
logger.info("waiting OSPFv3 router '{}'".format(router))
|
||||
test_func = partial(
|
||||
topotest.router_json_cmp,
|
||||
tgen.gears[router],
|
||||
"show ipv6 ospf6 route summary json",
|
||||
expected_summary,
|
||||
)
|
||||
_, result = topotest.run_and_expect(test_func, None, count=10, wait=1)
|
||||
assertmsg = '"{}" convergence failure'.format(router)
|
||||
assert result is None, assertmsg
|
||||
|
||||
# Stub router: no external routes.
|
||||
expect_ospf6_route_types(
|
||||
"r1",
|
||||
{
|
||||
"numberOfIntraAreaRoutes": 1,
|
||||
"numberOfInterAreaRoutes": 3,
|
||||
"numberOfExternal1Routes": 0,
|
||||
"numberOfExternal2Routes": 0,
|
||||
},
|
||||
)
|
||||
# NSSA router: no external routes.
|
||||
expect_ospf6_route_types(
|
||||
"r4",
|
||||
{
|
||||
"numberOfIntraAreaRoutes": 1,
|
||||
"numberOfInterAreaRoutes": 2,
|
||||
"numberOfExternal1Routes": 0,
|
||||
"numberOfExternal2Routes": 0,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
def test_ospf6_default_route():
|
||||
|
Loading…
Reference in New Issue
Block a user