[everflow][202511] Skip tests when ASIC does not support bidirectional port mirroring#22709
Open
yxieca wants to merge 1 commit intosonic-net:202511from
Open
[everflow][202511] Skip tests when ASIC does not support bidirectional port mirroring#22709yxieca wants to merge 1 commit intosonic-net:202511from
yxieca wants to merge 1 commit intosonic-net:202511from
Conversation
…irroring Cherry-pick of PR sonic-net#22663 for 202511 branch. Added capability check in setup_mirror_session and policer_mirror_session fixtures. Before creating a mirror session via CLI, the fixtures now query switch_capabilities_facts for PORT_INGRESS_MIRROR_CAPABLE and PORT_EGRESS_MIRROR_CAPABLE. If the required capability is not supported, the test is skipped with a descriptive message. Fixes sonic-net#22661 Signed-off-by: Ying Xie <ying.xie@microsoft.com>
Collaborator
Author
|
This PR was created by an AI agent on behalf of Ying Xie. It is a cherry-pick of #22663 (merged to master) reworked for the 202511 branch. |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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.
What is the motivation for this PR?
Cherry-pick of #22663 for the 202511 branch.
The everflow tests fail on ASICs that do not support bidirectional port mirroring. When
config mirror_session addis called without an explicit--directionflag, SONiC defaults toboth, which requires bothPORT_INGRESS_MIRROR_CAPABLEandPORT_EGRESS_MIRROR_CAPABLEto betrueinSTATE_DB SWITCH_CAPABILITY|switch. On ASICs that don't support both directions, the command fails with:This causes test failures unrelated to the test logic itself.
Fixes #22661
How did you do it?
Added a capability check in the
setup_mirror_sessionandpolicer_mirror_sessionfixtures ineverflow_test_utilities.py. Before attempting to create a mirror session via CLI, the fixtures now queryswitch_capabilities_factsforPORT_INGRESS_MIRROR_CAPABLEandPORT_EGRESS_MIRROR_CAPABLE. If either capability is nottrue, the test is skipped with a descriptive message.The check is only applied for
CONFIG_MODE_CLIsince the direct DB write path (used for IPv6 ERSPAN) bypasses the CLI validation.How did you verify/test it?
config/main.pyconfirmsis_port_mirror_capability_supported()checks these exact fields when direction isNone(defaults to 'both')truewhen not present in STATE_DB)Signed-off-by: Ying Xie ying.xie@microsoft.com