diff options
author | Pooja Jagadeesh Doijode <pdoijode@nvidia.com> | 2024-06-27 02:34:44 +0200 |
---|---|---|
committer | Pooja Jagadeesh Doijode <pdoijode@nvidia.com> | 2024-07-01 22:02:52 +0200 |
commit | ecbca1ae1be5e4e3f68bc712696f28d01909803c (patch) | |
tree | 730882490f33171fad4f1ebd27543031512882c8 /tests/topotests/lib | |
parent | bgpd: Refine debug logs for zebra GR registration (diff) | |
download | frr-ecbca1ae1be5e4e3f68bc712696f28d01909803c.tar.xz frr-ecbca1ae1be5e4e3f68bc712696f28d01909803c.zip |
tests: Updated topotest and documentation
Added topotest and documentation for BGP wide GR configurations
Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
Diffstat (limited to 'tests/topotests/lib')
-rw-r--r-- | tests/topotests/lib/bgp.py | 77 |
1 files changed, 60 insertions, 17 deletions
diff --git a/tests/topotests/lib/bgp.py b/tests/topotests/lib/bgp.py index 4250c405f..3f4ed6e0b 100644 --- a/tests/topotests/lib/bgp.py +++ b/tests/topotests/lib/bgp.py @@ -3266,27 +3266,48 @@ def verify_graceful_restart( lmode = None rmode = None - # Local GR mode - if "address_family" in input_dict[dut]["bgp"]: - bgp_neighbors = input_dict[dut]["bgp"]["address_family"][addr_type][ - "unicast" - ]["neighbor"][peer]["dest_link"] - for dest_link, data in bgp_neighbors.items(): + # Local GR mode + if "bgp" not in input_dict[dut] and "graceful-restart" in input_dict[dut]: if ( - "graceful-restart-helper" in data - and data["graceful-restart-helper"] + "graceful-restart" in input_dict[dut]["graceful-restart"] + and input_dict[dut]["graceful-restart"][ + "graceful-restart" + ] ): - lmode = "Helper" - elif "graceful-restart" in data and data["graceful-restart"]: - lmode = "Restart" + lmode = "Restart*" elif ( - "graceful-restart-disable" in data - and data["graceful-restart-disable"] + "graceful-restart-disable" + in input_dict[dut]["graceful-restart"] + and input_dict[dut]["graceful-restart"][ + "graceful-restart-disable" + ] ): - lmode = "Disable" + lmode = "Disable*" else: - lmode = None + lmode = "Helper*" + + if lmode is None: + if "address_family" in input_dict[dut]["bgp"]: + bgp_neighbors = input_dict[dut]["bgp"]["address_family"][addr_type][ + "unicast" + ]["neighbor"][peer]["dest_link"] + + for dest_link, data in bgp_neighbors.items(): + if ( + "graceful-restart-helper" in data + and data["graceful-restart-helper"] + ): + lmode = "Helper" + elif "graceful-restart" in data and data["graceful-restart"]: + lmode = "Restart" + elif ( + "graceful-restart-disable" in data + and data["graceful-restart-disable"] + ): + lmode = "Disable" + else: + lmode = None if lmode is None: if "graceful-restart" in input_dict[dut]["bgp"]: @@ -3314,7 +3335,8 @@ def verify_graceful_restart( return True # Remote GR mode - if "address_family" in input_dict[peer]["bgp"]: + + if "bgp" in input_dict[peer] and "address_family" in input_dict[peer]["bgp"]: bgp_neighbors = input_dict[peer]["bgp"]["address_family"][addr_type][ "unicast" ]["neighbor"][dut]["dest_link"] @@ -3336,7 +3358,7 @@ def verify_graceful_restart( rmode = None if rmode is None: - if "graceful-restart" in input_dict[peer]["bgp"]: + if "bgp" in input_dict[peer] and "graceful-restart" in input_dict[peer]["bgp"]: if ( "graceful-restart" in input_dict[peer]["bgp"]["graceful-restart"] @@ -3355,6 +3377,27 @@ def verify_graceful_restart( rmode = "Disable" else: rmode = "Helper" + + if rmode is None: + if "bgp" not in input_dict[peer] and "graceful-restart" in input_dict[peer]: + if ( + "graceful-restart" + in input_dict[peer]["graceful-restart"] + and input_dict[peer]["graceful-restart"][ + "graceful-restart" + ] + ): + rmode = "Restart" + elif ( + "graceful-restart-disable" + in input_dict[peer]["graceful-restart"] + and input_dict[peer]["graceful-restart"][ + "graceful-restart-disable" + ] + ): + rmode = "Disable" + else: + rmode = "Helper" else: rmode = "Helper" |