Skip to content

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

@Elen777300

Description

@Elen777300

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."

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions