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
FanMode attribute.
- Trigger the specific test case that attempts to write
FanModeEnum::kLow while the FanModeSequence is set to kOffHighAuto or kOffHigh.
- 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.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."
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 theFanModeattribute to an unsupported value.Previously, attempting to set
FanModetokLowwhen theFanModeSequencewaskOffHighAutoorkOffHighreturnedStatus::InvalidInState. Based on review feedback from @shubhamdp, this was pointed out to returnCONSTRAINT_ERRORto 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 implementedCONSTRAINT_ERROR. This issue tracks the work to update the REPL test assertions so they pass against the corrected server behavior.Steps to reproduce:
FanModeattribute.FanModeEnum::kLowwhile theFanModeSequenceis set tokOffHighAutoorkOffHigh.CONSTRAINT_ERROR).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:
src/app/clusters/fan-control-server/FanControlCluster.cppand associated REPL test scripts.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."