sonic-mgmt icon indicating copy to clipboard operation
sonic-mgmt copied to clipboard

[dualtor] Fix flakiness of route/test_static_route.py

Open vkjammala-arista opened this issue 1 year ago • 2 comments

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?

  1. Added setup_standby_ports_on_rand_unselected_tor fixture 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.
  2. Test is performing "config_reload", this can cause switchover (active to standy and viceversa). But rand_selected_dut should 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

vkjammala-arista avatar Aug 21 '24 19:08 vkjammala-arista

/azp run Azure.sonic-mgmt

StormLiangMS avatar Aug 29 '24 04:08 StormLiangMS

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Aug 29 '24 04:08 azure-pipelines[bot]

Hi @lolyu @StormLiangMS Please review the changes. Thanks!

vkjammala-arista avatar Sep 18 '24 03:09 vkjammala-arista

hi @vkjammala-arista there is a conflict, could you help with?

StormLiangMS avatar Sep 18 '24 04:09 StormLiangMS

hi @vkjammala-arista there is a conflict, could you help with?

Resolved the conflict, thanks!

vkjammala-arista avatar Sep 18 '24 07:09 vkjammala-arista

Cherry-pick PR to 202405: https://github.com/sonic-net/sonic-mgmt/pull/14645

mssonicbld avatar Sep 19 '24 03:09 mssonicbld

Cherry-pick PR to 202311: https://github.com/sonic-net/sonic-mgmt/pull/14646

mssonicbld avatar Sep 19 '24 03:09 mssonicbld