Skip to content

Check DOM for only first subport for test_xcvr_info_in_db.py test.#19170

Merged
prgeor merged 4 commits intosonic-net:masterfrom
az-pz:ariz/update-test-to-check-dom-for-first-subport
Jul 11, 2025
Merged

Check DOM for only first subport for test_xcvr_info_in_db.py test.#19170
prgeor merged 4 commits intosonic-net:masterfrom
az-pz:ariz/update-test-to-check-dom-for-first-subport

Conversation

@az-pz
Copy link
Contributor

@az-pz az-pz commented Jun 24, 2025

Description of PR

Summary: Check DOM for only first subport for test_xcvr_info_in_db.py test
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
    • Skipped for non-supported platforms
  • Test case improvement

Back port request

  • 202205
  • 202305
  • 202311
  • 202405
  • 202411
  • 202505

Approach

Add a helper function to get the first subport of logical ports to check for DOM values.

What is the motivation for this PR?

This PR (sonic-net/sonic-platform-daemons#604) changed the way the DOM data is returned for logical ports. After the change, DOM of a logical port is returned only for the first subport of the physical port.

How did you do it?

  • Added a helper function to get the first subport of logical ports to check for DOM values.
  • Get first subport for all logical ports.
  • Check the DOM for only first subports.
  • Optimize the sonic db query.
  • Skip the pc/test_retry_count.py::test_retry_count test to pass the CI since the test is always failing and has nothing to do with the current change.

How did you verify/test it?

Ran the tests on SN5600 and SN5640 platforms.

Any platform specific information?

NA

Supported testbed topology if it's a new test case?

No change in testbed topology support.

Documentation

* Get first subport for all logical ports.
* Optimize the sonic db query.
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mihirpat1 mihirpat1 requested a review from Copilot June 24, 2025 21:03

This comment was marked as outdated.

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@az-pz az-pz requested a review from Copilot June 24, 2025 22:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue where the DOM is checked only for the first subport of a logical port and optimizes the SONiC DB query for transceiver information. Key changes include:

  • Updating tests to retrieve and pass the first subport mapping.
  • Modifying transceiver utility functions to assert DOM sensor information for the first subport.
  • Adding new helper functions in the platform interface utilities to provide physical-to-logical and first-subport mappings.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
tests/platform_tests/test_xcvr_info_in_db.py Updated test to use first subport mapping when calling check_transceiver_status
tests/common/platform/transceiver_utils.py Adjusted DOM sensor checks to look up using first subport instead of logical port
tests/common/platform/interface_utils.py Added helper functions for physical to logical port mapping and first subport lookup

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@az-pz az-pz requested a review from mihirpat1 July 10, 2025 18:23
@prgeor prgeor merged commit afa1b04 into sonic-net:master Jul 11, 2025
18 checks passed
mannytaheri added a commit to mannytaheri/sonic-mgmt that referenced this pull request Aug 5, 2025
nissampa pushed a commit to nissampa/sonic-mgmt_dpu_test that referenced this pull request Aug 7, 2025
…onic-net#19170)

* Check DOM for only first subport for test_xcvr_info_in_db.py test.

* Get first subport for all logical ports.
* Optimize the sonic db query.

* Update assertion error message.

* Xfail the failing test_retry_count test.
rlhui pushed a commit that referenced this pull request Aug 13, 2025
A change in test_common/platform/interface_utils.py (get_physical_port_indices)
is causing all testcases in platform_tests/api/test_sfp.py::TestSfpApi to error out with the message:
TypeError: '<' not supported between instances of 'NoneType' and 'int'
ashutosh-agrawal pushed a commit to ashutosh-agrawal/sonic-mgmt that referenced this pull request Aug 14, 2025
…onic-net#19170)

* Check DOM for only first subport for test_xcvr_info_in_db.py test.

* Get first subport for all logical ports.
* Optimize the sonic db query.

* Update assertion error message.

* Xfail the failing test_retry_count test.
nikamirrr pushed a commit to nikamirrr/nmirin-sonic-mgmt that referenced this pull request Aug 20, 2025
A change in test_common/platform/interface_utils.py (get_physical_port_indices)
is causing all testcases in platform_tests/api/test_sfp.py::TestSfpApi to error out with the message:
TypeError: '<' not supported between instances of 'NoneType' and 'int'
vidyac86 pushed a commit to vidyac86/sonic-mgmt that referenced this pull request Oct 23, 2025
…onic-net#19170)

* Check DOM for only first subport for test_xcvr_info_in_db.py test.

* Get first subport for all logical ports.
* Optimize the sonic db query.

* Update assertion error message.

* Xfail the failing test_retry_count test.
vidyac86 pushed a commit to vidyac86/sonic-mgmt that referenced this pull request Oct 23, 2025
A change in test_common/platform/interface_utils.py (get_physical_port_indices)
is causing all testcases in platform_tests/api/test_sfp.py::TestSfpApi to error out with the message:
TypeError: '<' not supported between instances of 'NoneType' and 'int'
@StormLiangMS
Copy link
Collaborator

hi @bingwang-ms @az-pz cherrypick failure for 202503, could you do the manual cherrypick?

@arista-nwolfe
Copy link
Contributor

hi @bingwang-ms @az-pz cherrypick failure for 202503, could you do the manual cherrypick?

If we do cherry-pick this PR to 202503 please remember to cherry-pick the fix for the issue introduced by this PR - #20078

@az-pz
Copy link
Contributor Author

az-pz commented Nov 13, 2025

@StormLiangMS @arista-nwolfe , here's the PR cherry picking this PR and #20078 :
Azure/sonic-mgmt.msft#867

opcoder0 pushed a commit to opcoder0/sonic-mgmt that referenced this pull request Dec 8, 2025
…onic-net#19170)

* Check DOM for only first subport for test_xcvr_info_in_db.py test.

* Get first subport for all logical ports.
* Optimize the sonic db query.

* Update assertion error message.

* Xfail the failing test_retry_count test.

Signed-off-by: opcoder0 <[email protected]>
opcoder0 pushed a commit to opcoder0/sonic-mgmt that referenced this pull request Dec 8, 2025
A change in test_common/platform/interface_utils.py (get_physical_port_indices)
is causing all testcases in platform_tests/api/test_sfp.py::TestSfpApi to error out with the message:
TypeError: '<' not supported between instances of 'NoneType' and 'int'

Signed-off-by: opcoder0 <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Dec 16, 2025
…onic-net#19170)

* Check DOM for only first subport for test_xcvr_info_in_db.py test.

* Get first subport for all logical ports.
* Optimize the sonic db query.

* Update assertion error message.

* Xfail the failing test_retry_count test.

Signed-off-by: Guy Shemesh <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Dec 16, 2025
A change in test_common/platform/interface_utils.py (get_physical_port_indices)
is causing all testcases in platform_tests/api/test_sfp.py::TestSfpApi to error out with the message:
TypeError: '<' not supported between instances of 'NoneType' and 'int'

Signed-off-by: Guy Shemesh <[email protected]>
AharonMalkin pushed a commit to AharonMalkin/sonic-mgmt that referenced this pull request Dec 16, 2025
…onic-net#19170)

* Check DOM for only first subport for test_xcvr_info_in_db.py test.

* Get first subport for all logical ports.
* Optimize the sonic db query.

* Update assertion error message.

* Xfail the failing test_retry_count test.

Signed-off-by: Aharon Malkin <[email protected]>
AharonMalkin pushed a commit to AharonMalkin/sonic-mgmt that referenced this pull request Dec 16, 2025
A change in test_common/platform/interface_utils.py (get_physical_port_indices)
is causing all testcases in platform_tests/api/test_sfp.py::TestSfpApi to error out with the message:
TypeError: '<' not supported between instances of 'NoneType' and 'int'

Signed-off-by: Aharon Malkin <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Dec 21, 2025
…onic-net#19170)

* Check DOM for only first subport for test_xcvr_info_in_db.py test.

* Get first subport for all logical ports.
* Optimize the sonic db query.

* Update assertion error message.

* Xfail the failing test_retry_count test.

Signed-off-by: Guy Shemesh <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Dec 21, 2025
A change in test_common/platform/interface_utils.py (get_physical_port_indices)
is causing all testcases in platform_tests/api/test_sfp.py::TestSfpApi to error out with the message:
TypeError: '<' not supported between instances of 'NoneType' and 'int'

Signed-off-by: Guy Shemesh <[email protected]>
venu-nexthop pushed a commit to venu-nexthop/sonic-mgmt that referenced this pull request Jan 13, 2026
…onic-net#19170)

* Check DOM for only first subport for test_xcvr_info_in_db.py test.

* Get first subport for all logical ports.
* Optimize the sonic db query.

* Update assertion error message.

* Xfail the failing test_retry_count test.
venu-nexthop pushed a commit to venu-nexthop/sonic-mgmt that referenced this pull request Jan 13, 2026
A change in test_common/platform/interface_utils.py (get_physical_port_indices)
is causing all testcases in platform_tests/api/test_sfp.py::TestSfpApi to error out with the message:
TypeError: '<' not supported between instances of 'NoneType' and 'int'
prgeor added a commit to Azure/sonic-mgmt.msft that referenced this pull request Jan 16, 2026
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Jan 26, 2026
…onic-net#19170)

* Check DOM for only first subport for test_xcvr_info_in_db.py test.

* Get first subport for all logical ports.
* Optimize the sonic db query.

* Update assertion error message.

* Xfail the failing test_retry_count test.

Signed-off-by: Guy Shemesh <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Jan 26, 2026
A change in test_common/platform/interface_utils.py (get_physical_port_indices)
is causing all testcases in platform_tests/api/test_sfp.py::TestSfpApi to error out with the message:
TypeError: '<' not supported between instances of 'NoneType' and 'int'

Signed-off-by: Guy Shemesh <[email protected]>
ytzur1 pushed a commit to ytzur1/sonic-mgmt that referenced this pull request Feb 2, 2026
…onic-net#19170)

* Check DOM for only first subport for test_xcvr_info_in_db.py test.

* Get first subport for all logical ports.
* Optimize the sonic db query.

* Update assertion error message.

* Xfail the failing test_retry_count test.

Signed-off-by: Yael Tzur <[email protected]>
ytzur1 pushed a commit to ytzur1/sonic-mgmt that referenced this pull request Feb 2, 2026
A change in test_common/platform/interface_utils.py (get_physical_port_indices)
is causing all testcases in platform_tests/api/test_sfp.py::TestSfpApi to error out with the message:
TypeError: '<' not supported between instances of 'NoneType' and 'int'

Signed-off-by: Yael Tzur <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.