Skip to content

test webpa#382

Open
madhubabutt wants to merge 1 commit into
developfrom
feature/testweb
Open

test webpa#382
madhubabutt wants to merge 1 commit into
developfrom
feature/testweb

Conversation

@madhubabutt

Copy link
Copy Markdown
Contributor

No description provided.

@madhubabutt
madhubabutt requested a review from a team as a code owner March 6, 2026 10:14
Copilot AI review requested due to automatic review settings March 6, 2026 10:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds additional WebPA functional coverage for setting/getting an AccountID via parodus, and adjusts the L2 test runner script to focus on the WebPA suite.

Changes:

  • Added two new pytest cases to SET/GET Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.AccountInfo.AccountID via /usr/local/bin/parodus.
  • Modified run_l2.sh to run only the WebPA functional test file by commenting out three other pytest invocations.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
test/functional-tests/tests/tr69hostif_webpa.py Adds WebPA AccountID SET/GET functional tests executed via parodus and validated via log greps.
run_l2.sh Limits L2 execution to the WebPA test suite by commenting out other test runs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +322 to +337
def test_WebPA_Set_ACC_Id():
print("Starting parodus mock process")
payload = '{"command":"SET","parameters":[{"name":"Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.AccountInfo.AccountID","dataType":0,"value":"412370664406228514"}]}'
command = ["/usr/local/bin/parodus", payload]

result = subprocess.run(command, capture_output=True, text=True)
assert result.returncode == 0, f"Command failed with error: {result.stderr}"

STATUS_CODE_MSG = '"statusCode":200'
assert STATUS_CODE_MSG in grep_paroduslogs(STATUS_CODE_MSG)

SUCCESS_STATUS_MSG = '"message":"Success"'
assert SUCCESS_STATUS_MSG in grep_paroduslogs(SUCCESS_STATUS_MSG)

@pytest.mark.run(order=47)
def test_WebPA_Get_ACC_Id():

Copilot AI Mar 6, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new test names use inconsistent casing/abbreviation compared to the rest of this file (e.g., ACC_Id vs ..._ID... / AccountID). Consider renaming these to use a consistent ..._ACC_ID... / ..._AccountID... pattern to keep test discovery/output uniform.

Copilot uses AI. Check for mistakes.
Comment on lines +330 to +334
STATUS_CODE_MSG = '"statusCode":200'
assert STATUS_CODE_MSG in grep_paroduslogs(STATUS_CODE_MSG)

SUCCESS_STATUS_MSG = '"message":"Success"'
assert SUCCESS_STATUS_MSG in grep_paroduslogs(SUCCESS_STATUS_MSG)

Copilot AI Mar 6, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_WebPA_Set_ACC_Id validates success by grepping the entire parodus log for very common strings ("statusCode":200 and "message":"Success"). Because the log is shared across many tests, this can produce false positives even if this specific SET fails to generate the expected response. Prefer asserting against result.stdout/result.stderr, or grep for a request/response line that includes the specific parameter (...AccountInfo.AccountID) and/or the value that was set, or truncate the parodus log before running this command.

Suggested change
STATUS_CODE_MSG = '"statusCode":200'
assert STATUS_CODE_MSG in grep_paroduslogs(STATUS_CODE_MSG)
SUCCESS_STATUS_MSG = '"message":"Success"'
assert SUCCESS_STATUS_MSG in grep_paroduslogs(SUCCESS_STATUS_MSG)
ACCOUNT_ID_PARAM = "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.AccountInfo.AccountID"
assert ACCOUNT_ID_PARAM in grep_paroduslogs(ACCOUNT_ID_PARAM)
ACCOUNT_ID_VALUE = '"value":"412370664406228514"'
assert ACCOUNT_ID_VALUE in grep_paroduslogs(ACCOUNT_ID_VALUE)

Copilot uses AI. Check for mistakes.
Comment on lines +346 to +352
assert STATUS_CODE_MSG in grep_paroduslogs(STATUS_CODE_MSG)

SUCCESS_STATUS_MSG = '"message":"Success"'
assert SUCCESS_STATUS_MSG in grep_paroduslogs(SUCCESS_STATUS_MSG)

ACC_ID_MSG = '"value":"412370664406228514"'
assert ACC_ID_MSG in grep_paroduslogs(ACC_ID_MSG)

Copilot AI Mar 6, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the SET test, these assertions grep a shared parodus log file for generic success markers. This can pass due to earlier test output rather than the GET executed here. To make this test deterministic, validate the GET response from result.stdout (or clear/rotate the parodus log before the command) and ensure the response corresponds to ...AccountInfo.AccountID.

Suggested change
assert STATUS_CODE_MSG in grep_paroduslogs(STATUS_CODE_MSG)
SUCCESS_STATUS_MSG = '"message":"Success"'
assert SUCCESS_STATUS_MSG in grep_paroduslogs(SUCCESS_STATUS_MSG)
ACC_ID_MSG = '"value":"412370664406228514"'
assert ACC_ID_MSG in grep_paroduslogs(ACC_ID_MSG)
assert STATUS_CODE_MSG in result.stdout, f"Expected {STATUS_CODE_MSG} in GET response, got: {result.stdout}"
SUCCESS_STATUS_MSG = '"message":"Success"'
assert SUCCESS_STATUS_MSG in result.stdout, f"Expected {SUCCESS_STATUS_MSG} in GET response, got: {result.stdout}"
ACC_ID_MSG = '"value":"412370664406228514"'
assert ACC_ID_MSG in result.stdout, f"Expected {ACC_ID_MSG} in GET response, got: {result.stdout}"

Copilot uses AI. Check for mistakes.
Comment thread run_l2.sh
Comment on lines +67 to 71
#pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/bootup_sequence.json test/functional-tests/tests/test_bootup_sequence.py
#pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/handlers_communications.json test/functional-tests/tests/test_handlers_communications.py
#pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/deviceip.json test/functional-tests/tests/tr69hostif_deviceip.py
pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/webpa.json test/functional-tests/tests/tr69hostif_webpa.py

Copilot AI Mar 6, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run_l2.sh now comments out three pytest suites, which changes the L2 run to execute only the WebPA tests. If this script is used for CI/regression, this will silently reduce coverage. Consider gating which suites run behind an environment variable/argument (or keep them enabled) rather than commenting them out.

Suggested change
#pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/bootup_sequence.json test/functional-tests/tests/test_bootup_sequence.py
#pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/handlers_communications.json test/functional-tests/tests/test_handlers_communications.py
#pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/deviceip.json test/functional-tests/tests/tr69hostif_deviceip.py
pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/webpa.json test/functional-tests/tests/tr69hostif_webpa.py
if [ "${L2_WEBPA_ONLY}" = "1" ] || [ "${L2_WEBPA_ONLY}" = "true" ]; then
pytest --json-report --json-report-summary --json-report-file "$RESULT_DIR/webpa.json" test/functional-tests/tests/tr69hostif_webpa.py
else
pytest --json-report --json-report-summary --json-report-file "$RESULT_DIR/bootup_sequence.json" test/functional-tests/tests/test_bootup_sequence.py
pytest --json-report --json-report-summary --json-report-file "$RESULT_DIR/handlers_communications.json" test/functional-tests/tests/test_handlers_communications.py
pytest --json-report --json-report-summary --json-report-file "$RESULT_DIR/deviceip.json" test/functional-tests/tests/tr69hostif_deviceip.py
pytest --json-report --json-report-summary --json-report-file "$RESULT_DIR/webpa.json" test/functional-tests/tests/tr69hostif_webpa.py
fi

Copilot uses AI. Check for mistakes.
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