Add pure-Python HDMI RX (input) test to checkbox-provider-ce-oem (New) - #2690
Closed
seankingyang wants to merge 1 commit into
Closed
Add pure-Python HDMI RX (input) test to checkbox-provider-ce-oem (New)#2690seankingyang wants to merge 1 commit into
seankingyang wants to merge 1 commit into
Conversation
Replace the proprietary genio-test-tool.hdmi-rx-tool vendor binary with a pure-Python, stdlib-only HDMI RX test that talks to the kernel directly behind a pluggable per-platform backend (OEMQA-6742). bin/ (Python 3.5-safe: namedtuples, .format(), no annotations): - hdmirx_utils.py: platform-independent core -- data models, Event enum, the HdmiRxBackend contract, the Linux _IOC ioctl-number helpers, a reusable IoctlCharBackend base (a new vendor is data + mappers only), a stdlib netlink KOBJECT_UEVENT listener, and the verify_* helpers. - hdmirx_genio.py: Genio backend (/dev/hdmirx, magic 'H', mtk_hdmirx module) -- ctypes structs, command table and field mappers, written from the ABI spec rather than the vendor source. Struct sizes verified (VID 40, DEV 12, AUD 28) and ioctl numbers pinned by an abi-selfcheck. - hdmirx_generic.py: mainline V4L2 backend using the stable UAPI VIDIOC_QUERY_DV_TIMINGS for video/presence; audio, enable and events raise NotImplementedError with the exact UAPI to wire up on a target. - hdmirx_tool.py: the only script the jobs invoke -- auto-detects a backend (or --backend), one self-verifying sub-command per job, exit 0 pass / 1 fail, optional --json. units/hdmi-rx/: category, manifest (has_hdmi_rx), the 7 jobs with ce-oem-hdmi-rx/ ids gated only on the manifest (no vendor executable), and full/manual/automated test plans plus after-suspend variants. tests/: 73 hardware-free unit tests (mocked ioctl/netlink) covering the ioctl numbers, struct ABI, field decoders, netlink parser, verify_* logic and CLI contract. Each asserts both pass and mismatch paths so a hard-coded implementation would fail.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new HDMI RX (input) feature area to the checkbox-provider-ce-oem provider, including a pure-Python implementation (tool + backends) and a set of manifest-gated jobs/test plans to exercise HDMI RX presence, plug/unplug events, and basic audio/video info validation.
Changes:
- Introduces new HDMI RX test plans, category, manifest entry, and jobs (including after-suspend variants).
- Adds a pure-Python
hdmirx_tool.pyCLI and sharedhdmirx_utils.pycore with two backends: Genio ioctl (hdmirx_genio.py) and generic V4L2 (hdmirx_generic.py). - Adds hardware-free unit tests covering ioctl encoding, backends, and CLI contract.
Reviewed changes
Copilot reviewed 8 out of 12 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| contrib/checkbox-ce-oem/checkbox-provider-ce-oem/units/hdmi-rx/test-plan.pxu | New HDMI RX full/manual/automated + after-suspend test plan units. |
| contrib/checkbox-ce-oem/checkbox-provider-ce-oem/units/hdmi-rx/manifest.pxu | New manifest entry (has_hdmi_rx) gating HDMI RX jobs. |
| contrib/checkbox-ce-oem/checkbox-provider-ce-oem/units/hdmi-rx/jobs.pxu | New HDMI RX jobs invoking hdmirx_tool.py for checks/events/info. |
| contrib/checkbox-ce-oem/checkbox-provider-ce-oem/units/hdmi-rx/category.pxu | New category grouping HDMI RX tests in the UI. |
| contrib/checkbox-ce-oem/checkbox-provider-ce-oem/bin/hdmirx_utils.py | Platform-independent models, ioctl helpers, uevent listener, and verification helpers. |
| contrib/checkbox-ce-oem/checkbox-provider-ce-oem/bin/hdmirx_tool.py | CLI entrypoint selecting backend and implementing job-oriented subcommands (+ JSON output). |
| contrib/checkbox-ce-oem/checkbox-provider-ce-oem/bin/hdmirx_genio.py | Genio-specific ioctl backend (structs, ioctl table, decoding/mapping). |
| contrib/checkbox-ce-oem/checkbox-provider-ce-oem/bin/hdmirx_generic.py | Generic V4L2 backend using VIDIOC_QUERY_DV_TIMINGS for video info/presence. |
| contrib/checkbox-ce-oem/checkbox-provider-ce-oem/tests/test_hdmirx_utils.py | Unit tests for ioctl encoding, uevent parsing, and verify helpers. |
| contrib/checkbox-ce-oem/checkbox-provider-ce-oem/tests/test_hdmirx_tool.py | Unit tests for CLI behavior, exit codes, JSON schema, and orchestration flows. |
| contrib/checkbox-ce-oem/checkbox-provider-ce-oem/tests/test_hdmirx_genio.py | Unit tests pinning Genio ABI (struct sizes/ioctl numbers) and field mapping. |
| contrib/checkbox-ce-oem/checkbox-provider-ce-oem/tests/test_hdmirx_generic.py | Unit tests for V4L2 structures, frame-rate computation, and node discovery. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| category_id: ce-oem-hdmi-rx | ||
| estimated_duration: 1 | ||
| imports: from com.canonical.plainbox import manifest | ||
| requires: manifest.has_hdmi_rx == "True" |
| estimated_duration: 20 | ||
| depends: ce-oem-hdmi-rx/module-detect | ||
| imports: from com.canonical.plainbox import manifest | ||
| requires: manifest.has_hdmi_rx == "True" |
| estimated_duration: 5 | ||
| depends: ce-oem-hdmi-rx/module-detect | ||
| imports: from com.canonical.plainbox import manifest | ||
| requires: manifest.has_hdmi_rx == "True" |
| ce-oem-hdmi-rx/module-detect | ||
| ce-oem-hdmi-rx/check-hdmi-cable-connection | ||
| imports: from com.canonical.plainbox import manifest | ||
| requires: manifest.has_hdmi_rx == "True" |
| ce-oem-hdmi-rx/module-detect | ||
| ce-oem-hdmi-rx/check-hdmi-cable-connection | ||
| imports: from com.canonical.plainbox import manifest | ||
| requires: manifest.has_hdmi_rx == "True" |
| ce-oem-hdmi-rx/module-detect | ||
| ce-oem-hdmi-rx/check-hdmi-cable-connection | ||
| imports: from com.canonical.plainbox import manifest | ||
| requires: manifest.has_hdmi_rx == "True" |
| estimated_duration: 20 | ||
| depends: ce-oem-hdmi-rx/module-detect | ||
| imports: from com.canonical.plainbox import manifest | ||
| requires: manifest.has_hdmi_rx == "True" |
Comment on lines
+1
to
+4
| id: ce-oem-hdmi-rx-full | ||
| unit: test plan | ||
| _name: HDMI RX (Input) tests | ||
| _description: Full HDMI RX (input) tests for devices |
Contributor
Author
|
Superseded by #2691 — moved from the fork branch to an upstream branch ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Resolved issues
Documentation
Tests