Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bgpd: Fix GR when using R-bit with hard reset (adminstrative reset) #18241

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/topotests/bgp_gr_notification/r1/bgpd.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
router bgp 65001
no bgp ebgp-requires-policy
bgp graceful-restart
bgp graceful-restart preserve-fw-state
neighbor 192.168.255.2 remote-as external
neighbor 192.168.255.2 timers 1 3
neighbor 192.168.255.2 timers delayopen 10
Expand Down
29 changes: 29 additions & 0 deletions tests/topotests/bgp_gr_notification/test_bgp_gr_notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,30 @@ def _bgp_check_gr_notification_stale():
}
return topotest.json_cmp(output, expected)

def _bgp_check_gr_notification_stale_kernel():
output = json.loads(r1.vtysh_cmd("show ip route 172.16.255.2/32 json"))
expected = {
"172.16.255.2/32": [
{
"protocol": "bgp",
"selected": True,
"distance": 20,
"metric": 0,
"installed": True,
"nexthops": [
{
"fib": True,
"ip": "192.168.255.2",
"afi": "ipv4",
"interfaceName": "r1-eth0",
"active": True,
}
],
}
]
}
return topotest.json_cmp(output, expected)

def _bgp_clear_r1_and_shutdown():
r2.vtysh_cmd(
"""
Expand Down Expand Up @@ -210,6 +234,11 @@ def _bgp_verify_show_bgp_router_json():
_, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
assert result is None, "Failed to see retained stale routes on R1"

step("Check if stale routes are retained in the kernel on R1")
test_func = functools.partial(_bgp_check_gr_notification_stale_kernel)
_, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
assert result is None, "Failed to see retained stale routes in the kernel on R1"

step("Check if Hard Reset notification wasn't sent from R2")
test_func = functools.partial(_bgp_check_hard_reset)
_, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
Expand Down
Loading