Skip to content

RDKEMW-26925 : L1 unit tests - #64

Merged
apatel859 merged 1 commit into
developfrom
feature/RDKEMW-26925_sys_mon_tools_L1
Oct 13, 2026
Merged

apatel859 merged 1 commit into
developfrom
feature/RDKEMW-26925_sys_mon_tools_L1

Conversation

@hgfell683

Copy link
Copy Markdown
Contributor

No description provided.

@hgfell683
hgfell683 marked this pull request as ready for review October 13, 2026 17:40
Copilot AI balanced review requested due to automatic review settings October 13, 2026 17:40
@hgfell683
hgfell683 requested a review from a team as a code owner October 13, 2026 17:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Invalid event paths can report success or read uninitialized memory, and one test codifies a resource leak.

3 open findings
What changed in this PR

Adds L1 unit tests and CI coverage for system monitoring utilities.

Changes:

  • Adds mocked tests for power, input, simulator, MFR, and event-sender components.
  • Adds reusable GitHub Actions test and coverage workflows.
  • Updates build integration and event-sender control flow.
File Description
tests/​test_uinput.c Tests uinput setup and dispatch.
tests/​test_uinput_main.c Provides the uinput test entry point.
tests/​test_set_power_state.c Tests power-state commands.
tests/​test_query_power_state.c Tests power-state queries.
tests/​test_power_state_monitor.c Tests monitor state and thread paths.
tests/​test_mfr_utils.c Tests MFR utility queries.
tests/​test_legacy_key_simulator.c Tests the legacy simulator.
tests/​test_key_simulator.c Tests key simulator behavior.
tests/​test_iarm_event_sender.c Tests event parsing and payloads.
tests/​run_l1_tests.sh Builds and runs L1 tests.
tests/​mocks/​uidev.h Adds UI-device test types.
tests/​mocks/​libCMAF.h Adds CMAF test declarations.
tests/​Makefile.am Distributes test assets.
Makefile.am Integrates the tests subdirectory.
iarm-event-sender/​IARM_event_sender.c Adjusts DSMgr flow and payload termination.
cov_build.sh Refactors build flags.
configure.ac Generates the tests Makefile.
.github/​workflows/​tests-trigger.yml Triggers the L1 workflow.
.github/​workflows/​L1-tests.yml Runs tests and publishes coverage.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread iarm-event-sender/IARM_event_sender.c Outdated
Comment thread iarm-event-sender/IARM_event_sender.c Outdated
Comment thread tests/test_key_simulator.c
@hgfell683
hgfell683 marked this pull request as draft October 13, 2026 18:03
@hgfell683
hgfell683 marked this pull request as ready for review October 13, 2026 18:07
Copilot AI balanced review requested due to automatic review settings October 13, 2026 18:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

A lifecycle test codifies missing cleanup, and the conditional peripheral-upgrade route is not actually exercised.

0 open findings

3 resolved since last review
Previously missed (1)

In code that hasn't changed since last review

Low severity Test never exercises enabled PeripheralUpgradeEvent implementation

tests/​test_iarm_event_sender.c:348

run_l1_tests.sh never defines CTRLM_ENABLED, so this invocation cannot enter the PeripheralUpgradeEvent implementation; it only exercises the no-match fallback and then passes because no broadcast occurred. Consequently this test provides no coverage of the payload parsing or IARM_Bus_Call route its name claims. Compile an enabled variant and mock/assert the control-manager call (or omit this misleading case).

🧠 Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 13, 2026 18:12
@hgfell683
hgfell683 force-pushed the feature/RDKEMW-26925_sys_mon_tools_L1 branch from e8c9ce3 to d6f1c92 Compare October 13, 2026 18:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Several assertions codify API-contract violations, invalid key dispatch, and missing resource cleanup.

0 open findings

Previously missed (2)

In code that hasn't changed since last review

Medium severity UINPUT_init incorrectly succeeds when opening /dev/uinput fails

tests/​test_uinput.c:171

This assertion treats failure to open /dev/uinput as successful initialization, contradicting the public UINPUT_init contract in key_simulator/uInputInternal.h:99-103 (“If /dev/uinput does not exist, fail” and return an error code). It also prevents the test suite from detecting the existing always-zero return bug; update UINPUT_init to return an error and assert a nonzero result here.

This issue also appears on line 265 of the same file.

Medium severity Unmapped keys incorrectly emit KEY_RESERVED instead of KEY_UNKNOWN

tests/​test_uinput.c:255

The test currently makes emission of KEY_RESERVED the expected behavior for an unmapped key. KEY_RESERVED is the invalid sentinel, while IrInputRemoteKeyCodes.h:134 explicitly maps KED_UNDEFINEDKEY to KEY_UNKNOWN; accepting this assertion hides the fallback bug in getKeyCode. The production fallback should emit KEY_UNKNOWN (or drop the event), and this expectation should reflect that behavior.

🧠 Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 13, 2026 18:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Test distribution is not wired into Automake, and failed runs do not produce the declared test log artifact.

2 open findings

🧠 Review effort: Balanced

Comment thread .github/workflows/L1-tests.yml
Comment thread Makefile.am Outdated
Copilot AI balanced review requested due to automatic review settings October 13, 2026 18:20
@hgfell683
hgfell683 force-pushed the feature/RDKEMW-26925_sys_mon_tools_L1 branch from ac1e683 to a87b005 Compare October 13, 2026 18:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Test packaging is not integrated, one test enshrines a cleanup leak, and conditional peripheral routing remains untested.

2 open findings
2 resolved since last review

🧠 Review effort: Balanced

Comment thread tests/Makefile.am
Comment thread tests/test_iarm_event_sender.c
@apatel859
apatel859 merged commit b5f8ef8 into develop Oct 13, 2026
12 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants