Fix the mux active/standby change issue for dualtor FIB testing#3502
Merged
wangxin merged 1 commit intosonic-net:masterfrom May 25, 2021
Merged
Fix the mux active/standby change issue for dualtor FIB testing#3502wangxin merged 1 commit intosonic-net:masterfrom
wangxin merged 1 commit intosonic-net:masterfrom
Conversation
On dualtor testbed, the active/standby status may be changed while the PTF script is running.
Consequently the PTF script testing FIB may fail.
The reason of active/standby change is that no ICMP responder is running in PTF to simulate
servers. Then status of the muxes are unhealthy and link manager may try to recover the muxes
by switching the active/standby side.
The fix is to start ICMP responder befor the FIB testing to avoid mux active/standby state flap.
Another logic issue of the FIB testing is getting active side of the DUT index. The issue is fixed
by changing:
if not target_dut_index:
to:
if target_dut_index is None:
Initializing `target_mac` also has the similiar issue and is fixed in the same way.
The third fix is to change `ptf_test_port_map` and `get_mux_status` from fixture
to function. These two functions depends on fixtures like `set_mux_random`
and `set_mux_same_side`. The execution sequence matters. If they are all
fixtures, changing the sequence of using the fixtures in test function argument
list may affect the test logic and cause issues that are hard to debug.
Making two of them to function calls can avoid this potential volunerability.
Signed-off-by: Xin Wang <xiwang5@microsoft.com>
Collaborator
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
yxieca
approved these changes
May 20, 2021
vmittal-msft
pushed a commit
to vmittal-msft/sonic-mgmt
that referenced
this pull request
Sep 28, 2021
…c-net#3502) On dualtor testbed, the active/standby status may be changed while the PTF script is running. Consequently the PTF script testing FIB may fail. The reason of active/standby change is that no ICMP responder is running in PTF to simulate servers. Then status of the muxes are unhealthy and link manager may try to recover the muxes by switching the active/standby side. The fix is to start ICMP responder befor the FIB testing to avoid mux active/standby state flap. Another logic issue of the FIB testing is getting active side of the DUT index. The issue is fixed by changing: if not target_dut_index: to: if target_dut_index is None: Initializing `target_mac` also has the similiar issue and is fixed in the same way. The third fix is to change `ptf_test_port_map` and `get_mux_status` from fixture to function. These two functions depends on fixtures like `set_mux_random` and `set_mux_same_side`. The execution sequence matters. If they are all fixtures, changing the sequence of using the fixtures in test function argument list may affect the test logic and cause issues that are hard to debug. Making two of them to function calls can avoid this potential volunerability. Signed-off-by: Xin Wang <xiwang5@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of PR
Summary:
Fixes # (issue)
Type of change
Approach
What is the motivation for this PR?
On dualtor testbed, the active/standby status may be changed while the PTF script is running.
Consequently the PTF script testing FIB may fail.
The reason of active/standby change is that no ICMP responder is running in PTF to simulate
servers. Then status of the muxes are unhealthy and link manager may try to recover the muxes
by switching the active/standby side.
The fix is to start ICMP responder befor the FIB testing to avoid mux active/standby state flapping.
Another logic issue of the FIB testing is getting active side of the DUT index. The issue is fixed
by changing:
to:
Initializing
target_macalso has the similiar issue and is fixed in the same way.The third fix is to change
ptf_test_port_mapandget_mux_statusfrom fixtureto function. These two functions depends on fixtures like
set_mux_randomand
set_mux_same_side. The execution sequence matters. If they are allfixtures, changing the sequence of using the fixtures in test function argument
list may affect the test logic and cause issues that are hard to debug.
Making two of them to function calls can avoid this potential vulnerability.
How did you do it?
How did you verify/test it?
Test run the script on both dual ToR and single ToR testbeds.
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation