Skip to content

Commit

Permalink
tests: Add OSPF test for issue 14488
Browse files Browse the repository at this point in the history
OSPF on IPv4/IPv6 removes the wrong routes in certain cases, causing
issues when removing and re-enabling interfaces. This test proofs that.

These tests all pass with #13340
and the latest master (d2324b7).

See #14488

Signed-off-by: Denis Krienbühl <[email protected]>
  • Loading branch information
href committed Oct 12, 2023
1 parent d2324b7 commit afbfcae
Show file tree
Hide file tree
Showing 8 changed files with 583 additions and 0 deletions.
Empty file.
61 changes: 61 additions & 0 deletions tests/topotests/ospf_topo2/r1/frr.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
frr defaults traditional
hostname r1
log syslog informational
service integrated-vtysh-config
!
ip router-id 192.0.2.1
!
interface eth1
ip address 192.0.2.1/32
ip ospf area 0.0.0.0
ip ospf dead-interval minimal hello-multiplier 4
ip ospf network point-to-point
ipv6 address 2001:db8::1/128
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 dead-interval 4
ipv6 ospf6 hello-interval 1
ipv6 ospf6 network point-to-point
exit
!
interface eth2
ip address 192.0.2.1/32
ip ospf area 0.0.0.0
ip ospf dead-interval minimal hello-multiplier 4
ip ospf network point-to-point
ipv6 address 2001:db8::1/128
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 dead-interval 4
ipv6 ospf6 hello-interval 1
ipv6 ospf6 network point-to-point
exit
!
interface eth3
ip address 192.0.2.1/32
ip ospf area 0.0.0.0
ip ospf dead-interval minimal hello-multiplier 4
ip ospf network point-to-point
ipv6 address 2001:db8::1/128
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 dead-interval 4
ipv6 ospf6 hello-interval 1
ipv6 ospf6 network point-to-point
exit
!
interface lo
ip address 192.0.2.1/32
ip ospf area 0.0.0.0
ip ospf passive
ipv6 address 2001:db8::1/128
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 passive
exit
!
router ospf
log-adjacency-changes
exit
!
router ospf6
log-adjacency-changes
exit
!
end
61 changes: 61 additions & 0 deletions tests/topotests/ospf_topo2/r2/frr.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
frr defaults traditional
hostname r2
log syslog informational
service integrated-vtysh-config
!
ip router-id 192.0.2.2
!
interface eth1
ip address 192.0.2.2/32
ip ospf area 0.0.0.0
ip ospf dead-interval minimal hello-multiplier 4
ip ospf network point-to-point
ipv6 address 2001:db8::2/128
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 dead-interval 4
ipv6 ospf6 hello-interval 1
ipv6 ospf6 network point-to-point
exit
!
interface eth2
ip address 192.0.2.2/32
ip ospf area 0.0.0.0
ip ospf dead-interval minimal hello-multiplier 4
ip ospf network point-to-point
ipv6 address 2001:db8::2/128
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 dead-interval 4
ipv6 ospf6 hello-interval 1
ipv6 ospf6 network point-to-point
exit
!
interface eth3
ip address 192.0.2.2/32
ip ospf area 0.0.0.0
ip ospf dead-interval minimal hello-multiplier 4
ip ospf network point-to-point
ipv6 address 2001:db8::2/128
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 dead-interval 4
ipv6 ospf6 hello-interval 1
ipv6 ospf6 network point-to-point
exit
!
interface lo
ip address 192.0.2.2/32
ip ospf area 0.0.0.0
ip ospf passive
ipv6 address 2001:db8::2/128
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 passive
exit
!
router ospf
log-adjacency-changes
exit
!
router ospf6
log-adjacency-changes
exit
!
end
61 changes: 61 additions & 0 deletions tests/topotests/ospf_topo2/r3/frr.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
frr defaults traditional
hostname r3
log syslog informational
service integrated-vtysh-config
!
ip router-id 192.0.2.3
!
interface eth1
ip address 192.0.2.3/32
ip ospf area 0.0.0.0
ip ospf dead-interval minimal hello-multiplier 4
ip ospf network point-to-point
ipv6 address 2001:db8::3/128
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 dead-interval 4
ipv6 ospf6 hello-interval 1
ipv6 ospf6 network point-to-point
exit
!
interface eth2
ip address 192.0.2.3/32
ip ospf area 0.0.0.0
ip ospf dead-interval minimal hello-multiplier 4
ip ospf network point-to-point
ipv6 address 2001:db8::3/128
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 dead-interval 4
ipv6 ospf6 hello-interval 1
ipv6 ospf6 network point-to-point
exit
!
interface eth3
ip address 192.0.2.3/32
ip ospf area 0.0.0.0
ip ospf dead-interval minimal hello-multiplier 4
ip ospf network point-to-point
ipv6 address 2001:db8::3/128
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 dead-interval 4
ipv6 ospf6 hello-interval 1
ipv6 ospf6 network point-to-point
exit
!
interface lo
ip address 192.0.2.3/32
ip ospf area 0.0.0.0
ip ospf passive
ipv6 address 2001:db8::3/128
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 passive
exit
!
router ospf
log-adjacency-changes
exit
!
router ospf6
log-adjacency-changes
exit
!
end
61 changes: 61 additions & 0 deletions tests/topotests/ospf_topo2/r4/frr.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
frr defaults traditional
hostname r4
log syslog informational
service integrated-vtysh-config
!
ip router-id 192.0.2.4
!
interface eth1
ip address 192.0.2.4/32
ip ospf area 0.0.0.0
ip ospf dead-interval minimal hello-multiplier 4
ip ospf network point-to-point
ipv6 address 2001:db8::4/128
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 dead-interval 4
ipv6 ospf6 hello-interval 1
ipv6 ospf6 network point-to-point
exit
!
interface eth2
ip address 192.0.2.4/32
ip ospf area 0.0.0.0
ip ospf dead-interval minimal hello-multiplier 4
ip ospf network point-to-point
ipv6 address 2001:db8::4/128
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 dead-interval 4
ipv6 ospf6 hello-interval 1
ipv6 ospf6 network point-to-point
exit
!
interface eth3
ip address 192.0.2.4/32
ip ospf area 0.0.0.0
ip ospf dead-interval minimal hello-multiplier 4
ip ospf network point-to-point
ipv6 address 2001:db8::4/128
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 dead-interval 4
ipv6 ospf6 hello-interval 1
ipv6 ospf6 network point-to-point
exit
!
interface lo
ip address 192.0.2.4/32
ip ospf area 0.0.0.0
ip ospf passive
ipv6 address 2001:db8::4/128
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 passive
exit
!
router ospf
log-adjacency-changes
exit
!
router ospf6
log-adjacency-changes
exit
!
end
44 changes: 44 additions & 0 deletions tests/topotests/ospf_topo2/test_ospf_topo2.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
graph template {
label="ospf_topo2";
splines = "line"

# Routers
r1 [
shape=doubleoctagon,
label="r1\n192.0.2.1\n2001:db8::1",
fillcolor="#f08080",
style=filled,
];
r2 [
shape=doubleoctagon,
label="r2\n\192.0.2.2\n2001:db8::2",
fillcolor="#f08080",
style=filled,
];
r3 [
shape=doubleoctagon,
label="r3\n192.0.2.3\n2001:db8::3",
fillcolor="#f08080",
style=filled,
];
r4 [
shape=doubleoctagon,
label="r4\n192.0.2.4\n2001:db8::4",
fillcolor="#f08080",
style=filled,
];

# Connections
r1 -- r2 [label="eth1"];
r1 -- r2 [label="eth2"];

r2 -- r3 [label="eth3\neth1"];
r1 -- r4 [label="eth3\neth1"];

r4 -- r3 [label="eth2"];
r4 -- r3 [label="eth3"];

# Group r1 and r2 above, r3 and r4 below
{ rank=min; r1; r2; }
{ rank=max; r3; r4; }
}
Binary file added tests/topotests/ospf_topo2/test_ospf_topo2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit afbfcae

Please sign in to comment.