Skip to content

Component Test For Components Model - Transceivers - #739

Draft
niranjanivivek wants to merge 1 commit into
sonic-net:masterfrom
niranjanivivek:componenttest_compmodel_txvr
Draft

niranjanivivek wants to merge 1 commit into
sonic-net:masterfrom
niranjanivivek:componenttest_compmodel_txvr

Conversation

@niranjanivivek

@niranjanivivek niranjanivivek commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

This PR is created to add component test case for OpenConfig platform components root model transceivers

Note:
Dependency on below sonic-mgmt-common PRs.

Base PR - Support for Components Model Root - sonic-net/sonic-mgmt-common#224
Incremental PR - Support for Components Model - Transceiver - sonic-net/sonic-mgmt-common#226

Test Output
=== RUN TestGnmiGetTranslibPfmCompXcvr
=== RUN TestGnmiGetTranslibPfmCompXcvr/Get_OC_Platform_Comp_Xcvr
server_test.go:3367: [TestGnmiGetTranslibPfmCompXcvr/Get_OC_Platform_Comp_Xcvr] gotVal:
{
"openconfig-platform:component": [
{
"config": {
"name": "Ethernet0"
},
"name": "Ethernet0",
"openconfig-platform-transceiver:transceiver": {
"physical-channels": {
"channel": [
{
"config": {
"index": 0
},
"index": 0,
"state": {
"index": 0,
"input-power": {
"instant": "-Inf"
},
"laser-bias-current": {
"instant": "0"
},
"tx-laser": false
}
},
{
"config": {
"index": 1
},
"index": 1,
"state": {
"index": 1,
"input-power": {
"instant": "-Inf"
},
"laser-bias-current": {
"instant": "0"
},
"tx-laser": false
}
},
{
"config": {
"index": 2
},
"index": 2,
"state": {
"index": 2,
"input-power": {
"instant": "-Inf"
},
"laser-bias-current": {
"instant": "0"
},
"tx-laser": false
}
},
{
"config": {
"index": 3
},
"index": 3,
"state": {
"index": 3,
"input-power": {
"instant": "-Inf"
},
"laser-bias-current": {
"instant": "0"
},
"tx-laser": false
}
}
]
}
},
"state": {
"empty": false,
"firmware-version": "D",
"hardware-version": "D",
"mfg-date": "2011-12-13 ",
"mfg-name": "Amphenol",
"name": "Ethernet0",
"oper-status": "openconfig-platform-types:ACTIVE",
"part-no": "599690001",
"removable": true,
"serial-no": "APF11490011J7E",
"temperature": {
"instant": "101"
},
"type": "openconfig-platform-types:TRANSCEIVER"
}
}
]
}
=== RUN TestGnmiGetTranslibPfmCompXcvr/Get_OC_Platform_Comp_Xcvr_State
server_test.go:3367: [TestGnmiGetTranslibPfmCompXcvr/Get_OC_Platform_Comp_Xcvr_State] gotVal:
{
"openconfig-platform:state": {
"empty": false,
"firmware-version": "D",
"hardware-version": "D",
"mfg-date": "2011-12-13 ",
"mfg-name": "Amphenol",
"name": "Ethernet0",
"oper-status": "openconfig-platform-types:ACTIVE",
"part-no": "599690001",
"removable": true,
"serial-no": "APF11490011J7E",
"temperature": {
"instant": "101"
},
"type": "openconfig-platform-types:TRANSCEIVER"
}
}
=== RUN TestGnmiGetTranslibPfmCompXcvr/Get_OC_Platform_Comp_Xcvr_Temperature
server_test.go:3367: [TestGnmiGetTranslibPfmCompXcvr/Get_OC_Platform_Comp_Xcvr_Temperature] gotVal:
{
"openconfig-platform:instant": "101"
}
=== RUN TestGnmiGetTranslibPfmCompXcvr/Get_OC_Platform_Comp_Xcvr_Presence
server_test.go:3367: [TestGnmiGetTranslibPfmCompXcvr/Get_OC_Platform_Comp_Xcvr_Presence] gotVal:
{
"openconfig-platform:empty": false
}
--- PASS: TestGnmiGetTranslibPfmCompXcvr (1.25s)
--- PASS: TestGnmiGetTranslibPfmCompXcvr/Get_OC_Platform_Comp_Xcvr (0.04s)
--- PASS: TestGnmiGetTranslibPfmCompXcvr/Get_OC_Platform_Comp_Xcvr_State (0.02s)
--- PASS: TestGnmiGetTranslibPfmCompXcvr/Get_OC_Platform_Comp_Xcvr_Temperature (0.02s)
--- PASS: TestGnmiGetTranslibPfmCompXcvr/Get_OC_Platform_Comp_Xcvr_Presence (0.02s)
PASS

@mssonicbld

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@mssonicbld

Copy link
Copy Markdown
Contributor

Hi, there are workflow run(s) waiting for approval, you may be first-time contributor. I will notify maintainers to help approve once PR is approved. Thanks!

---Powered by SONiC BuildBot

@niranjanivivek

Copy link
Copy Markdown
Contributor Author

@ndas7 and @rlucus Please review and approve

Comment thread gnmi_server/server_test.go Outdated
Comment thread gnmi_server/server_test.go Outdated
Comment thread gnmi_server/server_test.go Outdated
Comment thread gnmi_server/server_test.go Outdated
@niranjanivivek
niranjanivivek force-pushed the componenttest_compmodel_txvr branch from e257788 to 0fac055 Compare September 1, 2026 16:53
@mssonicbld

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Signed-off-by: Niranjani Vivek <niranjaniv@google.com>
@niranjanivivek
niranjanivivek force-pushed the componenttest_compmodel_txvr branch from 0fac055 to 4806ac2 Compare September 1, 2026 17:15
@mssonicbld

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@niranjanivivek
niranjanivivek requested a review from ndas7 September 1, 2026 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants