Skip to content

Commit 4ab6783

Browse files
authored
Merge branch 'FRRouting:master' into master
2 parents ca6e77f + ec3e59c commit 4ab6783

5 files changed

Lines changed: 121 additions & 0 deletions

File tree

tests/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ frr_northbound*
1515
/isisd/test_fuzz_isis_tlv
1616
/isisd/test_fuzz_isis_tlv_tests.h
1717
/isisd/test_isis_lspdb
18+
/isisd/test_isis_remove_excess_adjs
1819
/isisd/test_isis_spf
1920
/isisd/test_isis_vertex_queue
2021
/lib/cli/test_cli

tests/topotests/zebra_mtu_ipv6_change/__init__.py

Whitespace-only changes.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
!
2+
interface r1-eth0
3+
ip address 10.0.0.1/30
4+
!
5+
router bgp 65000
6+
no bgp ebgp-requires-policy
7+
neighbor 10.0.0.2 remote-as 65000
8+
neighbor 10.0.0.2 timers 1 3
9+
neighbor 10.0.0.2 timers connect 1
10+
address-family ipv6 unicast
11+
neighbor 10.0.0.2 activate
12+
exit-address-family
13+
!
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
!
2+
interface r2-eth0
3+
ip address 10.0.0.2/30
4+
!
5+
router bgp 65000
6+
no bgp ebgp-requires-policy
7+
neighbor 10.0.0.1 remote-as 65000
8+
neighbor 10.0.0.1 timers 1 3
9+
neighbor 10.0.0.1 timers connect 1
10+
address-family ipv6 unicast
11+
network fdfd::/64
12+
neighbor 10.0.0.1 activate
13+
exit-address-family
14+
!
15+
ipv6 route fdfd::/64 blackhole
16+
!
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
#!/usr/bin/env python
2+
# SPDX-License-Identifier: ISC
3+
#
4+
# Copyright (c) 2026 by
5+
# Donatas Abraitis <donatas@opensourcerouting.org>
6+
#
7+
8+
import os
9+
import sys
10+
import json
11+
import pytest
12+
import functools
13+
14+
CWD = os.path.dirname(os.path.realpath(__file__))
15+
sys.path.append(os.path.join(CWD, "../"))
16+
17+
# pylint: disable=C0413
18+
from lib import topotest
19+
from lib.topogen import Topogen, get_topogen
20+
from lib.common_config import step
21+
22+
pytestmark = [pytest.mark.bgpd]
23+
24+
25+
def setup_module(mod):
26+
topodef = {"s1": ("r1", "r2")}
27+
tgen = Topogen(topodef, mod.__name__)
28+
tgen.start_topology()
29+
30+
router_list = tgen.routers()
31+
32+
for _, (rname, router) in enumerate(router_list.items(), 1):
33+
router.load_frr_config(os.path.join(CWD, "{}/frr.conf".format(rname)))
34+
35+
tgen.start_router()
36+
37+
38+
def teardown_module(mod):
39+
tgen = get_topogen()
40+
tgen.stop_topology()
41+
42+
43+
def test_zebra_mtu_ipv6_change():
44+
tgen = get_topogen()
45+
46+
if tgen.routers_have_failure():
47+
pytest.skip(tgen.errors)
48+
49+
r1 = tgen.gears["r1"]
50+
51+
step("Wait for BGP to converge and fdfd::/64 to be installed")
52+
53+
def _bgp_route_installed():
54+
output = json.loads(r1.vtysh_cmd("show bgp ipv6 unicast fdfd::/64 json"))
55+
expected = {"prefix": "fdfd::/64", "paths": [{"valid": True}]}
56+
return topotest.json_cmp(output, expected)
57+
58+
_, result = topotest.run_and_expect(_bgp_route_installed, None, count=60, wait=1)
59+
assert result is None, "fdfd::/64 not installed initially"
60+
61+
def _kernel_route_installed():
62+
output = json.loads(r1.run("ip -6 -j route show fdfd::/64"))
63+
return topotest.json_cmp(
64+
output, [{"dst": "fdfd::/64", "dev": "r1-eth0", "protocol": "bgp"}]
65+
)
66+
67+
_, result = topotest.run_and_expect(_kernel_route_installed, None, count=30, wait=1)
68+
assert result is None, "fdfd::/64 not in kernel initially"
69+
70+
step("Set MTU below IPv6 minimum (1280) — disables IPv6 on the interface")
71+
r1.run("ip link set r1-eth0 mtu 1200")
72+
73+
def _kernel_route_gone():
74+
output = json.loads(r1.run("ip -6 -j route show fdfd::/64"))
75+
if len(output) == 0:
76+
return None
77+
return "fdfd::/64 still in kernel after MTU drop"
78+
79+
_, result = topotest.run_and_expect(_kernel_route_gone, None, count=30, wait=1)
80+
assert result is None, "fdfd::/64 was not removed from kernel after MTU drop"
81+
82+
step("Restore MTU above IPv6 minimum — zebra must reinstall the BGP route")
83+
r1.run("ip link set r1-eth0 mtu 1500")
84+
85+
_, result = topotest.run_and_expect(_kernel_route_installed, None, count=60, wait=1)
86+
assert result is None, "fdfd::/64 was NOT reinstalled after MTU was restored"
87+
88+
89+
if __name__ == "__main__":
90+
args = ["-s"] + sys.argv[1:]
91+
sys.exit(pytest.main(args))

0 commit comments

Comments
 (0)