[platform_tests: Enhance SFP reset test to handle ports with unplugged optics and diverse transceiver types]#19691
Open
YatishSVC wants to merge 6 commits intosonic-net:masterfrom
Open
Conversation
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
mihirpat1
reviewed
Jul 17, 2025
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
mihirpat1
previously approved these changes
Jul 18, 2025
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
mihirpat1
reviewed
Aug 1, 2025
tests/platform_tests/api/test_sfp.py
Outdated
| continue | ||
| info_dict = port_index_to_info_dict[sfp_port_idx] | ||
|
|
||
| # flap ports if they support LPMODE, or if they’re in the known-skip list (e.g. Cloud Light) |
Contributor
There was a problem hiding this comment.
@YatishSVC Can we create a function for this so that we don't have to duplicate
sonic-mgmt/tests/platform_tests/api/test_sfp.py
Lines 334 to 340 in 30fd679
Contributor
Author
There was a problem hiding this comment.
Thanks for the suggestion @mihirpat1,
made the changes now accordingly.
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
tjchadaga
previously approved these changes
Aug 1, 2025
mihirpat1
reviewed
Aug 1, 2025
tests/platform_tests/api/test_sfp.py
Outdated
| return 0.3 | ||
| return 0 | ||
|
|
||
| def is_in_lpmode_skip_list(self, xcvr_info_dict): |
Contributor
There was a problem hiding this comment.
Suggested change
| def is_in_lpmode_skip_list(self, xcvr_info_dict): | |
| def should_skip_lpmode_check(self, xcvr_info_dict): |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
|
@yatishkoul LGTM |
arlakshm
pushed a commit
to Azure/sonic-mgmt.msft
that referenced
this pull request
Aug 11, 2025
…ptics (#635) Cherry pick conflicts, so created new pull request. Pr's: sonic-net/sonic-mgmt#18772 sonic-net/sonic-mgmt#20120 sonic-net/sonic-mgmt#19691 Adding a check for Cloudlight optics. Adding multi asic support for test_reset Co-authored-by: yatishkoul <[email protected]>
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
This PR improves the test_reset method in the SFP platform API test suite to ensure compatibility across different transceiver types and testbed setups where not all ports may have optics plugged in.
Skip Transceivers with No Optic Plugged In:
Added a check for None return from sfp.get_transceiver_info(...) to gracefully skip transceivers with no optic inserted.
This avoids false negatives in test assertions due to missing optics.
Introduced a combined check:
if "cmis_rev" in info_dict or self.is_xcvr_support_lpmode(info_dict):
This ensured that all types of transceivers used in the test setup (including QSFP28, QSFP-DD, and CMIS-compliant optics) were flapped appropriately and recovered successfully.
Summary:
Fixes # (issue)
Type of change
Back port request
Approach
What is the motivation for this PR?
To fix failures in test_sfp.py
How did you do it?
By adding conditional checks
How did you verify/test it?
Ran in Msft Lab
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation