Skip to content

Fix stale GetServURL mock expectations and add isSecureDbgSrvUnlocked unit tests#217

Draft
Copilot wants to merge 2 commits into
topic/RDKEMW-13335from
copilot/sub-pr-205-yet-again
Draft

Fix stale GetServURL mock expectations and add isSecureDbgSrvUnlocked unit tests#217
Copilot wants to merge 2 commits into
topic/RDKEMW-13335from
copilot/sub-pr-205-yet-again

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 17, 2026

The isSecureDbgSrvUnlocked() PROD path checks three conditions (isDebugServicesEnabled(), getDeviceTypeRFC(), LABSIGNED_ENABLED), but existing GetServURL GTests only mocked the first, leaving the PROD+enabled tests silently broken and missing coverage for the new gating logic.

Fixes to existing tests

  • VBN (non-PROD) tests (4): Removed stale isDebugServicesEnabled().Times(1) expectations — non-PROD builds short-circuit to true before reaching that call.
  • PROD + debug-enabled tests (2): Added getDeviceTypeRFC and getDevicePropertyData mock expectations (returning "test"/"true"/UTILS_SUCCESS) so isSecureDbgSrvUnlocked(ePROD) actually unlocks and the conf-file URL path is taken.
  • PROD + debug-disabled tests (2): Added the same mocks (with permissive values) to prove dbgServices=false alone locks the build, eliminating unregistered-call warnings.

New isSecureDbgSrvUnlocked unit tests

Six focused tests exercising each input independently:

Test Inputs Expected
IsSecureDbgSrvUnlocked_NonProdBuild_ReturnsTrue eVBN true
IsSecureDbgSrvUnlocked_Prod_AllConditionsMet_ReturnsTrue dbgServices=true, deviceType="test", labsigned="true" true
IsSecureDbgSrvUnlocked_Prod_DebugServicesDisabled_ReturnsFalse dbgServices=false false
IsSecureDbgSrvUnlocked_Prod_WrongDeviceType_ReturnsFalse deviceType="prod" false
IsSecureDbgSrvUnlocked_Prod_LabsignedFalse_ReturnsFalse labsigned="false" false
IsSecureDbgSrvUnlocked_Prod_LabsignedPropertyFailed_ReturnsFalse getDevicePropertyData() returns -1 false

📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

…ations

Co-authored-by: KTirumalaSrihari <102281309+KTirumalaSrihari@users.noreply.github.com>
Copilot AI changed the title [WIP] [WIP] Address feedback on debug service unlock mechanism Fix stale GetServURL mock expectations and add isSecureDbgSrvUnlocked unit tests Mar 17, 2026
Copilot AI requested a review from KTirumalaSrihari March 17, 2026 07:22
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.

2 participants