Skip to content

Support for UMF Componenets Model - Transceivers#226

Draft
divyagayathri-hcl wants to merge 2 commits into
sonic-net:masterfrom
divyagayathri-hcl:pr_compmodel_xcvr
Draft

Support for UMF Componenets Model - Transceivers#226
divyagayathri-hcl wants to merge 2 commits into
sonic-net:masterfrom
divyagayathri-hcl:pr_compmodel_xcvr

Conversation

@divyagayathri-hcl

@divyagayathri-hcl divyagayathri-hcl commented Jun 12, 2026

Copy link
Copy Markdown

Summary: Support for UMF Componenets Model - Transceivers.

UT Results:

./testapp.test -test.v -test.run TestCompRoot_* -test.coverprofile=coverage.out
...
=== RUN TestCompRoot_ComponentTypeString
--- PASS: TestCompRoot_ComponentTypeString (0.00s)
=== RUN TestCompRoot_ValidICName
=== RUN TestCompRoot_ValidICName/Fails_HasPrefix_check
=== RUN TestCompRoot_ValidICName/Fails_len(sp)<2_check(Prefix_matches_exactly,but_nothing_follows)
=== RUN TestCompRoot_ValidICName/Fails_Atoi_check
(Suffix_is_not_a_valid_integer)
=== RUN TestCompRoot_ValidICName/Fails_Atoi_check
(Suffix_is_not_a_valid_integer)#1
=== RUN TestCompRoot_ValidICName/Passes_all_checks_(Valid_IC_name)
--- PASS: TestCompRoot_ValidICName (0.00s)
--- PASS: TestCompRoot_ValidICName/Fails_HasPrefix_check (0.00s)
--- PASS: TestCompRoot_ValidICName/Fails_len(sp)<2_check(Prefix_matches_exactly,but_nothing_follows) (0.00s)
--- PASS: TestCompRoot_ValidICName/Fails_Atoi_check
(Suffix_is_not_a_valid_integer) (0.00s)
--- PASS: TestCompRoot_ValidICName/Fails_Atoi_check
(Suffix_is_not_a_valid_integer)#1 (0.00s)
--- PASS: TestCompRoot_ValidICName/Passes_all_checks_(Valid_IC_name) (0.00s)
=== RUN TestCompRoot_GetCompTypeByName
--- PASS: TestCompRoot_GetCompTypeByName (0.00s)
=== RUN TestCompRoot_GetCompType_ErrorCases
--- PASS: TestCompRoot_GetCompType_ErrorCases (0.00s)
=== RUN TestCompRoot_CompTypesForSubscriptionUri_Transceiver
--- PASS: TestCompRoot_CompTypesForSubscriptionUri_Transceiver (0.00s)
=== RUN TestCompRoot_GetPfmRootObject
--- PASS: TestCompRoot_GetPfmRootObject (0.00s)
=== RUN TestCompRoot_GetPfmRootObject_Success
--- PASS: TestCompRoot_GetPfmRootObject_Success (0.00s)
=== RUN TestCompRoot_GetSysComponentsWithUnknownComponentType
--- PASS: TestCompRoot_GetSysComponentsWithUnknownComponentType (0.00s)
=== RUN TestCompRoot_Subscribe_pfm_components_xfmr
=== RUN TestCompRoot_Subscribe_pfm_components_xfmr/Early_Exit_-Key_is_empty(Requesting_ALL_components)
=== RUN TestCompRoot_Subscribe_pfm_components_xfmr/Early_Exit_-Key_contains__sensor
=== RUN TestCompRoot_Subscribe_pfm_components_xfmr/Error_Path
-Invalid_requestURI_syntax_triggers_error_return
=== RUN TestCompRoot_Subscribe_pfm_components_xfmr/Fallback_Path
-Unhandled_subscProc_falls_through_to_final_return
--- PASS: TestCompRoot_Subscribe_pfm_components_xfmr (0.00s)
--- PASS: TestCompRoot_Subscribe_pfm_components_xfmr/Early_Exit
-Key_is_empty(Requesting_ALL_components) (0.00s)
--- PASS: TestCompRoot_Subscribe_pfm_components_xfmr/Early_Exit_-Key_contains__sensor (0.00s)
--- PASS: TestCompRoot_Subscribe_pfm_components_xfmr/Error_Path
-Invalid_requestURI_syntax_triggers_error_return (0.00s)
--- PASS: TestCompRoot_Subscribe_pfm_components_xfmr/Fallback_Path
-_Unhandled_subscProc_falls_through_to_final_return (0.00s)
=== RUN TestCompRoot_GetSysComponents_AllPaths
=== RUN TestCompRoot_GetSysComponents_AllPaths/Empty_Component_Name_Loop
=== RUN TestCompRoot_GetSysComponents_AllPaths/Valid_Component_Else_Block
=== RUN TestCompRoot_GetSysComponents_AllPaths/COMP_ST_State_Paths_Block
=== RUN TestCompRoot_GetSysComponents_AllPaths/COMP_CFG_Config_Paths_Block
--- PASS: TestCompRoot_GetSysComponents_AllPaths (0.00s)
--- PASS: TestCompRoot_GetSysComponents_AllPaths/Empty_Component_Name_Loop (0.00s)
--- PASS: TestCompRoot_GetSysComponents_AllPaths/Valid_Component_Else_Block (0.00s)
--- PASS: TestCompRoot_GetSysComponents_AllPaths/COMP_ST_State_Paths_Block (0.00s)
--- PASS: TestCompRoot_GetSysComponents_AllPaths/COMP_CFG_Config_Paths_Block (0.00s)
=== RUN TestCompRoot_GetSysComponents_TypeSpecificRouting
=== RUN TestCompRoot_GetSysComponents_TypeSpecificRouting/Xcvr_Base_Prefix_Sub-path
xfmr_platform_test.go:441: Routing executed safely through base prefix channels: Translib Redis Error: Entry does not exist: TRANSCEIVER_STATUS|Ethernet0
=== RUN TestCompRoot_GetSysComponents_TypeSpecificRouting/Xcvr_Fallback_Default_Sub-path
xfmr_platform_test.go:463: Routing executed safely through individual fallback channels: Translib Redis Error: Entry does not exist: TRANSCEIVER_STATUS|Ethernet0
=== RUN TestCompRoot_GetSysComponents_TypeSpecificRouting/Integrated_Circuit_Component_Path
xfmr_platform_test.go:487: Routing executed safely through fillICInfo: Translib Redis Error: Entry does not exist: TRANSCEIVER_STATUS|Ethernet0
--- PASS: TestCompRoot_GetSysComponents_TypeSpecificRouting (0.00s)
--- PASS: TestCompRoot_GetSysComponents_TypeSpecificRouting/Xcvr_Base_Prefix_Sub-path (0.00s)
--- PASS: TestCompRoot_GetSysComponents_TypeSpecificRouting/Xcvr_Fallback_Default_Sub-path (0.00s)
--- PASS: TestCompRoot_GetSysComponents_TypeSpecificRouting/Integrated_Circuit_Component_Path (0.00s)
=== RUN TestCompRoot_TranslateExists_TableNotFound
--- PASS: TestCompRoot_TranslateExists_TableNotFound (0.00s)
=== RUN TestCompRoot_GetAllTableEntries
=== RUN TestCompRoot_GetAllTableEntries/Coverage:_Empty_table_name_exits_early
=== RUN TestCompRoot_GetAllTableEntries/Coverage:_Empty_key_exits_early
=== RUN TestCompRoot_GetAllTableEntries/Coverage:_DB_execution_failure_bubbles_up
=== RUN TestCompRoot_GetAllTableEntries/Check_valid_case
--- PASS: TestCompRoot_GetAllTableEntries (0.00s)
--- PASS: TestCompRoot_GetAllTableEntries/Coverage:_Empty_table_name_exits_early (0.00s)
--- PASS: TestCompRoot_GetAllTableEntries/Coverage:_Empty_key_exits_early (0.00s)
--- PASS: TestCompRoot_GetAllTableEntries/Coverage:_DB_execution_failure_bubbles_up (0.00s)
--- PASS: TestCompRoot_GetAllTableEntries/Check_valid_case (0.00s)
=== RUN TestCompRoot_GetAllTableEntries_Loop
xfmr_platform_test.go:614: Loop executed successfully. Extracted string array length: 0, items: []
--- PASS: TestCompRoot_GetAllTableEntries_Loop (0.00s)
=== RUN TestCompRoot_FillICInfo
=== RUN TestCompRoot_FillICInfo/Coverage:_Path_matches_COMP_exactly
=== RUN TestCompRoot_FillICInfo/Coverage:_Path_matches_COMP_ST_exactly
=== RUN TestCompRoot_FillICInfo/Coverage:_Path_has_COMP_ST_prefix_but_hits_switch_default
=== RUN TestCompRoot_FillICInfo/Coverage:_Path_doesn't_match_either_condition
--- PASS: TestCompRoot_FillICInfo (0.00s)
--- PASS: TestCompRoot_FillICInfo/Coverage:_Path_matches_COMP_exactly (0.00s)
--- PASS: TestCompRoot_FillICInfo/Coverage:_Path_matches_COMP_ST_exactly (0.00s)
--- PASS: TestCompRoot_FillICInfo/Coverage:_Path_has_COMP_ST_prefix_but_hits_switch_default (0.00s)
--- PASS: TestCompRoot_FillICInfo/Coverage:_Path_doesn't_match_either_condition (0.00s)
=== RUN TestCompRoot_DbToYang_pfm_components_xfmr
=== RUN TestCompRoot_DbToYang_pfm_components_xfmr/Coverage:_Unsupported_request_URI_triggers_early_exit_error
=== RUN TestCompRoot_DbToYang_pfm_components_xfmr/Coverage:_Successful_execution_path_calls_downstream_getSysComponents
--- PASS: TestCompRoot_DbToYang_pfm_components_xfmr (0.00s)
--- PASS: TestCompRoot_DbToYang_pfm_components_xfmr/Coverage:_Unsupported_request_URI_triggers_early_exit_error (0.00s)
--- PASS: TestCompRoot_DbToYang_pfm_components_xfmr/Coverage:Successful_execution_path_calls_downstream_getSysComponents (0.00s)
=== RUN TestCompRoot_CompTypeToFuncCall
=== RUN TestCompRoot_CompTypeToFuncCall/Invalid_Component_Type_returns_error
=== RUN TestCompRoot_CompTypeToFuncCall/Valid_CompTypeIC_path
--- PASS: TestCompRoot_CompTypeToFuncCall (0.00s)
--- PASS: TestCompRoot_CompTypeToFuncCall/Invalid_Component_Type_returns_error (0.00s)
--- PASS: TestCompRoot_CompTypeToFuncCall/Valid_CompTypeIC_path (0.00s)
=== RUN TestCompRoot_CreateCompAndFuncCall_Success
=== RUN TestCompRoot_CreateCompAndFuncCall_Success/Successful_component_creation_and_execution_for_default_type
--- PASS: TestCompRoot_CreateCompAndFuncCall_Success (0.00s)
--- PASS: TestCompRoot_CreateCompAndFuncCall_Success/Successful_component_creation_and_execution_for_default_type (0.00s)
=== RUN TestCompRoot_Subscribe_pfm_components_xfmr_TranslateExists
--- PASS: TestCompRoot_Subscribe_pfm_components_xfmr_TranslateExists (0.00s)
=== RUN TestCompRoot_Subscribe_pfm_components_xfmr_TranslateSubscribe
--- PASS: TestCompRoot_Subscribe_pfm_components_xfmr_TranslateSubscribe (0.00s)
=== RUN TestCompRoot_TranslateExistsInvalidKey
--- PASS: TestCompRoot_TranslateExistsInvalidKey (0.00s)
=== RUN TestCompRoot_TranslateExistsValidKey
--- PASS: TestCompRoot_TranslateExistsValidKey (0.00s)
=== RUN TestCompRoot_TranslateSubscribeValidKey
--- PASS: TestCompRoot_TranslateSubscribeValidKey (0.00s)
=== RUN TestCompRoot_FillXcvrLaneInfo_AllPaths
=== RUN TestCompRoot_FillXcvrLaneInfo_AllPaths/Success_Path
-Create_channel_and_fill_valid_lane_info
=== RUN TestCompRoot_FillXcvrLaneInfo_AllPaths/Error_Path
-Lane_index_exceeds_XCVR_LANE_LIMIT_bounds
--- PASS: TestCompRoot_FillXcvrLaneInfo_AllPaths (0.00s)
--- PASS: TestCompRoot_FillXcvrLaneInfo_AllPaths/Success_Path
-Create_channel_and_fill_valid_lane_info (0.00s)
--- PASS: TestCompRoot_FillXcvrLaneInfo_AllPaths/Error_Path
-Lane_index_exceeds_XCVR_LANE_LIMIT_bounds (0.00s)
=== RUN TestCompRoot_GetXcvrInfoFromDb_AllPaths
=== RUN TestCompRoot_GetXcvrInfoFromDb_AllPaths/TRANSCEIVER_TBL_Missing
=== RUN TestCompRoot_GetXcvrInfoFromDb_AllPaths/TRANSCEIVER_DOM_Missing
--- PASS: TestCompRoot_GetXcvrInfoFromDb_AllPaths (0.00s)
--- PASS: TestCompRoot_GetXcvrInfoFromDb_AllPaths/TRANSCEIVER_TBL_Missing (0.00s)
--- PASS: TestCompRoot_GetXcvrInfoFromDb_AllPaths/TRANSCEIVER_DOM_Missing (0.00s)
=== RUN TestCompRoot_CreateCompAndFuncCall_LoopExecution
--- PASS: TestCompRoot_CreateCompAndFuncCall_LoopExecution (0.00s)
=== RUN TestCompRoot_XcvwStatusAndFormFactor_AllPaths
=== RUN TestCompRoot_XcvwStatusAndFormFactor_AllPaths/FormFactorType_Branches
=== RUN TestCompRoot_XcvwStatusAndFormFactor_AllPaths/Status_Case
-Inserted
=== RUN TestCompRoot_XcvwStatusAndFormFactor_AllPaths/Status_Case
-Removed_or_Empty
=== RUN TestCompRoot_XcvwStatusAndFormFactor_AllPaths/Status_Case
-Unknown_Default
--- PASS: TestCompRoot_XcvwStatusAndFormFactor_AllPaths (0.00s)
--- PASS: TestCompRoot_XcvwStatusAndFormFactor_AllPaths/FormFactorType_Branches (0.00s)
--- PASS: TestCompRoot_XcvwStatusAndFormFactor_AllPaths/Status_Case
-Inserted (0.00s)
--- PASS: TestCompRoot_XcvwStatusAndFormFactor_AllPaths/Status_Case
-Removed_or_Empty (0.00s)
--- PASS: TestCompRoot_XcvwStatusAndFormFactor_AllPaths/Status_Case
-Unknown_Default (0.00s)
=== RUN TestCompRoot_ConvAndFillDBValues_AllPaths
=== RUN TestCompRoot_ConvAndFillDBValues_AllPaths/All_Fields_Valid
-Hits_success_conversions
=== RUN TestCompRoot_ConvAndFillDBValues_AllPaths/Parse_Failures
-Hits_all_else_block_logging_lines
--- PASS: TestCompRoot_ConvAndFillDBValues_AllPaths (0.00s)
--- PASS: TestCompRoot_ConvAndFillDBValues_AllPaths/All_Fields_Valid
-Hits_success_conversions (0.00s)
--- PASS: TestCompRoot_ConvAndFillDBValues_AllPaths/Parse_Failures
-_Hits_all_else_block_logging_lines (0.00s)
=== RUN TestCompRoot_ConvAndFillDBValues_ErrorPaths
--- PASS: TestCompRoot_ConvAndFillDBValues_ErrorPaths (0.00s)
=== RUN TestCompRoot_StringMethods_AllPaths
=== RUN TestCompRoot_StringMethods_AllPaths/PathType_AllPaths
=== RUN TestCompRoot_StringMethods_AllPaths/PathType_StatePaths
=== RUN TestCompRoot_StringMethods_AllPaths/PathType_999
=== RUN TestCompRoot_StringMethods_AllPaths/ComponentType_CompTypeInvalid
=== RUN TestCompRoot_StringMethods_AllPaths/ComponentType_CompTypeXcvr
=== RUN TestCompRoot_StringMethods_AllPaths/ComponentType_CompTypeIC
=== RUN TestCompRoot_StringMethods_AllPaths/ComponentType_999
--- PASS: TestCompRoot_StringMethods_AllPaths (0.00s)
--- PASS: TestCompRoot_StringMethods_AllPaths/PathType_AllPaths (0.00s)
--- PASS: TestCompRoot_StringMethods_AllPaths/PathType_StatePaths (0.00s)
--- PASS: TestCompRoot_StringMethods_AllPaths/PathType_999 (0.00s)
--- PASS: TestCompRoot_StringMethods_AllPaths/ComponentType_CompTypeInvalid (0.00s)
--- PASS: TestCompRoot_StringMethods_AllPaths/ComponentType_CompTypeXcvr (0.00s)
--- PASS: TestCompRoot_StringMethods_AllPaths/ComponentType_CompTypeIC (0.00s)
--- PASS: TestCompRoot_StringMethods_AllPaths/ComponentType_999 (0.00s)
=== RUN TestCompRoot_GetXcvrInfoFromDb_FullSuccess
--- PASS: TestCompRoot_GetXcvrInfoFromDb_FullSuccess (0.00s)
=== RUN TestCompRoot_TranslateSubscribe_LoggingPath
xfmr_platform_test.go:1397: Warning: dbDataMap is still empty. Trying fallback wildcard style key...
--- PASS: TestCompRoot_TranslateSubscribe_LoggingPath (0.00s)
PASS
coverage: 3.8% of statements in ../translib/transformer

…ated-circuit

Signed-off-by: Niranjani Vivek <niranjaniv@google.com>
@mssonicbld

Copy link
Copy Markdown

/azp run

@azure-pipelines

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

@linux-foundation-easycla

linux-foundation-easycla Bot commented Jun 12, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: divyagayathri-hcl / name: divyagayathri-hcl (854639b)
  • ✅ login: niranjanivivek / name: Niranjani Vivek (b7469e3)

@mssonicbld

Copy link
Copy Markdown

/azp run

@azure-pipelines

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

@mssonicbld

Copy link
Copy Markdown

/azp run

@azure-pipelines

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

@mssonicbld

Copy link
Copy Markdown

/azp run

@azure-pipelines

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

@mssonicbld

Copy link
Copy Markdown

/azp run

@azure-pipelines

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

@divyagayathri-hcl divyagayathri-hcl marked this pull request as draft June 17, 2026 12:21
@divyagayathri-hcl

Copy link
Copy Markdown
Author

@github-copilot Could you review this PR?

Signed-off-by: divyagayathri-hcl <divyagayathri.s@hcl.com>
@mssonicbld

Copy link
Copy Markdown

/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