Add CDB support field to get_transceiver_info - #721
Conversation
Signed-off-by: Brian Gallagher <bgallagher@nexthop.ai>
|
/azp run |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Signed-off-by: aditya-nexthop <aditya@nexthop.ai>
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
@bgallagher-nexthop can you check if this new field addition breaks any existing sonic-mgmt test? @mihirpat1 fyi |
@pnakka28 Can we add a testcase for this new field? |
There was a problem hiding this comment.
Pull request overview
This PR extends the CMIS transceiver info interface in sonic-platform-common by adding a cdb_supported key to the dictionary returned by get_transceiver_info(), enabling downstream components (e.g., STATE_DB population and CLI tooling) to surface whether a module advertises CDB support.
Changes:
- Add
cdb_supportedtoCMIS_XCVR_INFO_DEFAULT_DICTand include it inCmisApi.get_transceiver_info(). - Update CMIS unit tests to more directly exercise
get_transceiver_info()and validate the new field. - Update C-CMIS unit tests’ expected transceiver info payloads to include
cdb_supported.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/sonic_xcvr/test_cmis.py | Updates get_transceiver_info() unit test inputs/expectations and adds coverage for the new cdb_supported field. |
| tests/sonic_xcvr/test_ccmis.py | Updates expected transceiver info structures to include cdb_supported. |
| sonic_platform_base/sonic_xcvr/api/public/cmis.py | Adds cdb_supported to the default dict and returns it from get_transceiver_info(). |
@prgeor I have opened sonic-net/sonic-mgmt#26662 to fix a sonic-mgmt test that will break due to this PR's changes |
Description
Add a key to the dictionary returned by
get_transceiver_infothat indicates whether the transceiver advertises CDB support.Motivation and Context
This change will provide the following benefits:
show interface transceiver infocan leverage that to conveniently display whether CDB is supported.sfputilcan similarly display CDB support conveniently insfputil show eeprom.How Has This Been Tested?
Fixed the existing unit-test to actually exercise the underlying code and extended it to cover this PR's changes.