From 7ae30d25f69fa246001379d27b9ba173d99bb147 Mon Sep 17 00:00:00 2001 From: Raju Palagummi Date: Thu, 23 Sep 2021 11:14:37 -0700 Subject: [PATCH 1/3] Add 3 more Yamls to the tree and update the appropriate templates --- .../chip-tool/templates/tests-commands.zapt | 2 +- .../suites/certification/Test_TC_PCC_2_1.yaml | 837 ++++++++++++++++++ .../suites/certification/Test_TC_TM_2_1.yaml | 57 ++ .../certification/Test_TC_TSUIC_2_1.yaml | 122 +++ .../CHIP/templates/clusters-tests.zapt | 2 +- 5 files changed, 1018 insertions(+), 2 deletions(-) create mode 100644 src/app/tests/suites/certification/Test_TC_PCC_2_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_TM_2_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_TSUIC_2_1.yaml diff --git a/examples/chip-tool/templates/tests-commands.zapt b/examples/chip-tool/templates/tests-commands.zapt index 1355716b89d44a..482597ff2d25b5 100644 --- a/examples/chip-tool/templates/tests-commands.zapt +++ b/examples/chip-tool/templates/tests-commands.zapt @@ -4,5 +4,5 @@ #include -{{>test_cluster tests="TV_TargetNavigatorCluster, TV_AudioOutputCluster, TV_ApplicationLauncherCluster, TV_KeypadInputCluster, TV_AccountLoginCluster, TV_WakeOnLanCluster, TV_ApplicationBasicCluster, TV_MediaPlaybackCluster, TV_TvChannelCluster, TV_LowPowerCluster, TV_MediaInputCluster, TestCluster, TestConstraints, TestDelayCommands, TestSubscribe_OnOff, Test_TC_OO_1_1, Test_TC_OO_2_1, Test_TC_OO_2_2, Test_TC_DM_1_1, Test_TC_DM_3_1, Test_TC_CC_3_4, Test_TC_CC_5, Test_TC_CC_6, Test_TC_CC_7, Test_TC_CC_8, Test_TC_WNCV_1_1, Test_TC_WNCV_2_1, Test_TC_WNCV_3_1, Test_TC_WNCV_3_2, Test_TC_WNCV_3_3, Test_TC_BI_1_1, Test_TC_FLW_1_1, Test_TC_TM_1_1, Test_TC_OCC_1_1, TestOperationalCredentialsCluster, Test_TC_LVL_1_1, Test_TC_CC_1_1, Test_TC_RH_1_1, Test_TC_MC_1_1, Test_TC_TSTAT_1_1, Test_TC_PCC_1_1, Test_TC_TSUIC_1_1"}} +{{>test_cluster tests="TV_TargetNavigatorCluster, TV_AudioOutputCluster, TV_ApplicationLauncherCluster, TV_KeypadInputCluster, TV_AccountLoginCluster, TV_WakeOnLanCluster, TV_ApplicationBasicCluster, TV_MediaPlaybackCluster, TV_TvChannelCluster, TV_LowPowerCluster, TV_MediaInputCluster, TestCluster, TestConstraints, TestDelayCommands, TestSubscribe_OnOff, Test_TC_OO_1_1, Test_TC_OO_2_1, Test_TC_OO_2_2, Test_TC_DM_1_1, Test_TC_DM_3_1, Test_TC_CC_3_4, Test_TC_CC_5, Test_TC_CC_6, Test_TC_CC_7, Test_TC_CC_8, Test_TC_WNCV_1_1, Test_TC_WNCV_2_1, Test_TC_WNCV_3_1, Test_TC_WNCV_3_2, Test_TC_WNCV_3_3, Test_TC_BI_1_1, Test_TC_FLW_1_1, Test_TC_TM_1_1, Test_TC_OCC_1_1, TestOperationalCredentialsCluster, Test_TC_LVL_1_1, Test_TC_CC_1_1, Test_TC_RH_1_1, Test_TC_MC_1_1, Test_TC_TSTAT_1_1, Test_TC_PCC_1_1, Test_TC_TSUIC_1_1, Test_TC_TM_2_1, Test_TC_TSUIC_2_1, Test_TC_PCC_2_1"}} diff --git a/src/app/tests/suites/certification/Test_TC_PCC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_PCC_2_1.yaml new file mode 100644 index 00000000000000..f43206c12ef817 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_PCC_2_1.yaml @@ -0,0 +1,837 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 15.2.1. [TC-PCC-2.1] Attributes with server as DUT + +config: + cluster: "Pump Configuration and Control" + endpoint: 1 + +tests: + - label: "read the mandatory attribute: MaxPressure" + disabled: true + command: "readAttribute" + attribute: "max pressure" + response: + value: null + + - label: "read the mandatory attribute: MaxPressure" + command: "readAttribute" + attribute: "max pressure" + response: + constraints: + type: int16 + + - label: "read the mandatory attribute: MaxSpeed" + disabled: true + command: "readAttribute" + attribute: "max speed" + response: + value: null + + - label: "read the mandatory attribute: MaxSpeed" + disabled: true + command: "readAttribute" + attribute: "max speed" + response: + constraints: + type: uint16 + + - label: "read the mandatory attribute: MaxFlow" + disabled: true + command: "readAttribute" + attribute: "max flow" + response: + value: null + + - label: "read the mandatory attribute: MaxFlow" + disabled: true + command: "readAttribute" + attribute: "max flow" + response: + constraints: + type: uint16 + + - label: "read the mandatory attribute: EffectiveOperationMode" + disabled: true + command: "readAttribute" + attribute: "effective operation mode" + response: + value: desc + + - label: "read the mandatory attribute: EffectiveOperationMode" + command: "readAttribute" + attribute: "effective operation mode" + response: + constraints: + type: enum8 + + - label: "read the mandatory attribute: EffectiveControlMode" + disabled: true + command: "readAttribute" + attribute: "effective control mode" + response: + value: desc + + - label: "read the mandatory attribute: EffectiveControlMode" + command: "readAttribute" + attribute: "effective control mode" + response: + constraints: + type: enum8 + + - label: "read the mandatory attribute: Capacity" + disabled: true + command: "readAttribute" + attribute: "capacity" + response: + value: null + + - label: "read the mandatory attribute: Capacity" + command: "readAttribute" + attribute: "capacity" + response: + constraints: + type: int16 + + - label: "write to the mandatory attribute: MaxPressure" + disabled: true + command: "writeAttribute" + attribute: "max pressure" + arguments: + value: null + response: + error: 1 + + - label: "write to the mandatory attribute: MaxSpeed" + disabled: true + command: "writeAttribute" + attribute: "max speed" + arguments: + value: null + response: + error: 1 + + - label: "write to the mandatory attribute: MaxFlow" + disabled: true + command: "writeAttribute" + attribute: "max flow" + arguments: + value: null + response: + error: 1 + + - label: "write to the mandatory attribute: EffectiveOperationMode" + disabled: true + command: "writeAttribute" + attribute: "effective operation mode" + arguments: + value: desc + response: + error: 1 + + - label: "write to the mandatory attribute: EffectiveControlMode" + disabled: true + command: "writeAttribute" + attribute: "effective control mode" + arguments: + value: desc + response: + error: 1 + + - label: "write to the mandatory attribute: Capacity" + disabled: true + command: "writeAttribute" + attribute: "capacity" + arguments: + value: null + response: + error: 1 + + - label: "read the mandatory attribute: MaxPressure" + disabled: true + command: "readAttribute" + attribute: "max pressure" + response: + value: null + + - label: "read the mandatory attribute: MaxPressure" + command: "readAttribute" + attribute: "max pressure" + response: + constraints: + type: int16 + + - label: "read the mandatory attribute: MaxSpeed" + disabled: true + command: "readAttribute" + attribute: "max speed" + response: + value: null + + - label: "read the mandatory attribute: MaxSpeed" + disabled: true + command: "readAttribute" + attribute: "max speed" + response: + constraints: + type: uint16 + + - label: "read the mandatory attribute: MaxFlow" + disabled: true + command: "readAttribute" + attribute: "max flow" + response: + value: null + + - label: "read the mandatory attribute: MaxFlow" + disabled: true + command: "readAttribute" + attribute: "max flow" + response: + constraints: + type: uint16 + + - label: "read the mandatory attribute: EffectiveOperationMode" + disabled: true + command: "readAttribute" + attribute: "effective operation mode" + response: + value: desc + + - label: "read the mandatory attribute: EffectiveOperationMode" + command: "readAttribute" + attribute: "effective operation mode" + response: + constraints: + type: enum8 + + - label: "read the mandatory attribute: EffectiveControlMode" + disabled: true + command: "readAttribute" + attribute: "effective control mode" + response: + value: desc + + - label: "read the mandatory attribute: EffectiveControlMode" + command: "readAttribute" + attribute: "effective control mode" + response: + constraints: + type: enum8 + + - label: "read the mandatory attribute: Capacity" + disabled: true + command: "readAttribute" + attribute: "capacity" + response: + value: null + + - label: "read the mandatory attribute: Capacity" + command: "readAttribute" + attribute: "capacity" + response: + constraints: + type: int16 + + - label: "read the optional attribute: MinConstPressure" + disabled: true + command: "readAttribute" + attribute: "MinConstPressure" + response: + value: null + + - label: "read the optional attribute: MinConstPressure" + disabled: true + command: "readAttribute" + attribute: "MinConstPressure" + response: + constraints: + type: int16 + + - label: "read the optional attribute: MaxConstPressure" + disabled: true + command: "readAttribute" + attribute: "MaxConstPressure" + response: + value: null + + - label: "read the optional attribute: MaxConstPressure" + disabled: true + command: "readAttribute" + attribute: "MaxConstPressure" + response: + constraints: + type: int16 + + - label: "read the optional attribute: MinCompPressure" + disabled: true + command: "readAttribute" + attribute: "MinCompPressure" + response: + value: null + + - label: "read the optional attribute: MinCompPressure" + disabled: true + command: "readAttribute" + attribute: "MinCompPressure" + response: + constraints: + type: int16 + + - label: "read the optional attribute: MaxCompPressure" + disabled: true + command: "readAttribute" + attribute: "MaxCompPressure" + response: + value: null + + - label: "read the optional attribute: MaxCompPressure" + disabled: true + command: "readAttribute" + attribute: "MaxCompPressure" + response: + constraints: + type: int16 + + - label: "read the optional attribute: MinConstSpeed" + disabled: true + command: "readAttribute" + attribute: "MinConstSpeed" + response: + value: null + + - label: "read the optional attribute: MinConstSpeed" + disabled: true + command: "readAttribute" + attribute: "MinConstSpeed" + response: + constraints: + type: uint16 + + - label: "read the optional attribute: MaxConstSpeed" + disabled: true + command: "readAttribute" + attribute: "MaxConstSpeed" + response: + value: null + + - label: "read the optional attribute: MaxConstSpeed" + disabled: true + command: "readAttribute" + attribute: "MaxConstSpeed" + response: + constraints: + type: uint16 + + - label: "read the optional attribute: MinConstFlow" + disabled: true + command: "readAttribute" + attribute: "MinConstFlow" + response: + value: null + + - label: "read the optional attribute: MinConstFlow" + disabled: true + command: "readAttribute" + attribute: "MinConstFlow" + response: + constraints: + type: uint16 + + - label: "read the optional attribute: MaxConstFlow" + disabled: true + command: "readAttribute" + attribute: "MaxConstFlow" + response: + value: null + + - label: "read the optional attribute: MaxConstFlow" + disabled: true + command: "readAttribute" + attribute: "MaxConstFlow" + response: + constraints: + type: uint16 + + - label: "read the optional attribute: MinConstTemp" + disabled: true + command: "readAttribute" + attribute: "MinConstTemp" + response: + value: null + + - label: "read the optional attribute: MinConstTemp" + disabled: true + command: "readAttribute" + attribute: "MinConstTemp" + response: + constraints: + type: int16 + minValue: -27315 + + - label: "read the optional attribute: MaxConstTemp" + disabled: true + command: "readAttribute" + attribute: "MaxConstTemp" + response: + value: null + + - label: "read the optional attribute: MaxConstTemp" + disabled: true + command: "readAttribute" + attribute: "MaxConstTemp" + response: + constraints: + type: int16 + minValue: -27315 + + - label: "read the optional attribute: PumpStatus" + disabled: true + command: "readAttribute" + attribute: "pump status" + response: + value: 0 + + - label: "read the optional attribute: PumpStatus" + disabled: true + command: "readAttribute" + attribute: "pump status" + response: + constraints: + type: map16 + + - label: "read the optional attribute: Speed" + disabled: true + command: "readAttribute" + attribute: "speed" + response: + value: null + + - label: "read the optional attribute: Speed" + disabled: true + command: "readAttribute" + attribute: "speed" + response: + constraints: + type: uint16 + + - label: "read the optional attribute: LifetimeRunningHours" + disabled: true + command: "readAttribute" + attribute: "lifetime running hours" + response: + value: 0 + + - label: "read the optional attribute: LifetimeRunningHours" + disabled: true + command: "readAttribute" + attribute: "lifetime running hours" + response: + constraints: + type: uint24 + + - label: "read the optional attribute: Power" + disabled: true + command: "readAttribute" + attribute: "power" + response: + value: null + + - label: "read the optional attribute: Power" + disabled: true + command: "readAttribute" + attribute: "power" + response: + constraints: + type: uint24 + + - label: "read the optional attribute: LifetimeEnergyConsumed" + disabled: true + command: "readAttribute" + attribute: "lifetime energy consumed" + response: + value: 0 + + - label: "read the optional attribute: LifetimeEnergyConsumed" + disabled: true + command: "readAttribute" + attribute: "lifetime energy consumed" + response: + constraints: + type: uint32 + + - label: "write to the optional attribute: MinConstPressure" + disabled: true + command: "writeAttribute" + attribute: "MinConstPressure" + arguments: + value: null + response: + error: 1 + + - label: "write to the optional attribute: MaxConstPressure" + disabled: true + command: "writeAttribute" + attribute: "MaxConstPressure" + arguments: + value: null + response: + error: 1 + + - label: "write to the optional attribute: MinCompPressure" + disabled: true + command: "writeAttribute" + attribute: "MinCompPressure" + arguments: + value: null + response: + error: 1 + + - label: "write to the optional attribute: MaxCompPressure" + disabled: true + command: "writeAttribute" + attribute: "MaxCompPressure" + arguments: + value: null + response: + error: 1 + + - label: "write to the optional attribute: MinConstSpeed" + disabled: true + command: "writeAttribute" + attribute: "MinConstSpeed" + arguments: + value: null + response: + error: 1 + + - label: "write to the optional attribute: MaxConstSpeed" + disabled: true + command: "writeAttribute" + attribute: "MaxConstSpeed" + arguments: + value: null + response: + error: 1 + + - label: "write to the optional attribute: MinConstFlow" + disabled: true + command: "writeAttribute" + attribute: "MinConstFlow" + arguments: + value: null + response: + error: 1 + + - label: "write to the optional attribute: MaxConstFlow" + disabled: true + command: "writeAttribute" + attribute: "MaxConstFlow" + arguments: + value: null + response: + error: 1 + + - label: "write to the optional attribute: MinConstTemp" + disabled: true + command: "writeAttribute" + attribute: "MinConstTemp" + arguments: + value: null + response: + error: 1 + + - label: "write to the optional attribute: MaxConstTemp" + disabled: true + command: "writeAttribute" + attribute: "MaxConstTemp" + arguments: + value: null + response: + error: 1 + + - label: "write to the optional attribute: PumpStatus" + disabled: true + command: "writeAttribute" + attribute: "pump status" + arguments: + value: 0 + response: + error: 1 + + - label: "write to the optional attribute: Speed" + disabled: true + command: "writeAttribute" + attribute: "speed" + arguments: + value: null + response: + error: 1 + + - label: "write to the optional attribute: LifetimeRunningHours" + disabled: true + command: "writeAttribute" + attribute: "lifetime running hours" + arguments: + value: 0 + response: + error: 0 + + - label: "write to the optional attribute: Power" + disabled: true + command: "writeAttribute" + attribute: "power" + arguments: + value: null + response: + error: 1 + + - label: "write to the optional attribute: LifetimeEnergyConsumed" + disabled: true + command: "writeAttribute" + attribute: "lifetime energy consumed" + arguments: + value: 0 + response: + error: 0 + + - label: "read the optional attribute: MinConstPressure" + disabled: true + command: "readAttribute" + attribute: "MinConstPressure" + response: + value: null + + - label: "read the optional attribute: MinConstPressure" + disabled: true + command: "readAttribute" + attribute: "MinConstPressure" + response: + constraints: + type: int16 + + - label: "read the optional attribute: MaxConstPressure" + disabled: true + command: "readAttribute" + attribute: "MaxConstPressure" + response: + value: null + + - label: "read the optional attribute: MaxConstPressure" + disabled: true + command: "readAttribute" + attribute: "MaxConstPressure" + response: + constraints: + type: int16 + + - label: "read the optional attribute: MinCompPressure" + disabled: true + command: "readAttribute" + attribute: "MinCompPressure" + response: + value: null + + - label: "read the optional attribute: MinCompPressure" + disabled: true + command: "readAttribute" + attribute: "MinCompPressure" + response: + constraints: + type: int16 + + - label: "read the optional attribute: MaxCompPressure" + disabled: true + command: "readAttribute" + attribute: "MaxCompPressure" + response: + value: null + + - label: "read the optional attribute: MaxCompPressure" + disabled: true + command: "readAttribute" + attribute: "MaxCompPressure" + response: + constraints: + type: int16 + + - label: "read the optional attribute: MinConstSpeed" + disabled: true + command: "readAttribute" + attribute: "MinConstSpeed" + response: + value: null + + - label: "read the optional attribute: MinConstSpeed" + disabled: true + command: "readAttribute" + attribute: "MinConstSpeed" + response: + constraints: + type: uint16 + + - label: "read the optional attribute: MaxConstSpeed" + disabled: true + command: "readAttribute" + attribute: "MaxConstSpeed" + response: + value: null + + - label: "read the optional attribute: MaxConstSpeed" + disabled: true + command: "readAttribute" + attribute: "MaxConstSpeed" + response: + constraints: + type: uint16 + + - label: "read the optional attribute: MinConstFlow" + disabled: true + command: "readAttribute" + attribute: "MinConstFlow" + response: + value: null + + - label: "read the optional attribute: MinConstFlow" + disabled: true + command: "readAttribute" + attribute: "MinConstFlow" + response: + constraints: + type: uint16 + + - label: "read the optional attribute: MaxConstFlow" + disabled: true + command: "readAttribute" + attribute: "MaxConstFlow" + response: + value: null + + - label: "read the optional attribute: MaxConstFlow" + disabled: true + command: "readAttribute" + attribute: "MaxConstFlow" + response: + constraints: + type: uint16 + + - label: "read the optional attribute: MinConstTemp" + disabled: true + command: "readAttribute" + attribute: "MinConstTemp" + response: + value: null + + - label: "read the optional attribute: MinConstTemp" + disabled: true + command: "readAttribute" + attribute: "MinConstTemp" + response: + constraints: + type: int16 + minValue: -27315 + + - label: "read the optional attribute: MaxConstTemp" + disabled: true + command: "readAttribute" + attribute: "MaxConstTemp" + response: + value: null + + - label: "read the optional attribute: MaxConstTemp" + disabled: true + command: "readAttribute" + attribute: "MaxConstTemp" + response: + constraints: + type: int16 + minValue: -27315 + + - label: "read the optional attribute: PumpStatus" + disabled: true + command: "readAttribute" + attribute: "pump status" + response: + value: 0 + + - label: "read the optional attribute: PumpStatus" + disabled: true + command: "readAttribute" + attribute: "pump status" + response: + constraints: + type: map16 + + - label: "read the optional attribute: Speed" + disabled: true + command: "readAttribute" + attribute: "speed" + response: + value: null + + - label: "read the optional attribute: Speed" + disabled: true + command: "readAttribute" + attribute: "speed" + response: + constraints: + type: uint16 + + - label: "read the optional attribute: LifetimeRunningHours" + disabled: true + command: "readAttribute" + attribute: "lifetime running hours" + response: + value: 0 + + - label: "read the optional attribute: LifetimeRunningHours" + disabled: true + command: "readAttribute" + attribute: "lifetime running hours" + response: + constraints: + type: uint24 + + - label: "read the optional attribute: Power" + disabled: true + command: "readAttribute" + attribute: "power" + response: + value: null + + - label: "read the optional attribute: Power" + disabled: true + command: "readAttribute" + attribute: "power" + response: + constraints: + type: uint24 + + - label: "read the optional attribute: LifetimeEnergyConsumed" + disabled: true + command: "readAttribute" + attribute: "lifetime energy consumed" + response: + value: 0 + + - label: "read the optional attribute: LifetimeEnergyConsumed" + disabled: true + command: "readAttribute" + attribute: "lifetime energy consumed" + response: + constraints: + type: uint32 + + diff --git a/src/app/tests/suites/certification/Test_TC_TM_2_1.yaml b/src/app/tests/suites/certification/Test_TC_TM_2_1.yaml new file mode 100644 index 00000000000000..a6e0f4f172f848 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_TM_2_1.yaml @@ -0,0 +1,57 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 6.2.1. [TC-TM-2.1] Attributes with server as DUT + +config: + cluster: "Temperature Measurement" + endpoint: 1 + +tests: + - label: "read the mandatory attribute: MeasuredValue" + command: "readAttribute" + attribute: "measured value" + response: + constraints: + type: int16 + + - label: "read the mandatory attribute: MinMeasuredValue" + disabled: true + command: "readAttribute" + attribute: "min measured value" + response: + constraints: + type: int16 + minValue: -27315 + maxValue: 32766 + + - label: "read the mandatory attribute: MaxMeasuredValue" + disabled: true + command: "readAttribute" + attribute: "max measured value" + response: + constraints: + type: int16 + minValue: -27314 + maxValue: 32767 + + - label: "read the optional attribute: Tolerance" + disabled: true + command: "readAttribute" + attribute: "Tolerance" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 2048 diff --git a/src/app/tests/suites/certification/Test_TC_TSUIC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_TSUIC_2_1.yaml new file mode 100644 index 00000000000000..987fcabfdfe94e --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_TSUIC_2_1.yaml @@ -0,0 +1,122 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 12.2.1. [TC-TSUIC-2.1] Attributes with server as DUT + +config: + cluster: "Thermostat User Interface Configuration" + endpoint: 1 + +tests: + - label: "read the mandatory attribute: TemperatureDisplayMode" + command: "readAttribute" + attribute: "temperature display mode" + response: + value: 0 + + - label: "read the mandatory attribute: TemperatureDisplayMode" + command: "readAttribute" + attribute: "temperature display mode" + response: + constraints: + type: enum8 + + - label: "write to the mandatory attribute: TemperatureDisplayMode" + command: "writeAttribute" + attribute: "temperature display mode" + arguments: + value: 0 + response: + error: 0 + + - label: "read the mandatory attribute: TemperatureDisplayMode" + command: "readAttribute" + attribute: "temperature display mode" + response: + value: 0 + + - label: "read the mandatory attribute: TemperatureDisplayMode" + command: "readAttribute" + attribute: "temperature display mode" + response: + constraints: + type: enum8 + + - label: "read the mandatory attribute: KeypadLockout" + command: "readAttribute" + attribute: "keypad lockout" + response: + value: 0 + + - label: "read the mandatory attribute: KeypadLockout" + command: "readAttribute" + attribute: "keypad lockout" + response: + constraints: + type: enum8 + + - label: "write to the mandatory attribute: KeypadLockout" + command: "writeAttribute" + attribute: "keypad lockout" + arguments: + value: 0 + response: + error: 0 + + - label: "read the mandatory attribute: KeypadLockout" + command: "readAttribute" + attribute: "keypad lockout" + response: + value: 0 + + - label: "read the mandatory attribute: KeypadLockout" + command: "readAttribute" + attribute: "keypad lockout" + response: + constraints: + type: enum8 + + - label: "read the optional attribute: ScheduleProgrammingVisibility" + command: "readAttribute" + attribute: "schedule programming visibility" + response: + value: 0 + + - label: "read the optional attribute: ScheduleProgrammingVisibility" + command: "readAttribute" + attribute: "schedule programming visibility" + response: + constraints: + type: enum8 + + - label: "write to the mandatory attribute: ScheduleProgrammingVisibility" + command: "writeAttribute" + attribute: "schedule programming visibility" + arguments: + value: 0 + response: + error: 0 + + - label: "read the optional attribute: ScheduleProgrammingVisibility" + command: "readAttribute" + attribute: "schedule programming visibility" + response: + value: 0 + + - label: "read the optional attribute: ScheduleProgrammingVisibility" + command: "readAttribute" + attribute: "schedule programming visibility" + response: + constraints: + type: enum8 diff --git a/src/darwin/Framework/CHIP/templates/clusters-tests.zapt b/src/darwin/Framework/CHIP/templates/clusters-tests.zapt index 8eb1dcf43edf72..b40bffa25ba407 100644 --- a/src/darwin/Framework/CHIP/templates/clusters-tests.zapt +++ b/src/darwin/Framework/CHIP/templates/clusters-tests.zapt @@ -143,7 +143,7 @@ CHIPDevice * GetPairedDevice(uint64_t deviceId) [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -{{>test_cluster tests="TestCluster, TestConstraints, TestDelayCommands, TestSubscribe_OnOff, Test_TC_OO_1_1, Test_TC_OO_2_1, Test_TC_OO_2_2, Test_TC_DM_1_1, Test_TC_DM_3_1, Test_TC_CC_3_4, Test_TC_CC_5, Test_TC_CC_6, Test_TC_CC_7, Test_TC_CC_8, Test_TC_WNCV_1_1, Test_TC_WNCV_2_1, Test_TC_WNCV_3_1, Test_TC_WNCV_3_2, Test_TC_WNCV_3_3, Test_TC_BI_1_1, Test_TC_FLW_1_1, Test_TC_TM_1_1, Test_TC_OCC_1_1, TestOperationalCredentialsCluster, Test_TC_LVL_1_1, Test_TC_CC_1_1, Test_TC_RH_1_1, Test_TC_MC_1_1, Test_TC_TSTAT_1_1, Test_TC_PCC_1_1, Test_TC_TSUIC_1_1"}} +{{>test_cluster tests="TestCluster, TestConstraints, TestDelayCommands, TestSubscribe_OnOff, Test_TC_OO_1_1, Test_TC_OO_2_1, Test_TC_OO_2_2, Test_TC_DM_1_1, Test_TC_DM_3_1, Test_TC_CC_3_4, Test_TC_CC_5, Test_TC_CC_6, Test_TC_CC_7, Test_TC_CC_8, Test_TC_WNCV_1_1, Test_TC_WNCV_2_1, Test_TC_WNCV_3_1, Test_TC_WNCV_3_2, Test_TC_WNCV_3_3, Test_TC_BI_1_1, Test_TC_FLW_1_1, Test_TC_TM_1_1, Test_TC_OCC_1_1, TestOperationalCredentialsCluster, Test_TC_LVL_1_1, Test_TC_CC_1_1, Test_TC_RH_1_1, Test_TC_MC_1_1, Test_TC_TSTAT_1_1, Test_TC_PCC_1_1, Test_TC_TSUIC_1_1, Test_TC_TM_2_1, Test_TC_TSUIC_2_1, Test_TC_PCC_2_1"}} {{#chip_client_clusters}} {{#unless (isStrEqual "Test Cluster" name)}} From 52605d2bfb434f5e1a6e122107df47760ad6b2f8 Mon Sep 17 00:00:00 2001 From: Raju Palagummi Date: Thu, 23 Sep 2021 11:15:44 -0700 Subject: [PATCH 2/3] Update generated tests --- .../Framework/CHIPTests/CHIPClustersTests.m | 517 ++++++++++ .../chip-tool/zap-generated/test/Commands.h | 928 ++++++++++++++++++ 2 files changed, 1445 insertions(+) diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index 927c14ed575650..33ca4c47db4ee5 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -6654,6 +6654,523 @@ - (void)testSendClusterTest_TC_TSUIC_1_1_000000_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTest_TC_TM_2_1_000000_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MeasuredValue"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTemperatureMeasurement * cluster = [[CHIPTestTemperatureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeMeasuredValueWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: MeasuredValue Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_TSUIC_2_1_000000_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: TemperatureDisplayMode"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTemperatureDisplayModeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: TemperatureDisplayMode Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TSUIC_2_1_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: TemperatureDisplayMode"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTemperatureDisplayModeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: TemperatureDisplayMode Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TSUIC_2_1_000002_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"write to the mandatory attribute: TemperatureDisplayMode"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint8_t temperatureDisplayModeArgument = 0; + [cluster writeAttributeTemperatureDisplayModeWithValue:temperatureDisplayModeArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write to the mandatory attribute: TemperatureDisplayMode Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TSUIC_2_1_000003_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: TemperatureDisplayMode"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTemperatureDisplayModeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: TemperatureDisplayMode Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TSUIC_2_1_000004_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: TemperatureDisplayMode"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeTemperatureDisplayModeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: TemperatureDisplayMode Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TSUIC_2_1_000005_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: KeypadLockout"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeKeypadLockoutWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: KeypadLockout Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TSUIC_2_1_000006_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: KeypadLockout"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeKeypadLockoutWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: KeypadLockout Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TSUIC_2_1_000007_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"write to the mandatory attribute: KeypadLockout"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint8_t keypadLockoutArgument = 0; + [cluster writeAttributeKeypadLockoutWithValue:keypadLockoutArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write to the mandatory attribute: KeypadLockout Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TSUIC_2_1_000008_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: KeypadLockout"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeKeypadLockoutWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: KeypadLockout Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TSUIC_2_1_000009_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: KeypadLockout"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeKeypadLockoutWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: KeypadLockout Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TSUIC_2_1_000010_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"read the optional attribute: ScheduleProgrammingVisibility"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeScheduleProgrammingVisibilityWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the optional attribute: ScheduleProgrammingVisibility Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TSUIC_2_1_000011_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"read the optional attribute: ScheduleProgrammingVisibility"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeScheduleProgrammingVisibilityWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the optional attribute: ScheduleProgrammingVisibility Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TSUIC_2_1_000012_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"write to the mandatory attribute: ScheduleProgrammingVisibility"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint8_t scheduleProgrammingVisibilityArgument = 0; + [cluster + writeAttributeScheduleProgrammingVisibilityWithValue:scheduleProgrammingVisibilityArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"write to the mandatory attribute: ScheduleProgrammingVisibility Error: %@", + err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TSUIC_2_1_000013_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"read the optional attribute: ScheduleProgrammingVisibility"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeScheduleProgrammingVisibilityWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the optional attribute: ScheduleProgrammingVisibility Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_TSUIC_2_1_000014_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"read the optional attribute: ScheduleProgrammingVisibility"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestThermostatUserInterfaceConfiguration * cluster = + [[CHIPTestThermostatUserInterfaceConfiguration alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeScheduleProgrammingVisibilityWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the optional attribute: ScheduleProgrammingVisibility Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_PCC_2_1_000000_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MaxPressure"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeMaxPressureWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: MaxPressure Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_1_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: EffectiveOperationMode"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEffectiveOperationModeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: EffectiveOperationMode Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_1_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: EffectiveControlMode"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEffectiveControlModeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: EffectiveControlMode Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_1_000003_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: Capacity"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeCapacityWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: Capacity Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_1_000004_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: MaxPressure"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeMaxPressureWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: MaxPressure Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_1_000005_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: EffectiveOperationMode"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEffectiveOperationModeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: EffectiveOperationMode Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_1_000006_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: EffectiveControlMode"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEffectiveControlModeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: EffectiveControlMode Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_1_000007_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the mandatory attribute: Capacity"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeCapacityWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the mandatory attribute: Capacity Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterAccountLoginReadAttributeClusterRevisionWithResponseHandler { XCTestExpectation * expectation = diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index defe5ee4ed3419..74f818ecd3ab7c 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -12347,6 +12347,931 @@ class Test_TC_TSUIC_1_1 : public TestCommand void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } }; +class Test_TC_TM_2_1 : public TestCommand +{ +public: + Test_TC_TM_2_1() : TestCommand("Test_TC_TM_2_1"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TM_2_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TM_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : read the mandatory attribute: MeasuredValue\n"); + err = TestReadTheMandatoryAttributeMeasuredValue_0(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 1; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + + static void OnFailureCallback_0(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_0(status); + } + + static void OnSuccessCallback_0(void * context, int16_t measuredValue) + { + (static_cast(context))->OnSuccessResponse_0(measuredValue); + } + + // + // Tests methods + // + + CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_0() + { + chip::Controller::TemperatureMeasurementClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeMeasuredValue(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + } + + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_0(int16_t measuredValue) + { + VerifyOrReturn(CheckConstraintType("measuredValue", "", "int16")); + NextTest(); + } +}; + +class Test_TC_TSUIC_2_1 : public TestCommand +{ +public: + Test_TC_TSUIC_2_1() : TestCommand("Test_TC_TSUIC_2_1"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSUIC_2_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSUIC_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : read the mandatory attribute: TemperatureDisplayMode\n"); + err = TestReadTheMandatoryAttributeTemperatureDisplayMode_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : read the mandatory attribute: TemperatureDisplayMode\n"); + err = TestReadTheMandatoryAttributeTemperatureDisplayMode_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : write to the mandatory attribute: TemperatureDisplayMode\n"); + err = TestWriteToTheMandatoryAttributeTemperatureDisplayMode_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : read the mandatory attribute: TemperatureDisplayMode\n"); + err = TestReadTheMandatoryAttributeTemperatureDisplayMode_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : read the mandatory attribute: TemperatureDisplayMode\n"); + err = TestReadTheMandatoryAttributeTemperatureDisplayMode_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : read the mandatory attribute: KeypadLockout\n"); + err = TestReadTheMandatoryAttributeKeypadLockout_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : read the mandatory attribute: KeypadLockout\n"); + err = TestReadTheMandatoryAttributeKeypadLockout_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : write to the mandatory attribute: KeypadLockout\n"); + err = TestWriteToTheMandatoryAttributeKeypadLockout_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : read the mandatory attribute: KeypadLockout\n"); + err = TestReadTheMandatoryAttributeKeypadLockout_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : read the mandatory attribute: KeypadLockout\n"); + err = TestReadTheMandatoryAttributeKeypadLockout_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : read the optional attribute: ScheduleProgrammingVisibility\n"); + err = TestReadTheOptionalAttributeScheduleProgrammingVisibility_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : read the optional attribute: ScheduleProgrammingVisibility\n"); + err = TestReadTheOptionalAttributeScheduleProgrammingVisibility_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : write to the mandatory attribute: ScheduleProgrammingVisibility\n"); + err = TestWriteToTheMandatoryAttributeScheduleProgrammingVisibility_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : read the optional attribute: ScheduleProgrammingVisibility\n"); + err = TestReadTheOptionalAttributeScheduleProgrammingVisibility_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : read the optional attribute: ScheduleProgrammingVisibility\n"); + err = TestReadTheOptionalAttributeScheduleProgrammingVisibility_14(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 15; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, + this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, + this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, + this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, + this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, + this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; + chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; + chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; + chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; + chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; + chip::Callback::Callback mOnFailureCallback_8{ OnFailureCallback_8, this }; + chip::Callback::Callback mOnSuccessCallback_8{ OnSuccessCallback_8, this }; + chip::Callback::Callback mOnFailureCallback_9{ OnFailureCallback_9, this }; + chip::Callback::Callback mOnSuccessCallback_9{ OnSuccessCallback_9, this }; + chip::Callback::Callback mOnFailureCallback_10{ OnFailureCallback_10, this }; + chip::Callback::Callback mOnSuccessCallback_10{ + OnSuccessCallback_10, this + }; + chip::Callback::Callback mOnFailureCallback_11{ OnFailureCallback_11, this }; + chip::Callback::Callback mOnSuccessCallback_11{ + OnSuccessCallback_11, this + }; + chip::Callback::Callback mOnFailureCallback_12{ OnFailureCallback_12, this }; + chip::Callback::Callback mOnSuccessCallback_12{ + OnSuccessCallback_12, this + }; + chip::Callback::Callback mOnFailureCallback_13{ OnFailureCallback_13, this }; + chip::Callback::Callback mOnSuccessCallback_13{ + OnSuccessCallback_13, this + }; + chip::Callback::Callback mOnFailureCallback_14{ OnFailureCallback_14, this }; + chip::Callback::Callback mOnSuccessCallback_14{ + OnSuccessCallback_14, this + }; + + static void OnFailureCallback_0(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_0(status); + } + + static void OnSuccessCallback_0(void * context, uint8_t temperatureDisplayMode) + { + (static_cast(context))->OnSuccessResponse_0(temperatureDisplayMode); + } + + static void OnFailureCallback_1(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context, uint8_t temperatureDisplayMode) + { + (static_cast(context))->OnSuccessResponse_1(temperatureDisplayMode); + } + + static void OnFailureCallback_2(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_2(status); + } + + static void OnSuccessCallback_2(void * context, uint8_t temperatureDisplayMode) + { + (static_cast(context))->OnSuccessResponse_2(temperatureDisplayMode); + } + + static void OnFailureCallback_3(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_3(status); + } + + static void OnSuccessCallback_3(void * context, uint8_t temperatureDisplayMode) + { + (static_cast(context))->OnSuccessResponse_3(temperatureDisplayMode); + } + + static void OnFailureCallback_4(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_4(status); + } + + static void OnSuccessCallback_4(void * context, uint8_t temperatureDisplayMode) + { + (static_cast(context))->OnSuccessResponse_4(temperatureDisplayMode); + } + + static void OnFailureCallback_5(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_5(status); + } + + static void OnSuccessCallback_5(void * context, uint8_t keypadLockout) + { + (static_cast(context))->OnSuccessResponse_5(keypadLockout); + } + + static void OnFailureCallback_6(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_6(status); + } + + static void OnSuccessCallback_6(void * context, uint8_t keypadLockout) + { + (static_cast(context))->OnSuccessResponse_6(keypadLockout); + } + + static void OnFailureCallback_7(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_7(status); + } + + static void OnSuccessCallback_7(void * context, uint8_t keypadLockout) + { + (static_cast(context))->OnSuccessResponse_7(keypadLockout); + } + + static void OnFailureCallback_8(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_8(status); + } + + static void OnSuccessCallback_8(void * context, uint8_t keypadLockout) + { + (static_cast(context))->OnSuccessResponse_8(keypadLockout); + } + + static void OnFailureCallback_9(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_9(status); + } + + static void OnSuccessCallback_9(void * context, uint8_t keypadLockout) + { + (static_cast(context))->OnSuccessResponse_9(keypadLockout); + } + + static void OnFailureCallback_10(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_10(status); + } + + static void OnSuccessCallback_10(void * context, uint8_t scheduleProgrammingVisibility) + { + (static_cast(context))->OnSuccessResponse_10(scheduleProgrammingVisibility); + } + + static void OnFailureCallback_11(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_11(status); + } + + static void OnSuccessCallback_11(void * context, uint8_t scheduleProgrammingVisibility) + { + (static_cast(context))->OnSuccessResponse_11(scheduleProgrammingVisibility); + } + + static void OnFailureCallback_12(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_12(status); + } + + static void OnSuccessCallback_12(void * context, uint8_t scheduleProgrammingVisibility) + { + (static_cast(context))->OnSuccessResponse_12(scheduleProgrammingVisibility); + } + + static void OnFailureCallback_13(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_13(status); + } + + static void OnSuccessCallback_13(void * context, uint8_t scheduleProgrammingVisibility) + { + (static_cast(context))->OnSuccessResponse_13(scheduleProgrammingVisibility); + } + + static void OnFailureCallback_14(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_14(status); + } + + static void OnSuccessCallback_14(void * context, uint8_t scheduleProgrammingVisibility) + { + (static_cast(context))->OnSuccessResponse_14(scheduleProgrammingVisibility); + } + + // + // Tests methods + // + + CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_0() + { + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeTemperatureDisplayMode(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + } + + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_0(uint8_t temperatureDisplayMode) + { + VerifyOrReturn(CheckValue("temperatureDisplayMode", temperatureDisplayMode, 0)); + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_1() + { + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeTemperatureDisplayMode(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + } + + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(uint8_t temperatureDisplayMode) + { + VerifyOrReturn(CheckConstraintType("temperatureDisplayMode", "", "enum8")); + NextTest(); + } + + CHIP_ERROR TestWriteToTheMandatoryAttributeTemperatureDisplayMode_2() + { + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t temperatureDisplayModeArgument = 0; + + return cluster.WriteAttributeTemperatureDisplayMode(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), + temperatureDisplayModeArgument); + } + + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2(uint8_t temperatureDisplayMode) { NextTest(); } + + CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_3() + { + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeTemperatureDisplayMode(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + } + + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_3(uint8_t temperatureDisplayMode) + { + VerifyOrReturn(CheckValue("temperatureDisplayMode", temperatureDisplayMode, 0)); + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeTemperatureDisplayMode_4() + { + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeTemperatureDisplayMode(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + } + + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_4(uint8_t temperatureDisplayMode) + { + VerifyOrReturn(CheckConstraintType("temperatureDisplayMode", "", "enum8")); + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_5() + { + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeKeypadLockout(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + } + + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_5(uint8_t keypadLockout) + { + VerifyOrReturn(CheckValue("keypadLockout", keypadLockout, 0)); + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_6() + { + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeKeypadLockout(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); + } + + void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_6(uint8_t keypadLockout) + { + VerifyOrReturn(CheckConstraintType("keypadLockout", "", "enum8")); + NextTest(); + } + + CHIP_ERROR TestWriteToTheMandatoryAttributeKeypadLockout_7() + { + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t keypadLockoutArgument = 0; + + return cluster.WriteAttributeKeypadLockout(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel(), + keypadLockoutArgument); + } + + void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_7(uint8_t keypadLockout) { NextTest(); } + + CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_8() + { + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeKeypadLockout(mOnSuccessCallback_8.Cancel(), mOnFailureCallback_8.Cancel()); + } + + void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_8(uint8_t keypadLockout) + { + VerifyOrReturn(CheckValue("keypadLockout", keypadLockout, 0)); + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeKeypadLockout_9() + { + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeKeypadLockout(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel()); + } + + void OnFailureResponse_9(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_9(uint8_t keypadLockout) + { + VerifyOrReturn(CheckConstraintType("keypadLockout", "", "enum8")); + NextTest(); + } + + CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_10() + { + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeScheduleProgrammingVisibility(mOnSuccessCallback_10.Cancel(), mOnFailureCallback_10.Cancel()); + } + + void OnFailureResponse_10(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_10(uint8_t scheduleProgrammingVisibility) + { + VerifyOrReturn(CheckValue("scheduleProgrammingVisibility", scheduleProgrammingVisibility, 0)); + NextTest(); + } + + CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_11() + { + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeScheduleProgrammingVisibility(mOnSuccessCallback_11.Cancel(), mOnFailureCallback_11.Cancel()); + } + + void OnFailureResponse_11(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_11(uint8_t scheduleProgrammingVisibility) + { + VerifyOrReturn(CheckConstraintType("scheduleProgrammingVisibility", "", "enum8")); + NextTest(); + } + + CHIP_ERROR TestWriteToTheMandatoryAttributeScheduleProgrammingVisibility_12() + { + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t scheduleProgrammingVisibilityArgument = 0; + + return cluster.WriteAttributeScheduleProgrammingVisibility(mOnSuccessCallback_12.Cancel(), mOnFailureCallback_12.Cancel(), + scheduleProgrammingVisibilityArgument); + } + + void OnFailureResponse_12(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_12(uint8_t scheduleProgrammingVisibility) { NextTest(); } + + CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_13() + { + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeScheduleProgrammingVisibility(mOnSuccessCallback_13.Cancel(), mOnFailureCallback_13.Cancel()); + } + + void OnFailureResponse_13(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_13(uint8_t scheduleProgrammingVisibility) + { + VerifyOrReturn(CheckValue("scheduleProgrammingVisibility", scheduleProgrammingVisibility, 0)); + NextTest(); + } + + CHIP_ERROR TestReadTheOptionalAttributeScheduleProgrammingVisibility_14() + { + chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeScheduleProgrammingVisibility(mOnSuccessCallback_14.Cancel(), mOnFailureCallback_14.Cancel()); + } + + void OnFailureResponse_14(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_14(uint8_t scheduleProgrammingVisibility) + { + VerifyOrReturn(CheckConstraintType("scheduleProgrammingVisibility", "", "enum8")); + NextTest(); + } +}; + +class Test_TC_PCC_2_1 : public TestCommand +{ +public: + Test_TC_PCC_2_1() : TestCommand("Test_TC_PCC_2_1"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_2_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : read the mandatory attribute: MaxPressure\n"); + err = TestReadTheMandatoryAttributeMaxPressure_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : read the mandatory attribute: EffectiveOperationMode\n"); + err = TestReadTheMandatoryAttributeEffectiveOperationMode_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : read the mandatory attribute: EffectiveControlMode\n"); + err = TestReadTheMandatoryAttributeEffectiveControlMode_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : read the mandatory attribute: Capacity\n"); + err = TestReadTheMandatoryAttributeCapacity_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : read the mandatory attribute: MaxPressure\n"); + err = TestReadTheMandatoryAttributeMaxPressure_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : read the mandatory attribute: EffectiveOperationMode\n"); + err = TestReadTheMandatoryAttributeEffectiveOperationMode_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : read the mandatory attribute: EffectiveControlMode\n"); + err = TestReadTheMandatoryAttributeEffectiveControlMode_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : read the mandatory attribute: Capacity\n"); + err = TestReadTheMandatoryAttributeCapacity_7(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 8; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, + this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, + this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, + this }; + chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; + chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, + this }; + chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; + chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; + + static void OnFailureCallback_0(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_0(status); + } + + static void OnSuccessCallback_0(void * context, int16_t maxPressure) + { + (static_cast(context))->OnSuccessResponse_0(maxPressure); + } + + static void OnFailureCallback_1(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context, uint8_t effectiveOperationMode) + { + (static_cast(context))->OnSuccessResponse_1(effectiveOperationMode); + } + + static void OnFailureCallback_2(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_2(status); + } + + static void OnSuccessCallback_2(void * context, uint8_t effectiveControlMode) + { + (static_cast(context))->OnSuccessResponse_2(effectiveControlMode); + } + + static void OnFailureCallback_3(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_3(status); + } + + static void OnSuccessCallback_3(void * context, int16_t capacity) + { + (static_cast(context))->OnSuccessResponse_3(capacity); + } + + static void OnFailureCallback_4(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_4(status); + } + + static void OnSuccessCallback_4(void * context, int16_t maxPressure) + { + (static_cast(context))->OnSuccessResponse_4(maxPressure); + } + + static void OnFailureCallback_5(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_5(status); + } + + static void OnSuccessCallback_5(void * context, uint8_t effectiveOperationMode) + { + (static_cast(context))->OnSuccessResponse_5(effectiveOperationMode); + } + + static void OnFailureCallback_6(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_6(status); + } + + static void OnSuccessCallback_6(void * context, uint8_t effectiveControlMode) + { + (static_cast(context))->OnSuccessResponse_6(effectiveControlMode); + } + + static void OnFailureCallback_7(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_7(status); + } + + static void OnSuccessCallback_7(void * context, int16_t capacity) + { + (static_cast(context))->OnSuccessResponse_7(capacity); + } + + // + // Tests methods + // + + CHIP_ERROR TestReadTheMandatoryAttributeMaxPressure_0() + { + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeMaxPressure(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + } + + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_0(int16_t maxPressure) + { + VerifyOrReturn(CheckConstraintType("maxPressure", "", "int16")); + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeEffectiveOperationMode_1() + { + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeEffectiveOperationMode(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + } + + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(uint8_t effectiveOperationMode) + { + VerifyOrReturn(CheckConstraintType("effectiveOperationMode", "", "enum8")); + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeEffectiveControlMode_2() + { + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeEffectiveControlMode(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + } + + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2(uint8_t effectiveControlMode) + { + VerifyOrReturn(CheckConstraintType("effectiveControlMode", "", "enum8")); + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeCapacity_3() + { + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeCapacity(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + } + + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_3(int16_t capacity) + { + VerifyOrReturn(CheckConstraintType("capacity", "", "int16")); + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeMaxPressure_4() + { + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeMaxPressure(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + } + + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_4(int16_t maxPressure) + { + VerifyOrReturn(CheckConstraintType("maxPressure", "", "int16")); + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeEffectiveOperationMode_5() + { + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeEffectiveOperationMode(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + } + + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_5(uint8_t effectiveOperationMode) + { + VerifyOrReturn(CheckConstraintType("effectiveOperationMode", "", "enum8")); + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeEffectiveControlMode_6() + { + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeEffectiveControlMode(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); + } + + void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_6(uint8_t effectiveControlMode) + { + VerifyOrReturn(CheckConstraintType("effectiveControlMode", "", "enum8")); + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeCapacity_7() + { + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeCapacity(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); + } + + void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_7(int16_t capacity) + { + VerifyOrReturn(CheckConstraintType("capacity", "", "int16")); + NextTest(); + } +}; + void registerCommandsTests(Commands & commands) { const char * clusterName = "Tests"; @@ -12394,6 +13319,9 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), + make_unique(), }; commands.Register(clusterName, clusterCommands); From 81a5a83aaeb6ab703da17d6e2cd1dff2bf80783b Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Thu, 23 Sep 2021 20:43:28 +0200 Subject: [PATCH 3/3] Update Test_TC_PCC_2_1.yaml --- src/app/tests/suites/certification/Test_TC_PCC_2_1.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/app/tests/suites/certification/Test_TC_PCC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_PCC_2_1.yaml index f43206c12ef817..c3fc9cd495cce8 100644 --- a/src/app/tests/suites/certification/Test_TC_PCC_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_PCC_2_1.yaml @@ -833,5 +833,3 @@ tests: response: constraints: type: uint32 - -