Skip to content

L2 guardian: close UserSettings content PIN coverage gap for 6-digit validation - #31

Draft
langu44 with Copilot wants to merge 10 commits into
developfrom
copilot/l2-guardian-generate-missing-tests-another-one
Draft

L2 guardian: close UserSettings content PIN coverage gap for 6-digit validation#31
langu44 with Copilot wants to merge 10 commits into
developfrom
copilot/l2-guardian-generate-missing-tests-another-one

Conversation

Copilot AI commented May 18, 2026

Copy link
Copy Markdown

Compared test-github-mode against develop, the only production delta was SetContentPin moving from 4-digit to 6-digit regex validation. This PR updates L2 coverage to match that contract so changed behavior is exercised on both accept and reject paths.

  • Scope of source change analyzed

    • plugin/UserSettingsImplementation.cpp: SetContentPin validation changed from ^\d{4}$ to ^\d{6}$.
  • L2 test alignment updates

    • Updated existing L2 success-path PIN inputs from 1234123456 in:
      • migration-state flow setup
      • JSON-RPC onContentPinChanged flow
      • COM-RPC set/get flow
  • New negative-path validation coverage

    • Expanded setContentPinInvalidLengthErrorCase to assert rejection of:
      • non-6-digit numeric inputs
      • malformed 6-char inputs (non-numeric / whitespace / symbols)
      • excessive-length numeric input
    • Added explicit positive checks in the same coverage area for:
      • valid 6-digit PIN acceptance
      • empty-string acceptance (existing plugin behavior)
paramsContentPin["contentPin"] = "123456";
EXPECT_EQ(InvokeServiceMethod("org.rdk.UserSettings", "setContentPin", paramsContentPin, result_json), Core::ERROR_NONE);

paramsContentPin["contentPin"] = "12345";
EXPECT_EQ(InvokeServiceMethod("org.rdk.UserSettings", "setContentPin", paramsContentPin, result_json), Core::ERROR_INVALID_PARAMETER);

L2-Guardian-Issue: #

Copilot AI and others added 9 commits May 18, 2026 16:09
Copilot AI changed the title [WIP] Generate missing L2 tests for branch test-github-mode L2 guardian: close UserSettings content PIN coverage gap for 6-digit validation May 18, 2026
Copilot AI requested a review from langu44 May 18, 2026 16:16
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