RDKEMW-15146: Fix and expand unit tests for isSecureDbgSrvUnlocked() gating logic - #216
Draft
KTirumalaSrihari with Copilot wants to merge 2 commits into
Draft
RDKEMW-15146: Fix and expand unit tests for isSecureDbgSrvUnlocked() gating logic#216KTirumalaSrihari with Copilot wants to merge 2 commits into
KTirumalaSrihari with Copilot wants to merge 2 commits into
Conversation
- Remove broken isDebugServicesEnabled() Times(1) from VBN (non-PROD) tests (non-PROD builds now bypass this call since they are always unlocked) - Add getDeviceTypeRFC and getDevicePropertyData(LABSIGNED_ENABLED) mock expectations to PROD+debug-enabled tests (required for ePROD unlock) - Add getDeviceTypeRFC and getDevicePropertyData(LABSIGNED_ENABLED) mock expectations to PROD+debug-disabled tests (both are called for all ePROD builds before the dbgServices check) - Add 3 new tests covering new gating combinations: - TestName_GetServURL_Locked_Prod_WrongDeviceType (deviceType=prod, locked) - TestName_GetServURL_Locked_Prod_LabsignedNotEnabled (labsigned=false, locked) - TestName_GetServURL_Locked_Prod_LabsignedReadFail (read fails, locked) - Add size > 0 guards in Invoke lambdas to prevent size_t underflow" Co-authored-by: KTirumalaSrihari <102281309+KTirumalaSrihari@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] [RDKEMW-15146] Introduce mechanism to unlock debug service
RDKEMW-15146: Fix and expand unit tests for isSecureDbgSrvUnlocked() gating logic
Mar 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Existing
GetServURLunit tests were broken by the refactoredisSecureDbgSrvUnlocked(BUILDTYPE)and lacked coverage for the new ePROD unlock conditions (labsigned + deviceType RFC + debug services RFC).Test fixes
VBN/non-PROD tests: Removed stale
isDebugServicesEnabled().Times(1)expectations — non-PROD builds now returntruefromisSecureDbgSrvUnlocked()immediately without calling it, causing gMock TearDown failures.PROD + debug-enabled tests: Added required mock expectations for
getDeviceTypeRFC()(→"test") andgetDevicePropertyData("LABSIGNED_ENABLED")(→"true",UTILS_SUCCESS) — both are now unconditionally called for all ePROD builds before thedbgServicescheck.PROD + debug-disabled tests: Same two new mock expectations added;
dbgServices=falsestill prevents unlock but the calls still happen.New test coverage
Three new tests covering the remaining ePROD gating combinations:
Locked_Prod_WrongDeviceType"prod""true"Locked_Prod_LabsignedNotEnabled"test""false"Locked_Prod_LabsignedReadFail"test"💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.