#
"""
-Test if BGP graceful restart capability's restart time and notification
-flag are exchanged dynamically.
+Test if BGP graceful restart / long-lived graceful restart capabilities
+(restart time, stale time and notification flag) are exchanged dynamically
+via BGP dynamic capability.
"""
import os
"neighborCapabilities": {
"dynamic": "advertisedAndReceived",
"gracefulRestart": "advertisedAndReceived",
+ "longLivedGracefulRestart": "advertisedAndReceived",
},
"gracefulRestartInfo": {
"nBit": True,
"timers": {
"receivedRestartTimer": 120,
+ "configuredLlgrStaleTime": 10,
+ },
+ "ipv4Unicast": {
+ "timers": {
+ "llgrStaleTime": 10,
+ }
},
},
"connectionsEstablished": 1,
_, result = topotest.run_and_expect(test_func, None, count=30, wait=1)
assert result is None, "Can't converge"
- step("Change Graceful-Restart restart-time, and check if it's changed dynamically")
+ step(
+ "Change Graceful-Restart restart-time, LLGR stale-time and check if they changed dynamically"
+ )
r2.vtysh_cmd(
"""
configure terminal
router bgp
bgp graceful-restart restart-time 123
+ bgp long-lived-graceful-restart stale-time 5
"""
)
- def _bgp_check_if_session_not_reset_after_changing_restart_time():
+ def _bgp_check_if_session_not_reset_after_changing_gr_settings():
output = json.loads(r1.vtysh_cmd("show bgp neighbor json"))
expected = {
"192.168.1.2": {
"neighborCapabilities": {
"dynamic": "advertisedAndReceived",
"gracefulRestart": "advertisedAndReceived",
+ "longLivedGracefulRestart": "advertisedAndReceived",
},
"gracefulRestartInfo": {
"nBit": True,
"timers": {
"receivedRestartTimer": 123,
+ "configuredLlgrStaleTime": 10,
+ },
+ "ipv4Unicast": {
+ "timers": {
+ "llgrStaleTime": 5,
+ }
},
},
"connectionsEstablished": 1,
return topotest.json_cmp(output, expected)
test_func = functools.partial(
- _bgp_check_if_session_not_reset_after_changing_restart_time,
+ _bgp_check_if_session_not_reset_after_changing_gr_settings,
)
_, result = topotest.run_and_expect(test_func, None, count=30, wait=1)
assert (
"neighborCapabilities": {
"dynamic": "advertisedAndReceived",
"gracefulRestart": "advertisedAndReceived",
+ "longLivedGracefulRestart": "advertisedAndReceived",
},
"gracefulRestartInfo": {
"nBit": False,
"timers": {
"receivedRestartTimer": 123,
+ "configuredLlgrStaleTime": 10,
+ },
+ "ipv4Unicast": {
+ "timers": {
+ "llgrStaleTime": 5,
+ }
},
},
"connectionsEstablished": 1,