Skip to content

Commit cbf4584

Browse files
lolyumssonicbld
authored andcommitted
[sanity] Fix sanity check bgp not ready after restart (#19296)
Signed-off-by: Longxiang Lyu <[email protected]>
1 parent 1e9bd27 commit cbf4584

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/common/plugins/sanity_check/checks.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,12 @@ def _restart_bgp(dut):
193193

194194
def _check_bgp_status_helper():
195195
asic_check_results = []
196-
bgp_facts = dut.bgp_facts(asic_index='all')
196+
try:
197+
bgp_facts = dut.bgp_facts(asic_index='all')
198+
except Exception as e:
199+
logger.error("Failed to get BGP status on host %s: %s", dut.hostname, repr(e))
200+
check_result['failed'] = True
201+
return False
197202

198203
# Conditions to fail BGP check
199204
# 1. No BGP neighbor.

0 commit comments

Comments
 (0)