Skip to content

Component test for Components Model - SoftwareComponents - #724

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

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

Conversation

@niranjanivivek

@niranjanivivek niranjanivivek commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

This PR is created to add a component test case for Open Config platform components software components Model.

Base PR - PR #230

Test Results:

=== RUN TestGnmiGetSoftwareComponents
=== RUN TestGnmiGetSoftwareComponents/Get_OS_Full_Component_Subtree_(AllPaths)
server_test.go:5483: [TestGnmiGetSoftwareComponents/Get_OS_Full_Component_Subtree_(AllPaths)] gotVal:
{
"openconfig-platform:component": [
{
"name": "os0",
"state": {
"name": "os0",
"oper-status": "openconfig-platform-types:ACTIVE",
"parent": "chassis",
"software-version": "20240531.42",
"type": "openconfig-platform-types:OPERATING_SYSTEM"
}
}
]
}
=== RUN TestGnmiGetSoftwareComponents/Get_OS_State_Container_(StatePaths)
server_test.go:5483: [TestGnmiGetSoftwareComponents/Get_OS_State_Container_(StatePaths)] gotVal:
{
"openconfig-platform:state": {
"name": "os0",
"oper-status": "openconfig-platform-types:ACTIVE",
"parent": "chassis",
"software-version": "20240531.42",
"type": "openconfig-platform-types:OPERATING_SYSTEM"
}
}
=== RUN TestGnmiGetSoftwareComponents/Get_BootLoader_Full_Subtree
server_test.go:5483: [TestGnmiGetSoftwareComponents/Get_BootLoader_Full_Subtree] gotVal:
{
"openconfig-platform:component": [
{
"name": "boot_loader0",
"state": {
"name": "boot_loader0",
"parent": "chassis",
"software-version": "2.06",
"type": "openconfig-platform-types:BOOT_LOADER"
}
}
]
}
=== RUN TestGnmiGetSoftwareComponents/Get_Network_Stack_Full_Subtree
server_test.go:5483: [TestGnmiGetSoftwareComponents/Get_Network_Stack_Full_Subtree] gotVal:
{
"openconfig-platform:component": [
{
"name": "network_stack0",
"software-module": {
"state": {
"openconfig-platform-software:module-type": "openconfig-platform-software:USERSPACE_PACKAGE_BUNDLE"
}
},
"state": {
"name": "network_stack0",
"oper-status": "openconfig-platform-types:ACTIVE",
"parent": "chassis",
"software-version": "",
"type": "openconfig-platform-types:SOFTWARE_MODULE"
}
}
]
}
=== RUN TestGnmiGetSoftwareComponents/Get_OS_Component_State_Name
server_test.go:5483: [TestGnmiGetSoftwareComponents/Get_OS_Component_State_Name] gotVal:
{
"openconfig-platform:name": "os0"
}
=== RUN TestGnmiGetSoftwareComponents/Get_OS_Component_Type
server_test.go:5483: [TestGnmiGetSoftwareComponents/Get_OS_Component_Type] gotVal:
{
"openconfig-platform:type": "openconfig-platform-types:OPERATING_SYSTEM"
}
=== RUN TestGnmiGetSoftwareComponents/Get_OS_Component_State_(Software_Version)
server_test.go:5483: [TestGnmiGetSoftwareComponents/Get_OS_Component_State_(Software_Version)] gotVal:
{
"openconfig-platform:software-version": "20240531.42"
}
=== RUN TestGnmiGetSoftwareComponents/Get_OS_Component_State_Parent
server_test.go:5483: [TestGnmiGetSoftwareComponents/Get_OS_Component_State_Parent] gotVal:
{
"openconfig-platform:parent": "chassis"
}
=== RUN TestGnmiGetSoftwareComponents/Get_OS_Component_State_Oper_Status
server_test.go:5483: [TestGnmiGetSoftwareComponents/Get_OS_Component_State_Oper_Status] gotVal:
{
"openconfig-platform:oper-status": "openconfig-platform-types:ACTIVE"
}
=== RUN TestGnmiGetSoftwareComponents/Get_Bootloader_Software_Version
server_test.go:5483: [TestGnmiGetSoftwareComponents/Get_Bootloader_Software_Version] gotVal:
{
"openconfig-platform:software-version": "2.06"
}
=== RUN TestGnmiGetSoftwareComponents/Get_Bootloader_component_name
server_test.go:5483: [TestGnmiGetSoftwareComponents/Get_Bootloader_component_name] gotVal:
{
"openconfig-platform:name": "boot_loader0"
}
=== RUN TestGnmiGetSoftwareComponents/Get_Bootloader_Specific_Type
server_test.go:5483: [TestGnmiGetSoftwareComponents/Get_Bootloader_Specific_Type] gotVal:
{
"openconfig-platform:type": "openconfig-platform-types:BOOT_LOADER"
}
=== RUN TestGnmiGetSoftwareComponents/Get_Software_Module_(Network_Stack)Type
server_test.go:5483: [TestGnmiGetSoftwareComponents/Get_Software_Module
(Network_Stack)Type] gotVal:
{
"openconfig-platform-software:module-type": "openconfig-platform-software:USERSPACE_PACKAGE_BUNDLE"
}
=== RUN TestGnmiGetSoftwareComponents/Get_Software_Module_Oper_Status
server_test.go:5483: [TestGnmiGetSoftwareComponents/Get_Software_Module_Oper_Status] gotVal:
{
"openconfig-platform:oper-status": "openconfig-platform-types:ACTIVE"
}
=== RUN TestGnmiGetSoftwareComponents/Get_Network_Stack_Component_State_Type
server_test.go:5483: [TestGnmiGetSoftwareComponents/Get_Network_Stack_Component_State_Type] gotVal:
{
"openconfig-platform:type": "openconfig-platform-types:SOFTWARE_MODULE"
}
=== RUN TestGnmiGetSoftwareComponents/Get_Software_Module_Container_Path
(COMP_SW_MOD)
server_test.go:5483: [TestGnmiGetSoftwareComponents/Get_Software_Module_Container_Path_(COMP_SW_MOD)] gotVal:
{
"openconfig-platform:software-module": {
"state": {
"openconfig-platform-software:module-type": "openconfig-platform-software:USERSPACE_PACKAGE_BUNDLE"
}
}
}
=== RUN TestGnmiGetSoftwareComponents/Get_Software_Module_State_Container_Path_(COMP_SW_MOD_ST)
server_test.go:5483: [TestGnmiGetSoftwareComponents/Get_Software_Module_State_Container_Path_(COMP_SW_MOD_ST)] gotVal:
{
"openconfig-platform:state": {
"openconfig-platform-software:module-type": "openconfig-platform-software:USERSPACE_PACKAGE_BUNDLE"
}
}
=== RUN TestGnmiGetSoftwareComponents/Get_Non-Existent_SW_Component_(NotFound)
=== RUN TestGnmiGetSoftwareComponents/Get_OS_Component_Software_Version_when_missing_in_DB_(Expect_Error)
=== RUN TestGnmiGetSoftwareComponents/Get_Non-Existent_SW_Component_(Unknown_Component_Name)
=== RUN TestGnmiGetSoftwareComponents/Trigger_getCompTypeByName_for_OS_pattern_(not_in_DB)
=== RUN TestGnmiGetSoftwareComponents/Trigger_getCompTypeByName_for_Network_Stack_pattern_(not_in_DB)
=== RUN TestGnmiGetSoftwareComponents/Trigger_getCompTypeByName_for_BootLoader_pattern_(not_in_DB)
=== RUN TestGnmiGetSoftwareComponents/Get_Oper_Status_on_OS_with_invalid_status_string_in_DB_(Triggers_invalid_field_value_error)
=== RUN TestGnmiGetSoftwareComponents/Get_Module_Type_on_OS_Component_(Triggers_cType_!=CompTypeNWStack_error)
--- PASS: TestGnmiGetSoftwareComponents (1.93s)
--- PASS: TestGnmiGetSoftwareComponents/Get_OS_Full_Component_Subtree
(AllPaths) (0.04s)
--- PASS: TestGnmiGetSoftwareComponents/Get_OS_State_Container_(StatePaths) (0.02s)
--- PASS: TestGnmiGetSoftwareComponents/Get_BootLoader_Full_Subtree (0.01s)
--- PASS: TestGnmiGetSoftwareComponents/Get_Network_Stack_Full_Subtree (0.02s)
--- PASS: TestGnmiGetSoftwareComponents/Get_OS_Component_State_Name (0.02s)
--- PASS: TestGnmiGetSoftwareComponents/Get_OS_Component_Type (0.02s)
--- PASS: TestGnmiGetSoftwareComponents/Get_OS_Component_State_(Software_Version) (0.02s)
--- PASS: TestGnmiGetSoftwareComponents/Get_OS_Component_State_Parent (0.02s)
--- PASS: TestGnmiGetSoftwareComponents/Get_OS_Component_State_Oper_Status (0.02s)
--- PASS: TestGnmiGetSoftwareComponents/Get_Bootloader_Software_Version (0.02s)
--- PASS: TestGnmiGetSoftwareComponents/Get_Bootloader_component_name (0.02s)
--- PASS: TestGnmiGetSoftwareComponents/Get_Bootloader_Specific_Type (0.02s)
--- PASS: TestGnmiGetSoftwareComponents/Get_Software_Module_(Network_Stack)Type (0.02s)
--- PASS: TestGnmiGetSoftwareComponents/Get_Software_Module_Oper_Status (0.02s)
--- PASS: TestGnmiGetSoftwareComponents/Get_Network_Stack_Component_State_Type (0.02s)
--- PASS: TestGnmiGetSoftwareComponents/Get_Software_Module_Container_Path
(COMP_SW_MOD) (0.02s)
--- PASS: TestGnmiGetSoftwareComponents/Get_Software_Module_State_Container_Path_(COMP_SW_MOD_ST) (0.01s)
--- PASS: TestGnmiGetSoftwareComponents/Get_Non-Existent_SW_Component_(NotFound) (0.01s)
--- PASS: TestGnmiGetSoftwareComponents/Get_OS_Component_Software_Version_when_missing_in_DB_(Expect_Error) (0.01s)
--- PASS: TestGnmiGetSoftwareComponents/Get_Non-Existent_SW_Component_(Unknown_Component_Name) (0.01s)
--- PASS: TestGnmiGetSoftwareComponents/Trigger_getCompTypeByName_for_OS_pattern_(not_in_DB) (0.01s)
--- PASS: TestGnmiGetSoftwareComponents/Trigger_getCompTypeByName_for_Network_Stack_pattern_(not_in_DB) (0.01s)
--- PASS: TestGnmiGetSoftwareComponents/Trigger_getCompTypeByName_for_BootLoader_pattern_(not_in_DB) (0.01s)
--- PASS: TestGnmiGetSoftwareComponents/Get_Oper_Status_on_OS_with_invalid_status_string_in_DB_(Triggers_invalid_field_value_error) (0.02s)
--- PASS: TestGnmiGetSoftwareComponents/Get_Module_Type_on_OS_Component_(Triggers_cType_!=_CompTypeNWStack_error) (0.01s)
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).

@niranjanivivek

Copy link
Copy Markdown
Contributor Author

@ndas7 @rlucus Please review

@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

@niranjanivivek
niranjanivivek force-pushed the componenttest_compmodel_swcomp branch from 363166c to 23d73a6 Compare September 3, 2026 11:45
@mssonicbld

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

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

@niranjanivivek

Copy link
Copy Markdown
Contributor Author

@ndas7 and @rlucus Please review and approve

@niranjanivivek

Copy link
Copy Markdown
Contributor Author

kwangsuk Please review and approve

@niranjanivivek
niranjanivivek marked this pull request as ready for review September 24, 2026 06:10
@azure-pipelines

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

@niranjanivivek
niranjanivivek force-pushed the componenttest_compmodel_swcomp branch from 23d73a6 to 8266b99 Compare September 24, 2026 16:48
@mssonicbld

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

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

@niranjanivivek
niranjanivivek force-pushed the componenttest_compmodel_swcomp branch from 8266b99 to ab5a36c Compare September 30, 2026 09:09
@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_swcomp branch from ab5a36c to d31b9d0 Compare October 1, 2026 11:49
@mssonicbld

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

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

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