project-chip / certification-tool

A test harness and tooling designed to simplify development, testing, and certification for devices, guided by the Connectivity Standards Alliance.
https://csa-iot.org/
Apache License 2.0
27 stars 13 forks source link

[Bug] [Test Failed] Test_TC_TSTAT_2_2.yaml - Steps 16 and 18 [Reads back OccupiedCoolingSetpoint and OccupiedHeatingSetpoint] fail #247

Open MarijanaJo98 opened 3 months ago

MarijanaJo98 commented 3 months ago

Describe the bug

Greetings,

I've encountered a problem while running tests on ThermostatCluster:

WARNING | 2024-04-10 13:13:17.703276 | Test Failure: The test expectation "value (2800) == 2900" is false INFO | 2024-04-10 13:13:17.709551 | Test Step Completed [FAILED]: Step 16: Test Harness Reads back OccupiedCoolingSetpoint to confirm the success of the write

OccupiedCoolingSetpoint

WARNING | 2024-04-10 13:13:20.601786 | Test Failure: The test expectation "value (2800) == 2900" is false INFO | 2024-04-10 13:13:20.602152 | Test Step Completed [FAILED]: Step 18: Test Harness Reads back OccupiedCoolingSetpoint to confirm the success of the write

OccupiedHeatingSetpoint

WARNING | 2024-04-10 13:13:20.926616 | Test Failure: The test expectation "value (2200) == 2300" is false INFO | 2024-04-10 13:13:20.927450 | Test Step Completed [FAILED]: Step 18: Test Harness Reads back OccupiedHeatingSetpoint to confirm the success of the write

The problem arises when the "setpoint-raise-lower" command is called during testing. Although we have implemented support for all Absolute Setpoint Limits (such as AbsMinCoolSetpointLimit, AbsMaxCoolSetpointLimit, AbsMinHeatSetpointLimit, AbsMaxHeatSetpointLimit), there's an issue when the coolingSetpoint exceeds its limit. For instance, let's say our max limit for coolingSetpoint is 2800. When attempting to set a value above this limit, the function EnforceCoolingSetpointLimits is triggered within the emberAfThermostatClusterSetpointRaiseLowerCallback.

CoolingSetpoint = EnforceCoolingSetpointLimits(CoolingSetpoint, aEndpointId);

This function ensures that the value is within the acceptable range and cuts it to the AbsMaxCoolSetpointLimit if it exceeds it.

    if (MinCoolSetpointLimit < AbsMinCoolSetpointLimit)
        MinCoolSetpointLimit = AbsMinCoolSetpointLimit;

    if (MaxCoolSetpointLimit > AbsMaxCoolSetpointLimit)
        MaxCoolSetpointLimit = AbsMaxCoolSetpointLimit;

    if (CoolingSetpoint < MinCoolSetpointLimit)
        CoolingSetpoint = MinCoolSetpointLimit;

    if (CoolingSetpoint > MaxCoolSetpointLimit)
        CoolingSetpoint = MaxCoolSetpointLimit;

    return CoolingSetpoint;

However, the test does not verify these limitations and consequently fails to account for this behavior. Thanks in advance.

Platform

all