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

Add check to see if bgp sessions are up before proceeding with the tests #15921

Merged
merged 1 commit into from
Dec 6, 2024
Merged
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
16 changes: 7 additions & 9 deletions tests/acl/test_acl.py
Original file line number Diff line number Diff line change
Expand Up @@ -1314,19 +1314,11 @@ def post_setup_hook(self, dut, localhost, populate_vlan_arp_entries, tbinfo, con

"""
dut.command("config save -y")
up_bgp_neighbors = dut.get_bgp_neighbors_per_asic("established")
reboot(dut, localhost, safe_reboot=True, check_intf_up_ports=True)
# We need some additional delay on e1031
if dut.facts["platform"] == "x86_64-cel_e1031-r0":
time.sleep(240)
if 't1' in tbinfo["topo"]["name"] or 'm0' in tbinfo["topo"]["name"]:
# Wait BGP sessions up on T1 as we saw BGP sessions to T0
# established later than T2
bgp_neighbors = dut.get_bgp_neighbors()
pytest_assert(
wait_until(120, 10, 0, dut.check_bgp_session_state, list(bgp_neighbors.keys())),
"Not all bgp sessions are established after reboot")
# Delay 10 seconds for route convergence
time.sleep(10)
# We need additional delay and make sure ports are up for Nokia-IXR7250E-36x400G
if dut.facts["hwsku"] == "Nokia-IXR7250E-36x400G":
interfaces = conn_graph_facts["device_conn"][dut.hostname]
Expand All @@ -1339,6 +1331,12 @@ def post_setup_hook(self, dut, localhost, populate_vlan_arp_entries, tbinfo, con
assert result, "Not all transceivers are detected or interfaces are up in {} seconds".format(
MAX_WAIT_TIME_FOR_INTERFACES)

pytest_assert(
wait_until(300, 10, 0, dut.check_bgp_session_state_all_asics, up_bgp_neighbors, "established"),
"All BGP sessions are not up after reboot, no point in continuing the test")
# Delay 10 seconds for route convergence
time.sleep(10)

populate_vlan_arp_entries()


Expand Down
Loading