Skip to content

Add pure-Python HDMI RX (input) test to checkbox-provider-ce-oem (New) - #2690

Closed
seankingyang wants to merge 1 commit into
canonical:mainfrom
seankingyang:hdmirx_test
Closed

Add pure-Python HDMI RX (input) test to checkbox-provider-ce-oem (New)#2690
seankingyang wants to merge 1 commit into
canonical:mainfrom
seankingyang:hdmirx_test

Conversation

@seankingyang

Copy link
Copy Markdown
Contributor

Description

Resolved issues

Documentation

Tests

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.
Copilot AI review requested due to automatic review settings July 15, 2026 09:46
@seankingyang seankingyang added the ce-oem The PR only contains to the ce-oem provider under the contrib area label Jul 15, 2026

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 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.py CLI and shared hdmirx_utils.py core 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
@seankingyang

Copy link
Copy Markdown
Contributor Author

Superseded by #2691 — moved from the fork branch to an upstream branch (canonical/checkbox:hdmirx_test) per workflow preference. Same commits + the pep8-naming fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ce-oem The PR only contains to the ce-oem provider under the contrib area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants