Skip to content

Commit bd300e4

Browse files
yejianquangshemesh2
authored andcommitted
[sanity_check] Fix bgp recovery for multi-asic devices (sonic-net#19441)
Description of PR Summary: Fixes #33668010 systemctl restart bgp.service fails on multi-asic devices. Enhacne and add compatible logic for multi-asic devices. Type of change Bug fix Testbed and Framework(new/improvement) New Test case Skipped for non-supported platforms Test case improvement Back port request 202205 202305 202311 202405 202411 202505 Approach What is the motivation for this PR? systemctl restart bgp.service fails on multi-asic devices. How did you do it? Enhacne and add compatible logic for multi-asic devices. How did you verify/test it? https://elastictest.org/scheduler/testplan/686a3db4c452a23450444da8?testcase=test_pretest.py%7C%7C%7Cvms-kvm-four-asic-t1-lag_219086&type=log image signed-off-by: [email protected] Signed-off-by: Guy Shemesh <[email protected]>
1 parent 478940b commit bd300e4

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
@@ -185,7 +185,12 @@ def _check_default_route(version, dut):
185185
def _restart_bgp(dut):
186186
# Restart BGP service
187187
try:
188-
dut.command("systemctl restart bgp.service")
188+
if dut.is_multi_asic:
189+
with SafeThreadPoolExecutor(max_workers=8) as executor:
190+
for asic in range(dut.num_asics()):
191+
executor.submit(dut.command, f"systemctl restart bgp@{asic}.service")
192+
else:
193+
dut.command("systemctl restart bgp.service")
189194
except RunAnsibleModuleFail as e:
190195
logger.error("Failed to restart BGP service on %s: %s" % (dut.hostname, str(e)))
191196
return False

0 commit comments

Comments
 (0)