Feature/rdk 60236 l2#201
Conversation
Code Coverage Summary |
There was a problem hiding this comment.
Pull request overview
Adds functional test coverage for remote debugger static profile report handling when issue types include suffixes, including an overlength suffix negative case.
Changes:
- Adds a positive suffix functional test for
Device.Info_ab1bghjh. - Adds a negative overlength suffix functional test for
Device.Info_ab1bghjhfhk. - Both tests validate log output, report generation, upload flow, and cleanup.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
test/functional-tests/tests/test_rrd_static_profile_report_with_suffix.py |
Adds positive functional coverage for static profile report upload with an accepted issue suffix. |
test/functional-tests/tests/test_rrd_static_profile_report_with_suffix_negative_case.py |
Adds functional coverage for overlength suffix discard behavior and upload flow. |
Comments suppressed due to low confidence (6)
test/functional-tests/tests/test_rrd_static_profile_report_with_suffix.py:107
- This stop-service expectation has the same service-name mismatch: the implementation logs remote_debugger_, not remote_debugger_. The expected substring has a space immediately after Device.Info, so it will not be found in the actual log.
SERVICE_STOP = f"Stopping remote_debugger_{ISSUE_STRING} service"
assert SERVICE_STOP in grep_rrdlogs(SERVICE_STOP)
test/functional-tests/tests/test_rrd_static_profile_report_with_suffix.py:131
- These constants are assigned to the opposite messages: SCRIPT_SUCCESS contains the failure log and SCRIPT_FAILURE contains the success log. This makes the test output report failures as successes and successes as failures.
SCRIPT_SUCCESS = "Debug Information Report upload Failed"
SCRIPT_FAILURE = "Debug Information Report upload Success"
test/functional-tests/tests/test_rrd_static_profile_report_with_suffix_negative_case.py:107
- This stop-service expectation has the same service-name mismatch: the implementation logs remote_debugger_, not remote_debugger_. The expected substring has a space immediately after Device.Info, so it will not be found in the actual log.
SERVICE_STOP = f"Stopping remote_debugger_{ISSUE_STRING} service"
assert SERVICE_STOP in grep_rrdlogs(SERVICE_STOP)
test/functional-tests/tests/test_rrd_static_profile_report_with_suffix_negative_case.py:134
- These constants are assigned to the opposite messages: SCRIPT_SUCCESS contains the failure log and SCRIPT_FAILURE contains the success log. This makes the test output report failures as successes and successes as failures.
SCRIPT_SUCCESS = "Debug Information Report upload Failed"
SCRIPT_FAILURE = "Debug Information Report upload Success"
test/functional-tests/tests/test_rrd_static_profile_report_with_suffix_negative_case.py:130
- This test never asserts that an upload status log was present. If neither success nor failure is logged, it only prints a message and still passes, so a broken or skipped upload report path will not be caught.
if UPLOAD_SUCCESS in grep_rrdlogs(UPLOAD_SUCCESS):
print("Upload success")
elif UPLOAD_FAILURE in grep_rrdlogs(UPLOAD_FAILURE):
print("Upload failed")
else:
test/functional-tests/tests/test_rrd_static_profile_report_with_suffix.py:127
- This test never asserts that an upload status log was present. If neither success nor failure is logged, it only prints a message and still passes, so a broken or skipped upload report path will not be caught.
if UPLOAD_SUCCESS in grep_rrdlogs(UPLOAD_SUCCESS):
print("Upload success")
elif UPLOAD_FAILURE in grep_rrdlogs(UPLOAD_FAILURE):
print("Upload failed")
else:
| ISSUE_MSG = f'MSG={ISSUE_STRING}' | ||
| assert ISSUE_MSG in grep_rrdlogs(ISSUE_MSG) |
| SERVICE_START = f"Starting remote_debugger_{ISSUE_STRING} service success" | ||
| assert SERVICE_START in grep_rrdlogs(SERVICE_START) | ||
|
|
||
| JOURNAL_START = f"journalctl remote_debugger_{ISSUE_STRING} service success" | ||
| assert JOURNAL_START in grep_rrdlogs(JOURNAL_START) |
| GENERATE_FILE = f"Generated filename: AABBCCDDEEFF_DEVICE_INFO_AB1BGHJH" | ||
| assert GENERATE_FILE in grep_rrdlogs(GENERATE_FILE) | ||
|
|
||
| START_UPLOAD = f"Starting upload - server: mockxconf, protocol: HTTP, file: AABBCCDDEEFF_DEVICE_INFO_AB1BGHJH" |
| result = check_output_dir() | ||
| print(result) |
| ISSUE_MSG = f'MSG={ISSUE_STRING}' | ||
| assert ISSUE_MSG in grep_rrdlogs(ISSUE_MSG) |
| SERVICE_START = f"Starting remote_debugger_{ISSUE_STRING} service success" | ||
| assert SERVICE_START in grep_rrdlogs(SERVICE_START) | ||
|
|
||
| JOURNAL_START = f"journalctl remote_debugger_{ISSUE_STRING} service success" | ||
| assert JOURNAL_START in grep_rrdlogs(JOURNAL_START) | ||
|
|
||
| SLEEP_TIME = "Sleeping with timeout" | ||
| assert SLEEP_TIME in grep_rrdlogs(SLEEP_TIME) | ||
| sleep(20) | ||
|
|
||
| SERVICE_STOP = f"Stopping remote_debugger_{ISSUE_STRING} service" |
| SERVICE_STOP = f"Stopping remote_debugger_{ISSUE_STRING} service" | ||
| assert SERVICE_STOP in grep_rrdlogs(SERVICE_STOP) | ||
|
|
||
| SUFFIX_EXCEEDS = f"Suffix after 'Device.Info' exceeds max length (12 > 10); discarding" |
| result = check_output_dir() | ||
| print(result) |
| GENERATE_FILE = f"Generated filename: AABBCCDDEEFF_DEVICE_INFO_" | ||
| assert GENERATE_FILE in grep_rrdlogs(GENERATE_FILE) | ||
|
|
||
| START_UPLOAD = f"Starting upload - server: mockxconf, protocol: HTTP, file: AABBCCDDEEFF_DEVICE_INFO_" |
No description provided.