Closed cyw233 closed 5 days ago
Nice catch! @cyw233 Just wonder why we didn't meet this issue on 202305....
Cherry-pick PR to 202405: https://github.com/sonic-net/sonic-mgmt/pull/13487
Nice catch! @cyw233 Just wonder why we didn't meet this issue on 202305....
Yeah...It's actually not easy to run into this problem because we have to run the tests with a multi-asic Testbed AND trigger the recovery process. I think we are very lucky that we didn't run into this in our 202305 T2 run.
Description of PR
Add multi asic support when
wait_for_bgp
is True intests/common/config_reload.py
Summary: Fixes # (issue) Microsoft ADO 28459397
Type of change
Back port request
Approach
What is the motivation for this PR?
Currently, if
wait_for_bgp
is True here intests/common/config_reload.py
, a multi-asic Testbed might never meet thecheck_bgp_session_state
check. This is due to the restrictions of the show ip bgp command. For example, we have the following output for theshow ip bgp summary -d all
command:We can see there are multiple
3.3.3.3
neighbors in the output, and this is because3.3.3.3
is the neighbor for each ASIC. However, when we try to get thebgp_neighbors
here from the get_bgp_neighbors() function, we actually update the dictionary with all ASICs. Therefore, when we compare the length betweenneigh_ips
andneigh_ok
in check_bgp_session_state(), they will never be equal, becauseneigh_ips
doesn't contain duplicates whileneigh_ok
contains duplicates, for a mutli-asic testbed.How did you do it?
I updated the
config_reload()
function with multi asic support within theif wait_for_bgp:
statement.How did you verify/test it?
I manually put
config_reload(..., wait_for_bgp=True)
in a random test case and ran this test case in a multi-asic testbed (a T2 device). I can confirm this timeconfig_reload(..., wait_for_bgp=True)
passed.Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation