project-chip / project-chip/matter-test-scripts
[TC-FAN] Update REPL tests to expect CONSTRAINT_ERROR for unsupported FanMode
@FrancoLionti is already working on this.
Since May 4, 2026.
- Dominant language
- Python
- Stars
- 19
- Forks
- 7
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 3
Description
Summary Title:
[TC-FAN] Update REPL tests to expect CONSTRAINT_ERROR for unsupported FanMode
Description:
A recent spec-compliance fix in the FanControl server cluster (src/app/clusters/fan-control-server/FanControlCluster.cpp) updated the error returned when setting the FanMode attribute to an unsupported value.
Previously, attempting to set FanMode to kLow when the FanModeSequence was kOffHighAuto or kOffHigh returned Status::InvalidInState. Based on review feedback from @shubhamdp, this was pointed out to return CONSTRAINT_ERROR to align with the specification.
[TC-FAN] Update REPL tests to expect CONSTRAINT_ERROR for unsupported FanMode
However, this change caused existing FanControl REPL tests to fail because they are still hardcoded to expect the old error type (InvalidInState) instead of the newly implemented CONSTRAINT_ERROR. This issue tracks the work to update the REPL test assertions so they pass against the corrected server behavior.
Steps to reproduce:
- Run the FanControl REPL tests that validate writing to the
FanModeattribute. - Trigger the specific test case that attempts to write
FanModeEnum::kLowwhile theFanModeSequenceis set tokOffHighAutoorkOffHigh. - Observe the test failure (the test expects the outdated status code, while the server correctly returns
CONSTRAINT_ERROR). - Update the REPL test assertions to expect
CONSTRAINT_ERROR(or its equivalent status enum in the test framework) to resolve the failure.
Logs:
N/A - Test failure occurs during REPL test execution due to a known assertion mismatch.
Additional Info:
- Target File:
src/app/clusters/fan-control-server/FanControlCluster.cppand associated REPL test scripts. - Reviewer Context:
shubhamdpnoted: "This should be CONSTRAINT_ERROR. If an attempt is made to set this attribute to a value not supported by the server as indicated in the FanModeSequence attribute, the server SHALL respond with CONSTRAINT_ERROR."
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.