Skip to content

test(matter): Add device_interactor for side-channel#140

Merged
cleithner-comcast merged 7 commits intomainfrom
chipToolTesting
Feb 16, 2026
Merged

test(matter): Add device_interactor for side-channel#140
cleithner-comcast merged 7 commits intomainfrom
chipToolTesting

Conversation

@cleithner-comcast
Copy link
Contributor

To enable tests to manipulate matter devices through a side channel, this commit adds device_interactor which is backed by chip-tool. Concrete device fixtures are commissioned by chip-tool and then their commissioning window is re-opened so that they can be commissioned by barton. This commit also adds "clusters" which are just abstractions for cluster interactions, utilizing the device_interactor. Tests can trivially access a device fixture's cluster and perform an interaction through it.

Refs: BARTON-343

To enable tests to manipulate matter devices through a side channel,
this commit adds device_interactor which is backed by chip-tool.
Concrete device fixtures are commissioned by chip-tool and then their
commissioning window is re-opened so that they can be commissioned by
barton. This commit also adds "clusters" which are just abstractions
for cluster interactions, utilizing the device_interactor. Tests can
trivially access a device fixture's cluster and perform an interaction
through it.

Refs: BARTON-343
Copilot AI review requested due to automatic review settings February 12, 2026 16:00
@rdkcmf-jenkins
Copy link
Contributor

b'## Copyright scan failure
Commit: c353a4a
Report detail: https://gist.github.com/rdkcmf-jenkins/191da37a871a9edbecd6be87f6d81a03'

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds side-channel device interaction capabilities for Matter device testing by introducing device_interactor backed by chip-tool. The changes enable tests to manipulate Matter devices outside of the primary control path, supporting multi-admin commissioning scenarios.

Changes:

  • Added ChipToolDeviceInteractor class for executing chip-tool commands against Matter devices
  • Implemented cluster abstraction interfaces (OnOff, LevelControl, ColorControl) for simplified device interactions
  • Refactored MatterDevice to support cluster registration and multi-admin commissioning workflows
  • Added new test demonstrating light on/off control via side channel

Reviewed changes

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

Show a summary per file
File Description
testing/test/light_test.py Added test validating light on/off state changes through side-channel cluster interaction
testing/mocks/devices/matter/matter_light.py Registered supported clusters and updated fixture to enable multi-admin commissioning
testing/mocks/devices/matter/matter_device.py Added cluster management, removed pipe-based communication, added KVS isolation
testing/mocks/devices/matter/device_interactor.py New module providing chip-tool wrapper for device commissioning and cluster interactions
testing/mocks/devices/matter/clusters/onoff_cluster.py New OnOff cluster implementation with command and attribute methods
testing/mocks/devices/matter/clusters/matter_cluster.py New abstract base class for Matter cluster interfaces
testing/mocks/devices/matter/clusters/levelcontrol_cluster.py New LevelControl cluster implementation for brightness/level control
testing/mocks/devices/matter/clusters/colorcontrol_cluster.py New ColorControl cluster implementation for color manipulation
testing/conftest.py Added device_interactor fixture registration
pyproject.toml Enabled pytest-forked plugin for test isolation
docker/version Bumped Docker image version
docker/Dockerfile Pinned pygobject-stubs version and added pytest-forked dependency
.vscode/settings.json Configured pytest to run tests from testing directory

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

cleithner-comcast and others added 2 commits February 12, 2026 16:14
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 12, 2026 16:15
@rdkcmf-jenkins
Copy link
Contributor

b'## Copyright scan failure
Commit: 3ed96bb
Report detail: https://gist.github.com/rdkcmf-jenkins/476fae625dfbfa06b928f923dbd582c6'

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@rdkcmf-jenkins
Copy link
Contributor

b'## Copyright scan failure
Commit: 93005c1
Report detail: https://gist.github.com/rdkcmf-jenkins/06411716041b400fd49e59f37312e777'

@rdkcmf-jenkins
Copy link
Contributor

b'## Copyright scan failure
Commit: 93005c1
Report detail: https://gist.github.com/rdkcmf-jenkins/e827af6f8580549d641f0302f0187772'

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.


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

@rdkcmf-jenkins
Copy link
Contributor

b'## WARNING: A Copyright scan failure has been waived

A prior failure has been upvoted

  • Upvote reason: ok

  • Commit: 93005c1
    '

@rdkcmf-jenkins
Copy link
Contributor

b'## Copyright scan failure
Commit: c4f0189
Report detail: https://gist.github.com/rdkcmf-jenkins/0f3452dc53db978ca4720bd4a9d5cd1c'

@rdkcmf-jenkins
Copy link
Contributor

b'## WARNING: A Copyright scan failure has been waived

A prior failure has been upvoted

  • Upvote reason: ok

  • Commit: c4f0189
    '

Copilot AI review requested due to automatic review settings February 13, 2026 21:41
@rdkcmf-jenkins
Copy link
Contributor

b'## Copyright scan failure
Commit: dea1a82
Report detail: https://gist.github.com/rdkcmf-jenkins/e0c9800f704e12df6d05382901db09a6'

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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


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

@cleithner-comcast
Copy link
Contributor Author

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Contributor

Copilot AI commented Feb 13, 2026

@cleithner-comcast I've opened a new pull request, #145, to work on those changes. Once the pull request is ready, I'll request review from you.

Applied fixes for three unresolved code review comments from PR #140:

- **Removed unused imports**: Cleaned up `threading` and `Callable`
imports from `testing/test/light_test.py`
- **Moved module-level import**: Relocated `re` import to top of
`device_interactor.py` per Python conventions
- **Added commissioning window failure handling**: Device registration
now raises `RuntimeError` if commissioning window fails to open when
`open_commissioning_window=True`, preventing silent failures during
multi-admin setup

```python
if open_commissioning_window:
    result, new_code = self._open_commissioning_window(...)
    if not result.success:
        raise RuntimeError(
            f"Failed to open commissioning window on node {node_id}: {result.stderr}"
        )
```

<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: cleithner-comcast <87389808+cleithner-comcast@users.noreply.github.com>
@github-actions
Copy link


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@rdkcmf-jenkins
Copy link
Contributor

b'## Copyright scan failure
Commit: 8251754
Report detail: https://gist.github.com/rdkcmf-jenkins/caa088d9cca4c0c0747814b5f2ac7bb4'

@rdkcmf-jenkins
Copy link
Contributor

b'## WARNING: A Copyright scan failure has been waived

A prior failure has been upvoted

  • Upvote reason: ok

  • Commit: 8251754
    '

Copy link
Contributor

@tleacmcsa tleacmcsa left a comment

Choose a reason for hiding this comment

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

I hereby formally approve this Pull Request.

@cleithner-comcast cleithner-comcast merged commit 9ecab83 into main Feb 16, 2026
10 of 11 checks passed
@cleithner-comcast cleithner-comcast deleted the chipToolTesting branch February 16, 2026 14:55
@github-actions github-actions bot locked and limited conversation to collaborators Feb 16, 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.

4 participants