sonic-mgmt
sonic-mgmt copied to clipboard
[dualtor] Fix flakiness of route/test_static_route.py
Description of PR
Summary: Fix flakiness of route/test_static_route.py due to packet going to unexpected ToR Fixes # https://github.com/aristanetworks/sonic-qual.msft/issues/230
Type of change
- [x] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [ ] Test case(new/improvement)
Back port request
- [ ] 202012
- [ ] 202205
- [ ] 202305
- [x] 202311
- [x] 202405
Approach
What is the motivation for this PR?
As part of traffic verification, sometimes packet is going out of wrong ToR and causing test failures with signature something like AssertionError: Received expected packet on port 30 for device 0, but it should have arrived on one of these ports: [52, 0, 36].
Reason being, in case of dualtor-aa, both the duts will be in active state and packet can go out of rand_unselected_dut.
How did you do it?
- Added
setup_standby_ports_on_rand_unselected_torfixture to setup ports in standby mode in case of active-active topology. This is needed for packets not to go out of unexpected tor and cause test failures. - Test is performing "config_reload", this can cause switchover (active to standy and viceversa). But
rand_selected_dutshould be in active state for traffic verification to pass, so after config_reload we need to toggle ports to rand_selected_dut.
How did you verify/test it?
Stressed the test on Arista-7260CX3-D108C8 and test is passing.
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation
/azp run Azure.sonic-mgmt
Azure Pipelines successfully started running 1 pipeline(s).
Hi @lolyu @StormLiangMS Please review the changes. Thanks!
hi @vkjammala-arista there is a conflict, could you help with?
hi @vkjammala-arista there is a conflict, could you help with?
Resolved the conflict, thanks!
Cherry-pick PR to 202405: https://github.com/sonic-net/sonic-mgmt/pull/14645
Cherry-pick PR to 202311: https://github.com/sonic-net/sonic-mgmt/pull/14646