project-chip / project-chip/matter-test-scripts

[TC-FAN] Update REPL tests to expect CONSTRAINT_ERROR for unsupported FanMode

Open
#780 0 comments 0 reactions 1 assignee View on GitHub

@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:

  1. Run the FanControl REPL tests that validate writing to the FanMode attribute.
  2. Trigger the specific test case that attempts to write FanModeEnum::kLow while the FanModeSequence is set to kOffHighAuto or kOffHigh.
  3. Observe the test failure (the test expects the outdated status code, while the server correctly returns CONSTRAINT_ERROR).
  4. 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.cpp and associated REPL test scripts.
  • Reviewer Context: shubhamdp noted: "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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.