From 333052261ff7432e89ab661b71bf5b4eb6436d1d Mon Sep 17 00:00:00 2001 From: ManjunathRA Date: Sat, 5 Mar 2022 05:44:46 +0530 Subject: [PATCH] New test added 4 Mar (#15859) * New test added TC-I-1.1 TC-I-2.1 TC-MC-1.1 TC-MC-1.2 TC-MC-1.3 TC-MC-1.4 TC-MC-1.5 TC-MC-1.6 TC-MC-1.7 TC-MC-1.8 TC-MC-1.9 TC-MC-1.10 TC-MC-1.11 TC-MC-1.12 TC-PCC-2.4 * Added auto generated files --- examples/chip-tool/templates/tests/tests.js | 20 +- .../suites/certification/Test_TC_I_1_1.yaml | 56 +- .../suites/certification/Test_TC_I_2_1.yaml | 27 +- .../suites/certification/Test_TC_MC_1_1.yaml | 34 +- .../suites/certification/Test_TC_MC_1_10.yaml | 91 + .../suites/certification/Test_TC_MC_1_11.yaml | 91 + .../suites/certification/Test_TC_MC_1_12.yaml | 91 + .../suites/certification/Test_TC_MC_1_2.yaml | 90 + .../suites/certification/Test_TC_MC_1_3.yaml | 83 + .../suites/certification/Test_TC_MC_1_4.yaml | 90 + .../suites/certification/Test_TC_MC_1_5.yaml | 90 + .../suites/certification/Test_TC_MC_1_6.yaml | 89 + .../suites/certification/Test_TC_MC_1_7.yaml | 91 + .../suites/certification/Test_TC_MC_1_8.yaml | 90 + .../suites/certification/Test_TC_MC_1_9.yaml | 91 + .../suites/certification/Test_TC_PCC_2_4.yaml | 102 + .../Framework/CHIP/templates/tests/tests.js | 18 + .../Framework/CHIPTests/CHIPClustersTests.m | 1219 +++++- .../chip-tool/zap-generated/test/Commands.h | 3763 ++++++++++++++--- 19 files changed, 5656 insertions(+), 570 deletions(-) create mode 100644 src/app/tests/suites/certification/Test_TC_MC_1_10.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_MC_1_11.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_MC_1_12.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_MC_1_2.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_MC_1_3.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_MC_1_4.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_MC_1_5.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_MC_1_6.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_MC_1_7.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_MC_1_8.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_MC_1_9.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_PCC_2_4.yaml diff --git a/examples/chip-tool/templates/tests/tests.js b/examples/chip-tool/templates/tests/tests.js index 452e515f08f846..4bac24d9801dcc 100644 --- a/examples/chip-tool/templates/tests/tests.js +++ b/examples/chip-tool/templates/tests/tests.js @@ -96,8 +96,6 @@ function getManualTests() ]; const Identify = [ - 'Test_TC_I_1_1', - 'Test_TC_I_2_1', 'Test_TC_I_2_2', 'Test_TC_I_2_3', ]; @@ -305,6 +303,11 @@ function getTests() 'Test_TC_FLW_2_2', ]; + const Identify = [ + 'Test_TC_I_1_1', + 'Test_TC_I_2_1', + ]; + const IlluminanceMeasurement = [ 'Test_TC_ILL_1_1', ]; @@ -327,6 +330,17 @@ function getTests() const MediaControl = [ 'Test_TC_MC_1_1', + 'Test_TC_MC_1_2', + 'Test_TC_MC_1_3', + 'Test_TC_MC_1_4', + 'Test_TC_MC_1_5', + 'Test_TC_MC_1_6', + 'Test_TC_MC_1_7', + 'Test_TC_MC_1_8', + 'Test_TC_MC_1_9', + 'Test_TC_MC_1_10', + 'Test_TC_MC_1_11', + 'Test_TC_MC_1_12', 'Test_TC_MC_2_1', 'Test_TC_MC_3_1', 'Test_TC_MC_3_2', @@ -373,6 +387,7 @@ function getTests() 'Test_TC_PCC_2_1', 'Test_TC_PCC_2_2', 'Test_TC_PCC_2_3', + 'Test_TC_PCC_2_4', ]; const RelativeHumidityMeasurement = [ @@ -495,6 +510,7 @@ function getTests() ElectricalMeasurement, // EthernetNetworkDiagnostics, // FlowMeasurement, // + Identify, // IlluminanceMeasurement, // LevelControl, // MediaControl, // diff --git a/src/app/tests/suites/certification/Test_TC_I_1_1.yaml b/src/app/tests/suites/certification/Test_TC_I_1_1.yaml index f03cb36fe52c5e..0a7e25ba5a51cb 100644 --- a/src/app/tests/suites/certification/Test_TC_I_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_I_1_1.yaml @@ -16,21 +16,59 @@ name: 57.1.1. [TC-I-1.1] Global attributes with server as DUT config: nodeId: 0x12344321 - cluster: "Basic" - endpoint: 0 + cluster: "Identify" + endpoint: 1 tests: - - label: "Commission DUT to TH" - disabled: true + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + #issue #12190 as per spec default value is 4 but expecting 2 - label: "TH reads the ClusterRevision attribute from the DUT" disabled: true + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 4 - - label: "TH reads the AttributeList attribute from the DUT" - disabled: true + - label: "Reads constraints of ClusterRevision attribute" + command: "readAttribute" + attribute: "ClusterRevision" + response: + constraints: + type: uint16 - - label: "TH reads the CommandList attribute from the DUT" - disabled: true + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + + - label: "Read the global attribute: ClientGeneratedCommandList" + command: "readAttribute" + attribute: "ClientGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: ServerGeneratedCommandList" + command: "readAttribute" + attribute: "ServerGeneratedCommandList" + response: + constraints: + type: list - - label: "TH reads the EventList attribute from the DUT" + #issue #11053 disabled steps below Global attributes missing from YAML framework + - label: "Read the global attribute: EventList" disabled: true + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_I_2_1.yaml b/src/app/tests/suites/certification/Test_TC_I_2_1.yaml index 611346a1e6b71f..9350a120f56952 100644 --- a/src/app/tests/suites/certification/Test_TC_I_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_I_2_1.yaml @@ -16,15 +16,30 @@ name: 57.2.1. [TC-I-2.1] Attributes with server as DUT config: nodeId: 0x12344321 - cluster: "Basic" - endpoint: 0 + cluster: "Identify" + endpoint: 1 tests: - - label: "Commission DUT to TH" - disabled: true + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - label: "TH reads the IdentifyTime attribute from the DUT" - disabled: true + command: "readAttribute" + attribute: "identify time" + response: + constraints: + type: uint16 - label: "TH reads the IdentifyType attribute from the DUT" - disabled: true + command: "readAttribute" + attribute: "identify type" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 5 diff --git a/src/app/tests/suites/certification/Test_TC_MC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_MC_1_1.yaml index 0d79abc8b97a4c..37e3369d2790af 100644 --- a/src/app/tests/suites/certification/Test_TC_MC_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_MC_1_1.yaml @@ -16,7 +16,7 @@ name: 15.1.1. [TC-MC-1.1] Global attributes with server as DUT config: nodeId: 0x12344321 - cluster: "Media Input" + cluster: "Low Power" endpoint: 1 tests: @@ -41,22 +41,6 @@ tests: constraints: type: uint16 - - label: - "write the default values to mandatory global attribute: - ClusterRevision" - command: "writeAttribute" - attribute: "ClusterRevision" - arguments: - value: 1 - response: - error: UNSUPPORTED_WRITE - - - label: "reads back global attribute: ClusterRevision" - command: "readAttribute" - attribute: "ClusterRevision" - response: - value: 1 - - label: "Read the global attribute: AttributeList" command: "readAttribute" attribute: "AttributeList" @@ -103,19 +87,3 @@ tests: response: constraints: type: map32 - - - label: "write the default values to optional global attribute: FeatureMap" - disabled: true - command: "writeAttribute" - attribute: "FeatureMap" - arguments: - value: 0 - response: - error: UNSUPPORTED_WRITE - - - label: "reads back optional global attribute: FeatureMap" - disabled: true - command: "readAttribute" - attribute: "FeatureMap" - response: - value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_MC_1_10.yaml b/src/app/tests/suites/certification/Test_TC_MC_1_10.yaml new file mode 100644 index 00000000000000..39849fa465a2cd --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_MC_1_10.yaml @@ -0,0 +1,91 @@ +# 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: + 18.1.10. [TC-MC-1.10] Global attributes - Application Basic Cluster (DUT as + Server) + +config: + nodeId: 0x12344321 + cluster: "Application Basic" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + + - label: "Read the global attribute constraints: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + constraints: + type: uint16 + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + + #issue #11053 disabled steps below Global attributes missing from YAML framework + - label: "Read the global attribute: EventList" + disabled: true + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + + - label: "Read the global attribute: ClientGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ClientGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: ServerGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ServerGeneratedCommandList" + response: + constraints: + type: list + + - label: "read the optional global attribute: FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 0 + + - label: "Read the optional global attribute : FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: map32 diff --git a/src/app/tests/suites/certification/Test_TC_MC_1_11.yaml b/src/app/tests/suites/certification/Test_TC_MC_1_11.yaml new file mode 100644 index 00000000000000..16192ab8c2750d --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_MC_1_11.yaml @@ -0,0 +1,91 @@ +# 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: + 18.1.11. [TC-MC-1.11] Global attributes - Content Launcher Cluster (DUT as + Server) + +config: + nodeId: 0x12344321 + cluster: "Content Launcher" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + + - label: "Read the global attribute constraints: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + constraints: + type: uint16 + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + + #issue #11053 disabled steps below Global attributes missing from YAML framework + - label: "Read the global attribute: EventList" + disabled: true + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + + - label: "Read the global attribute: ClientGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ClientGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: ServerGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ServerGeneratedCommandList" + response: + constraints: + type: list + + - label: "read the optional global attribute: FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 0 + + - label: "Read the optional global attribute : FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: map32 diff --git a/src/app/tests/suites/certification/Test_TC_MC_1_12.yaml b/src/app/tests/suites/certification/Test_TC_MC_1_12.yaml new file mode 100644 index 00000000000000..0f7037fd8f56c2 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_MC_1_12.yaml @@ -0,0 +1,91 @@ +# 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: + 18.1.12. [TC-MC-1.12] Global attributes - Account Login Cluster (DUT as + Server) + +config: + nodeId: 0x12344321 + cluster: "Account Login" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + + - label: "Read the global attribute constraints: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + constraints: + type: uint16 + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + + #issue #11053 disabled steps below Global attributes missing from YAML framework + - label: "Read the global attribute: EventList" + disabled: true + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + + - label: "Read the global attribute: ClientGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ClientGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: ServerGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ServerGeneratedCommandList" + response: + constraints: + type: list + + - label: "read the optional global attribute: FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 0 + + - label: "Read the optional global attribute : FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: map32 diff --git a/src/app/tests/suites/certification/Test_TC_MC_1_2.yaml b/src/app/tests/suites/certification/Test_TC_MC_1_2.yaml new file mode 100644 index 00000000000000..e14e601ea6d377 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_MC_1_2.yaml @@ -0,0 +1,90 @@ +# 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: + 18.1.2. [TC-MC-1.2] Global attributes - Keypad Input Cluster (DUT as Server) + +config: + nodeId: 0x12344321 + cluster: "Keypad Input" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + + - label: "Read the global attribute constraints: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + constraints: + type: uint16 + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + + #issue #11053 disabled steps below Global attributes missing from YAML framework + - label: "Read the global attribute: EventList" + disabled: true + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + + - label: "Read the global attribute: ClientGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ClientGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: ServerGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ServerGeneratedCommandList" + response: + constraints: + type: list + + - label: "read the optional global attribute: FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 0 + + - label: "Read the optional global attribute : FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: map32 diff --git a/src/app/tests/suites/certification/Test_TC_MC_1_3.yaml b/src/app/tests/suites/certification/Test_TC_MC_1_3.yaml new file mode 100644 index 00000000000000..fd9c2d787aec8c --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_MC_1_3.yaml @@ -0,0 +1,83 @@ +# 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: + 18.1.3. [TC-MC-1.3] Global attributes - Application Launcher Cluster (DUT as + Server) + +config: + nodeId: 0x12344321 + cluster: "Application Launcher" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + + - label: "Read the global attribute constraints: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + constraints: + type: uint16 + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + + #issue #11053 disabled steps below Global attributes missing from YAML framework + - label: "Read the global attribute: EventList" + disabled: true + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + + - label: "Read the global attribute: ClientGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ClientGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: ServerGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ServerGeneratedCommandList" + response: + constraints: + type: list + + - label: "read the optional global attribute: FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_MC_1_4.yaml b/src/app/tests/suites/certification/Test_TC_MC_1_4.yaml new file mode 100644 index 00000000000000..a62444bc2a5935 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_MC_1_4.yaml @@ -0,0 +1,90 @@ +# 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: + 18.1.4. [TC-MC-1.4] Global attributes - Media Input Cluster (DUT as Server) + +config: + nodeId: 0x12344321 + cluster: "Media Input" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + + - label: "Read the global attribute constraints: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + constraints: + type: uint16 + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + + #issue #11053 disabled steps below Global attributes missing from YAML framework + - label: "Read the global attribute: EventList" + disabled: true + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + + - label: "Read the global attribute: ClientGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ClientGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: ServerGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ServerGeneratedCommandList" + response: + constraints: + type: list + + - label: "read the optional global attribute: FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 0 + + - label: "Read the optional global attribute : FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: map32 diff --git a/src/app/tests/suites/certification/Test_TC_MC_1_5.yaml b/src/app/tests/suites/certification/Test_TC_MC_1_5.yaml new file mode 100644 index 00000000000000..ec1bf9a82fe152 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_MC_1_5.yaml @@ -0,0 +1,90 @@ +# 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: + 18.1.5. [TC-MC-1.5] Global attributes - Wake on LAN Cluster (DUT as Server) + +config: + nodeId: 0x12344321 + cluster: "Wake on LAN" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + + - label: "Read the global attribute constraints: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + constraints: + type: uint16 + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + + #issue #11053 disabled steps below Global attributes missing from YAML framework + - label: "Read the global attribute: EventList" + disabled: true + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + + - label: "Read the global attribute: ClientGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ClientGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: ServerGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ServerGeneratedCommandList" + response: + constraints: + type: list + + - label: "read the optional global attribute: FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 0 + + - label: "Read the optional global attribute : FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: map32 diff --git a/src/app/tests/suites/certification/Test_TC_MC_1_6.yaml b/src/app/tests/suites/certification/Test_TC_MC_1_6.yaml new file mode 100644 index 00000000000000..07c27dd136deb1 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_MC_1_6.yaml @@ -0,0 +1,89 @@ +# 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: 18.1.6. [TC-MC-1.6] Global attributes - Channel Cluster (DUT as Server) + +config: + nodeId: 0x12344321 + cluster: "Channel" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + + - label: "Read the global attribute constraints: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + constraints: + type: uint16 + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + + #issue #11053 disabled steps below Global attributes missing from YAML framework + - label: "Read the global attribute: EventList" + disabled: true + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + + - label: "Read the global attribute: ClientGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ClientGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: ServerGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ServerGeneratedCommandList" + response: + constraints: + type: list + + - label: "read the optional global attribute: FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 0 + + - label: "Read the optional global attribute : FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: map32 diff --git a/src/app/tests/suites/certification/Test_TC_MC_1_7.yaml b/src/app/tests/suites/certification/Test_TC_MC_1_7.yaml new file mode 100644 index 00000000000000..4a4cf2e1a62fd3 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_MC_1_7.yaml @@ -0,0 +1,91 @@ +# 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: + 18.1.7. [TC-MC-1.7] Global attributes - Media Playback Cluster (DUT as + Server) + +config: + nodeId: 0x12344321 + cluster: "Media Playback" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + + - label: "Read the global attribute constraints: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + constraints: + type: uint16 + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + + #issue #11053 disabled steps below Global attributes missing from YAML framework + - label: "Read the global attribute: EventList" + disabled: true + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + + - label: "Read the global attribute: ClientGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ClientGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: ServerGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ServerGeneratedCommandList" + response: + constraints: + type: list + + - label: "read the optional global attribute: FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 0 + + - label: "Read the optional global attribute : FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: map32 diff --git a/src/app/tests/suites/certification/Test_TC_MC_1_8.yaml b/src/app/tests/suites/certification/Test_TC_MC_1_8.yaml new file mode 100644 index 00000000000000..31935b31608fa2 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_MC_1_8.yaml @@ -0,0 +1,90 @@ +# 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: + 18.1.8. [TC-MC-1.8] Global attributes - Audio Output Cluster (DUT as Server) + +config: + nodeId: 0x12344321 + cluster: "Audio Output" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + + - label: "Read the global attribute constraints: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + constraints: + type: uint16 + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + + #issue #11053 disabled steps below Global attributes missing from YAML framework + - label: "Read the global attribute: EventList" + disabled: true + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + + - label: "Read the global attribute: ClientGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ClientGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: ServerGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ServerGeneratedCommandList" + response: + constraints: + type: list + + - label: "read the optional global attribute: FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 0 + + - label: "Read the optional global attribute : FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: map32 diff --git a/src/app/tests/suites/certification/Test_TC_MC_1_9.yaml b/src/app/tests/suites/certification/Test_TC_MC_1_9.yaml new file mode 100644 index 00000000000000..70d1d54ba834d8 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_MC_1_9.yaml @@ -0,0 +1,91 @@ +# 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: + 18.1.9. [TC-MC-1.9] Global attributes - Target Navigator Cluster (DUT as + Server) + +config: + nodeId: 0x12344321 + cluster: "Target Navigator" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + + - label: "Read the global attribute constraints: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + constraints: + type: uint16 + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + + #issue #11053 disabled steps below Global attributes missing from YAML framework + - label: "Read the global attribute: EventList" + disabled: true + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + + - label: "Read the global attribute: ClientGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ClientGeneratedCommandList" + response: + constraints: + type: list + + - label: "Read the global attribute: ServerGeneratedCommandList" + disabled: true + command: "readAttribute" + attribute: "ServerGeneratedCommandList" + response: + constraints: + type: list + + - label: "read the optional global attribute: FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 0 + + - label: "Read the optional global attribute : FeatureMap" + disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: map32 diff --git a/src/app/tests/suites/certification/Test_TC_PCC_2_4.yaml b/src/app/tests/suites/certification/Test_TC_PCC_2_4.yaml new file mode 100644 index 00000000000000..c2b2c26b8256a7 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_PCC_2_4.yaml @@ -0,0 +1,102 @@ +# 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.4. [TC-PCC-2.4] Primary functionality with server as DUT + +config: + nodeId: 0x12344321 + cluster: "Pump Configuration and Control" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Write 1 to the LifetimeRunningHours attribute to DUT" + command: "writeAttribute" + attribute: "LifetimeRunningHours" + arguments: + value: 1 + + - label: "Reads the attribute: LifetimeRunningHours" + command: "readAttribute" + attribute: "LifetimeRunningHours" + response: + value: 1 + + - label: "Write 2 to the LifetimeRunningHours attribute to DUT" + command: "writeAttribute" + attribute: "LifetimeRunningHours" + arguments: + value: 2 + + - label: "Reads the attribute: LifetimeRunningHours" + command: "readAttribute" + attribute: "LifetimeRunningHours" + response: + value: 2 + + - label: "Write 3 to the LifetimeRunningHours attribute to DUT" + command: "writeAttribute" + attribute: "LifetimeRunningHours" + arguments: + value: 3 + + - label: "Reads the attribute: LifetimeRunningHours" + command: "readAttribute" + attribute: "LifetimeRunningHours" + response: + value: 3 + + - label: "Write 1 to the LifetimeEnergyConsumed attribute to DUT" + command: "writeAttribute" + attribute: "LifetimeEnergyConsumed" + arguments: + value: 1 + + - label: "Reads the attribute: LifetimeEnergyConsumed" + disabled: true + command: "readAttribute" + attribute: "LifetimeEnergyConsumed" + response: + value: 1 + + - label: "Write 2 to the LifetimeEnergyConsumed attribute to DUT" + command: "writeAttribute" + attribute: "LifetimeEnergyConsumed" + arguments: + value: 2 + + - label: "Reads the attribute: LifetimeEnergyConsumed" + command: "readAttribute" + attribute: "LifetimeEnergyConsumed" + response: + value: 2 + + - label: "Write 3 to the LifetimeEnergyConsumed attribute to DUT" + command: "writeAttribute" + attribute: "LifetimeEnergyConsumed" + arguments: + value: 3 + + - label: "Reads the attribute: LifetimeEnergyConsumed" + command: "readAttribute" + attribute: "LifetimeEnergyConsumed" + response: + value: 3 diff --git a/src/darwin/Framework/CHIP/templates/tests/tests.js b/src/darwin/Framework/CHIP/templates/tests/tests.js index 68dcfefe9a4a5c..55568dc873bc67 100644 --- a/src/darwin/Framework/CHIP/templates/tests/tests.js +++ b/src/darwin/Framework/CHIP/templates/tests/tests.js @@ -90,6 +90,11 @@ function getTests() 'Test_TC_FLW_2_2', ]; + const Identify = [ + 'Test_TC_I_1_1', + 'Test_TC_I_2_1', + ]; + const IlluminanceMeasurement = [ 'Test_TC_ILL_1_1', ]; @@ -112,6 +117,17 @@ function getTests() const MediaControl = [ 'Test_TC_MC_1_1', + 'Test_TC_MC_1_2', + 'Test_TC_MC_1_3', + 'Test_TC_MC_1_4', + 'Test_TC_MC_1_5', + 'Test_TC_MC_1_6', + 'Test_TC_MC_1_7', + 'Test_TC_MC_1_8', + 'Test_TC_MC_1_9', + 'Test_TC_MC_1_10', + 'Test_TC_MC_1_11', + 'Test_TC_MC_1_12', 'Test_TC_MC_2_1', 'Test_TC_MC_3_1', 'Test_TC_MC_3_2', @@ -158,6 +174,7 @@ function getTests() 'Test_TC_PCC_2_1', 'Test_TC_PCC_2_2', 'Test_TC_PCC_2_3', + 'Test_TC_PCC_2_4', ]; const RelativeHumidityMeasurement = [ @@ -256,6 +273,7 @@ function getTests() ElectricalMeasurement, // EthernetNetworkDiagnostics, // FlowMeasurement, // + Identify, // IlluminanceMeasurement, // LevelControl, // MediaControl, // diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index 602b1e8eb305bd..36cd666cd5a968 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -13103,6 +13103,151 @@ - (void)testSendClusterTest_TC_FLW_2_2_000002_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTest_TC_I_1_1_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue, 305414945); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_I_1_1_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Reads constraints of ClusterRevision attribute"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads constraints of ClusterRevision attribute Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_I_1_1_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_I_1_1_000003_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: ClientGeneratedCommandList"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClientGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClientGeneratedCommandList Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_I_1_1_000004_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: ServerGeneratedCommandList"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeServerGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ServerGeneratedCommandList Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_I_2_1_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue, 305414945); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_I_2_1_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads the IdentifyTime attribute from the DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the IdentifyTime attribute from the DUT Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_I_2_1_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TH reads the IdentifyType attribute from the DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeIdentifyTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the IdentifyType attribute from the DUT Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 0); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 5); + } + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterTest_TC_ILL_1_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; @@ -15232,7 +15377,7 @@ - (void)testSendClusterTest_TC_MC_1_1_000001_ReadAttribute CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestLowPower * cluster = [[CHIPTestLowPower alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -15256,7 +15401,7 @@ - (void)testSendClusterTest_TC_MC_1_1_000002_ReadAttribute CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestLowPower * cluster = [[CHIPTestLowPower alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -15269,60 +15414,794 @@ - (void)testSendClusterTest_TC_MC_1_1_000002_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_MC_1_1_000003_WriteAttribute +- (void)testSendClusterTest_TC_MC_1_1_000003_ReadAttribute { - XCTestExpectation * expectation = - [self expectationWithDescription:@"write the default values to mandatory global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestLowPower * cluster = [[CHIPTestLowPower alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id clusterRevisionArgument; - clusterRevisionArgument = [NSNumber numberWithUnsignedShort:1U]; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_MC_1_2_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue, 305414945); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_MC_1_2_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 1U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_MC_1_2_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_MC_1_2_000003_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestKeypadInput * cluster = [[CHIPTestKeypadInput alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_MC_1_3_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue, 305414945); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_MC_1_3_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestApplicationLauncher * cluster = [[CHIPTestApplicationLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 1U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_MC_1_3_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestApplicationLauncher * cluster = [[CHIPTestApplicationLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_MC_1_3_000003_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestApplicationLauncher * cluster = [[CHIPTestApplicationLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_MC_1_4_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue, 305414945); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_MC_1_4_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 1U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_MC_1_4_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_MC_1_4_000003_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_MC_1_5_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue, 305414945); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_MC_1_5_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestWakeOnLan * cluster = [[CHIPTestWakeOnLan alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 1U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_MC_1_5_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestWakeOnLan * cluster = [[CHIPTestWakeOnLan alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_MC_1_5_000003_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestWakeOnLan * cluster = [[CHIPTestWakeOnLan alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_MC_1_6_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue, 305414945); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_MC_1_6_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 1U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_MC_1_6_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_MC_1_6_000003_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestChannel * cluster = [[CHIPTestChannel alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_MC_1_7_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue, 305414945); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_MC_1_7_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 1U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_MC_1_7_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_MC_1_7_000003_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestMediaPlayback * cluster = [[CHIPTestMediaPlayback alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_MC_1_8_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue, 305414945); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_MC_1_8_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestAudioOutput * cluster = [[CHIPTestAudioOutput alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 1U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_MC_1_8_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestAudioOutput * cluster = [[CHIPTestAudioOutput alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_MC_1_8_000003_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestAudioOutput * cluster = [[CHIPTestAudioOutput alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_MC_1_9_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue, 305414945); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_MC_1_9_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTargetNavigator * cluster = [[CHIPTestTargetNavigator alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 1U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_MC_1_9_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTargetNavigator * cluster = [[CHIPTestTargetNavigator alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_MC_1_9_000003_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTargetNavigator * cluster = [[CHIPTestTargetNavigator alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_MC_1_10_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue, 305414945); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_MC_1_10_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 1U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_MC_1_10_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_MC_1_10_000003_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestApplicationBasic * cluster = [[CHIPTestApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_MC_1_11_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue, 305414945); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_MC_1_11_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 1U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_MC_1_11_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_MC_1_11_000003_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestContentLauncher * cluster = [[CHIPTestContentLauncher alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_MC_1_12_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue, 305414945); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_MC_1_12_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestAccountLogin * cluster = [[CHIPTestAccountLogin alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 1U); + } - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_UNSUPPORTED_WRITE); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_MC_1_1_000004_ReadAttribute +- (void)testSendClusterTest_TC_MC_1_12_000002_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: ClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute constraints: ClusterRevision"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestAccountLogin * cluster = [[CHIPTestAccountLogin alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"reads back global attribute: ClusterRevision Error: %@", err); + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - { - id actualValue = value; - XCTAssertEqual([actualValue unsignedShortValue], 1U); - } - [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTest_TC_MC_1_1_000005_ReadAttribute +- (void)testSendClusterTest_TC_MC_1_12_000003_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read the global attribute: AttributeList"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestMediaInput * cluster = [[CHIPTestMediaInput alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestAccountLogin * cluster = [[CHIPTestAccountLogin alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -20413,6 +21292,294 @@ - (void)testSendClusterTest_TC_PCC_2_3_000009_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTest_TC_PCC_2_4_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue, 305414945); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_4_000001_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write 1 to the LifetimeRunningHours attribute to DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + id lifetimeRunningHoursArgument; + lifetimeRunningHoursArgument = [NSNumber numberWithUnsignedInt:1UL]; + [cluster writeAttributeLifetimeRunningHoursWithValue:lifetimeRunningHoursArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write 1 to the LifetimeRunningHours attribute to DUT Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_4_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: LifetimeRunningHours"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: LifetimeRunningHours Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue unsignedIntValue], 1UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_4_000003_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write 2 to the LifetimeRunningHours attribute to DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + id lifetimeRunningHoursArgument; + lifetimeRunningHoursArgument = [NSNumber numberWithUnsignedInt:2UL]; + [cluster writeAttributeLifetimeRunningHoursWithValue:lifetimeRunningHoursArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write 2 to the LifetimeRunningHours attribute to DUT Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_4_000004_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: LifetimeRunningHours"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: LifetimeRunningHours Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue unsignedIntValue], 2UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_4_000005_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write 3 to the LifetimeRunningHours attribute to DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + id lifetimeRunningHoursArgument; + lifetimeRunningHoursArgument = [NSNumber numberWithUnsignedInt:3UL]; + [cluster writeAttributeLifetimeRunningHoursWithValue:lifetimeRunningHoursArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write 3 to the LifetimeRunningHours attribute to DUT Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_4_000006_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: LifetimeRunningHours"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: LifetimeRunningHours Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue unsignedIntValue], 3UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_4_000007_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write 1 to the LifetimeEnergyConsumed attribute to DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + id lifetimeEnergyConsumedArgument; + lifetimeEnergyConsumedArgument = [NSNumber numberWithUnsignedInt:1UL]; + [cluster writeAttributeLifetimeEnergyConsumedWithValue:lifetimeEnergyConsumedArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write 1 to the LifetimeEnergyConsumed attribute to DUT Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_4_000008_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write 2 to the LifetimeEnergyConsumed attribute to DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + id lifetimeEnergyConsumedArgument; + lifetimeEnergyConsumedArgument = [NSNumber numberWithUnsignedInt:2UL]; + [cluster writeAttributeLifetimeEnergyConsumedWithValue:lifetimeEnergyConsumedArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write 2 to the LifetimeEnergyConsumed attribute to DUT Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_4_000009_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: LifetimeEnergyConsumed"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: LifetimeEnergyConsumed Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue unsignedIntValue], 2UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_4_000010_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write 3 to the LifetimeEnergyConsumed attribute to DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + id lifetimeEnergyConsumedArgument; + lifetimeEnergyConsumedArgument = [NSNumber numberWithUnsignedInt:3UL]; + [cluster writeAttributeLifetimeEnergyConsumedWithValue:lifetimeEnergyConsumedArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write 3 to the LifetimeEnergyConsumed attribute to DUT Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_4_000011_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: LifetimeEnergyConsumed"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeLifetimeEnergyConsumedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the attribute: LifetimeEnergyConsumed Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue unsignedIntValue], 3UL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterTest_TC_RH_1_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index d9e38ee7364d5b..46229e5012311e 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -72,6 +72,8 @@ class TestList : public Command printf("Test_TC_FLW_1_1\n"); printf("Test_TC_FLW_2_1\n"); printf("Test_TC_FLW_2_2\n"); + printf("Test_TC_I_1_1\n"); + printf("Test_TC_I_2_1\n"); printf("Test_TC_ILL_1_1\n"); printf("Test_TC_LVL_1_1\n"); printf("Test_TC_LVL_2_1\n"); @@ -81,6 +83,17 @@ class TestList : public Command printf("Test_TC_LVL_5_1\n"); printf("Test_TC_LVL_6_1\n"); printf("Test_TC_MC_1_1\n"); + printf("Test_TC_MC_1_2\n"); + printf("Test_TC_MC_1_3\n"); + printf("Test_TC_MC_1_4\n"); + printf("Test_TC_MC_1_5\n"); + printf("Test_TC_MC_1_6\n"); + printf("Test_TC_MC_1_7\n"); + printf("Test_TC_MC_1_8\n"); + printf("Test_TC_MC_1_9\n"); + printf("Test_TC_MC_1_10\n"); + printf("Test_TC_MC_1_11\n"); + printf("Test_TC_MC_1_12\n"); printf("Test_TC_MC_2_1\n"); printf("Test_TC_MC_3_1\n"); printf("Test_TC_MC_3_2\n"); @@ -118,6 +131,7 @@ class TestList : public Command printf("Test_TC_PCC_2_1\n"); printf("Test_TC_PCC_2_2\n"); printf("Test_TC_PCC_2_3\n"); + printf("Test_TC_PCC_2_4\n"); printf("Test_TC_RH_1_1\n"); printf("Test_TC_RH_2_1\n"); printf("Test_TC_RH_2_2\n"); @@ -242,8 +256,6 @@ class ManualTestList : public Command printf("Test_TC_GC_1_3\n"); printf("Test_TC_GENDIAG_1_1\n"); printf("Test_TC_GENDIAG_1_2\n"); - printf("Test_TC_I_1_1\n"); - printf("Test_TC_I_2_1\n"); printf("Test_TC_I_2_2\n"); printf("Test_TC_I_2_3\n"); printf("Test_TC_ILL_2_1\n"); @@ -22134,6 +22146,388 @@ class Test_TC_FLW_2_2Suite : public TestCommand } }; +class Test_TC_I_1_1Suite : public TestCommand +{ +public: + Test_TC_I_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_I_1_1", credsIssuerConfig), mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_I_1_1Suite() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_1_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // 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 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Reads constraints of ClusterRevision attribute\n"); + err = TestReadsConstraintsOfClusterRevisionAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: ClientGeneratedCommandList\n"); + err = TestReadTheGlobalAttributeClientGeneratedCommandList_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: ServerGeneratedCommandList\n"); + err = TestReadTheGlobalAttributeServerGeneratedCommandList_4(); + 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 = 5; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + + static void OnFailureCallback_1(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_1(error); + } + + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_1(clusterRevision); + } + + static void OnFailureCallback_2(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_2(error); + } + + static void OnSuccessCallback_2(void * context, const chip::app::DataModel::DecodableList & attributeList) + { + (static_cast(context))->OnSuccessResponse_2(attributeList); + } + + static void OnFailureCallback_3(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_3(error); + } + + static void OnSuccessCallback_3(void * context, + const chip::app::DataModel::DecodableList & clientGeneratedCommandList) + { + (static_cast(context))->OnSuccessResponse_3(clientGeneratedCommandList); + } + + static void OnFailureCallback_4(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_4(error); + } + + static void OnSuccessCallback_4(void * context, + const chip::app::DataModel::DecodableList & serverGeneratedCommandList) + { + (static_cast(context))->OnSuccessResponse_4(serverGeneratedCommandList); + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + + CHIP_ERROR TestReadsConstraintsOfClusterRevisionAttribute_1() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::IdentifyClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_1(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_1(uint16_t clusterRevision) + { + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + NextTest(); + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::IdentifyClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_2(const chip::app::DataModel::DecodableList & attributeList) + { + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + NextTest(); + } + + CHIP_ERROR TestReadTheGlobalAttributeClientGeneratedCommandList_3() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::IdentifyClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_3, OnFailureCallback_3, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_3(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_3(const chip::app::DataModel::DecodableList & clientGeneratedCommandList) + { + VerifyOrReturn(CheckConstraintType("clientGeneratedCommandList", "", "list")); + NextTest(); + } + + CHIP_ERROR TestReadTheGlobalAttributeServerGeneratedCommandList_4() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::IdentifyClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_4, OnFailureCallback_4, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_4(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_4(const chip::app::DataModel::DecodableList & serverGeneratedCommandList) + { + VerifyOrReturn(CheckConstraintType("serverGeneratedCommandList", "", "list")); + NextTest(); + } +}; + +class Test_TC_I_2_1Suite : public TestCommand +{ +public: + Test_TC_I_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_I_2_1", credsIssuerConfig), mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_I_2_1Suite() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_2_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // 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 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads the IdentifyTime attribute from the DUT\n"); + err = TestThReadsTheIdentifyTimeAttributeFromTheDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads the IdentifyType attribute from the DUT\n"); + err = TestThReadsTheIdentifyTypeAttributeFromTheDut_2(); + 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 = 3; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + + static void OnFailureCallback_1(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_1(error); + } + + static void OnSuccessCallback_1(void * context, uint16_t identifyTime) + { + (static_cast(context))->OnSuccessResponse_1(identifyTime); + } + + static void OnFailureCallback_2(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_2(error); + } + + static void OnSuccessCallback_2(void * context, uint8_t identifyType) + { + (static_cast(context))->OnSuccessResponse_2(identifyType); + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + + CHIP_ERROR TestThReadsTheIdentifyTimeAttributeFromTheDut_1() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::IdentifyClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_1(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_1(uint16_t identifyTime) + { + VerifyOrReturn(CheckConstraintType("identifyTime", "", "uint16")); + NextTest(); + } + + CHIP_ERROR TestThReadsTheIdentifyTypeAttributeFromTheDut_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::IdentifyClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_2(uint8_t identifyType) + { + VerifyOrReturn(CheckConstraintType("identifyType", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("identifyType", identifyType, 0)); + VerifyOrReturn(CheckConstraintMaxValue("identifyType", identifyType, 5)); + NextTest(); + } +}; + class Test_TC_ILL_1_1Suite : public TestCommand { public: @@ -25927,17 +26321,8 @@ class Test_TC_MC_1_1Suite : public TestCommand err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); break; case 3: - ChipLogProgress(chipTool, - " ***** Test Step 3 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : reads back global attribute: ClusterRevision\n"); - err = TestReadsBackGlobalAttributeClusterRevision_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_5(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); break; } @@ -25950,7 +26335,7 @@ class Test_TC_MC_1_1Suite : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + const uint16_t mTestCount = 4; chip::Optional mNodeId; chip::Optional mCluster; @@ -25989,26 +26374,199 @@ class Test_TC_MC_1_1Suite : public TestCommand (static_cast(context))->OnFailureResponse_3(error); } - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + static void OnSuccessCallback_3(void * context, const chip::app::DataModel::DecodableList & attributeList) + { + (static_cast(context))->OnSuccessResponse_3(attributeList); + } + + // + // Tests methods + // - static void OnFailureCallback_4(void * context, CHIP_ERROR error) + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() { - (static_cast(context))->OnFailureResponse_4(error); + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } - static void OnSuccessCallback_4(void * context, uint16_t clusterRevision) + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::LowPowerClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_1(CHIP_ERROR error) { - (static_cast(context))->OnSuccessResponse_4(clusterRevision); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - static void OnFailureCallback_5(void * context, CHIP_ERROR error) + void OnSuccessResponse_1(uint16_t clusterRevision) { - (static_cast(context))->OnFailureResponse_5(error); + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); + + NextTest(); } - static void OnSuccessCallback_5(void * context, const chip::app::DataModel::DecodableList & attributeList) + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::LowPowerClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_2(uint16_t clusterRevision) + { + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + NextTest(); + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::LowPowerClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_3, OnFailureCallback_3, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_3(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_3(const chip::app::DataModel::DecodableList & attributeList) + { + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + NextTest(); + } +}; + +class Test_TC_MC_1_2Suite : public TestCommand +{ +public: + Test_TC_MC_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MC_1_2", credsIssuerConfig), mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_MC_1_2Suite() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_1_2\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_1_2\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // 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 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); + 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 = 4; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + + static void OnFailureCallback_1(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_1(error); + } + + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_1(clusterRevision); + } + + static void OnFailureCallback_2(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_2(error); + } + + static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_2(clusterRevision); + } + + static void OnFailureCallback_3(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_3(error); + } + + static void OnSuccessCallback_3(void * context, const chip::app::DataModel::DecodableList & attributeList) { - (static_cast(context))->OnSuccessResponse_5(attributeList); + (static_cast(context))->OnSuccessResponse_3(attributeList); } // @@ -26024,10 +26582,10 @@ class Test_TC_MC_1_1Suite : public TestCommand CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::MediaInputClusterTest cluster; + chip::Controller::KeypadInputClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( + ReturnErrorOnFailure(cluster.ReadAttribute( this, OnSuccessCallback_1, OnFailureCallback_1, true)); return CHIP_NO_ERROR; } @@ -26048,10 +26606,10 @@ class Test_TC_MC_1_1Suite : public TestCommand CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::MediaInputClusterTest cluster; + chip::Controller::KeypadInputClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( + ReturnErrorOnFailure(cluster.ReadAttribute( this, OnSuccessCallback_2, OnFailureCallback_2, true)); return CHIP_NO_ERROR; } @@ -26068,71 +26626,1924 @@ class Test_TC_MC_1_1Suite : public TestCommand NextTest(); } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; - chip::Controller::MediaInputClusterTest cluster; + chip::Controller::KeypadInputClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint16_t clusterRevisionArgument; - clusterRevisionArgument = 1U; + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_3, OnFailureCallback_3, true)); + return CHIP_NO_ERROR; + } - ReturnErrorOnFailure(cluster.WriteAttribute( - clusterRevisionArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); + void OnFailureResponse_3(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_3(const chip::app::DataModel::DecodableList & attributeList) + { + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + NextTest(); + } +}; + +class Test_TC_MC_1_3Suite : public TestCommand +{ +public: + Test_TC_MC_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MC_1_3", credsIssuerConfig), mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_MC_1_3Suite() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_1_3\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_1_3\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // 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 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); + 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 = 4; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + + static void OnFailureCallback_1(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_1(error); + } + + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_1(clusterRevision); + } + + static void OnFailureCallback_2(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_2(error); + } + + static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_2(clusterRevision); + } + + static void OnFailureCallback_3(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_3(error); + } + + static void OnSuccessCallback_3(void * context, const chip::app::DataModel::DecodableList & attributeList) + { + (static_cast(context))->OnSuccessResponse_3(attributeList); + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ApplicationLauncherClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_1(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_1(uint16_t clusterRevision) + { + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); + + NextTest(); + } + + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ApplicationLauncherClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_2(uint16_t clusterRevision) + { + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + NextTest(); + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ApplicationLauncherClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_3, OnFailureCallback_3, true)); return CHIP_NO_ERROR; } void OnFailureResponse_3(CHIP_ERROR error) { chip::app::StatusIB status(error); - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + ThrowFailureResponse(); + } + + void OnSuccessResponse_3(const chip::app::DataModel::DecodableList & attributeList) + { + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); } +}; - void OnSuccessResponse_3() { ThrowSuccessResponse(); } +class Test_TC_MC_1_4Suite : public TestCommand +{ +public: + Test_TC_MC_1_4Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MC_1_4", credsIssuerConfig), mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } - CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() + ~Test_TC_MC_1_4Suite() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_1_4\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_1_4\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // 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 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); + 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 = 4; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + + static void OnFailureCallback_1(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_1(error); + } + + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_1(clusterRevision); + } + + static void OnFailureCallback_2(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_2(error); + } + + static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_2(clusterRevision); + } + + static void OnFailureCallback_3(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_3(error); + } + + static void OnSuccessCallback_3(void * context, const chip::app::DataModel::DecodableList & attributeList) + { + (static_cast(context))->OnSuccessResponse_3(attributeList); + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::MediaInputClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4, true)); + this, OnSuccessCallback_1, OnFailureCallback_1, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_4(CHIP_ERROR error) + void OnFailureResponse_1(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_4(uint16_t clusterRevision) + void OnSuccessResponse_1(uint16_t clusterRevision) { VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); NextTest(); } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_5() + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::MediaInputClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_5, OnFailureCallback_5, true)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2, true)); return CHIP_NO_ERROR; } - void OnFailureResponse_5(CHIP_ERROR error) + void OnFailureResponse_2(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_5(const chip::app::DataModel::DecodableList & attributeList) + void OnSuccessResponse_2(uint16_t clusterRevision) + { + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + NextTest(); + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::MediaInputClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_3, OnFailureCallback_3, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_3(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_3(const chip::app::DataModel::DecodableList & attributeList) + { + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + NextTest(); + } +}; + +class Test_TC_MC_1_5Suite : public TestCommand +{ +public: + Test_TC_MC_1_5Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MC_1_5", credsIssuerConfig), mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_MC_1_5Suite() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_1_5\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_1_5\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // 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 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); + 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 = 4; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + + static void OnFailureCallback_1(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_1(error); + } + + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_1(clusterRevision); + } + + static void OnFailureCallback_2(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_2(error); + } + + static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_2(clusterRevision); + } + + static void OnFailureCallback_3(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_3(error); + } + + static void OnSuccessCallback_3(void * context, const chip::app::DataModel::DecodableList & attributeList) + { + (static_cast(context))->OnSuccessResponse_3(attributeList); + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::WakeOnLanClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_1(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_1(uint16_t clusterRevision) + { + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); + + NextTest(); + } + + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::WakeOnLanClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_2(uint16_t clusterRevision) + { + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + NextTest(); + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::WakeOnLanClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_3, OnFailureCallback_3, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_3(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_3(const chip::app::DataModel::DecodableList & attributeList) + { + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + NextTest(); + } +}; + +class Test_TC_MC_1_6Suite : public TestCommand +{ +public: + Test_TC_MC_1_6Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MC_1_6", credsIssuerConfig), mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_MC_1_6Suite() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_1_6\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_1_6\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // 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 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); + 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 = 4; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + + static void OnFailureCallback_1(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_1(error); + } + + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_1(clusterRevision); + } + + static void OnFailureCallback_2(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_2(error); + } + + static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_2(clusterRevision); + } + + static void OnFailureCallback_3(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_3(error); + } + + static void OnSuccessCallback_3(void * context, const chip::app::DataModel::DecodableList & attributeList) + { + (static_cast(context))->OnSuccessResponse_3(attributeList); + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ChannelClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_1(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_1(uint16_t clusterRevision) + { + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); + + NextTest(); + } + + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ChannelClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_2(uint16_t clusterRevision) + { + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + NextTest(); + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ChannelClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_3, OnFailureCallback_3, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_3(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_3(const chip::app::DataModel::DecodableList & attributeList) + { + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + NextTest(); + } +}; + +class Test_TC_MC_1_7Suite : public TestCommand +{ +public: + Test_TC_MC_1_7Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MC_1_7", credsIssuerConfig), mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_MC_1_7Suite() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_1_7\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_1_7\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // 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 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); + 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 = 4; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + + static void OnFailureCallback_1(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_1(error); + } + + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_1(clusterRevision); + } + + static void OnFailureCallback_2(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_2(error); + } + + static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_2(clusterRevision); + } + + static void OnFailureCallback_3(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_3(error); + } + + static void OnSuccessCallback_3(void * context, const chip::app::DataModel::DecodableList & attributeList) + { + (static_cast(context))->OnSuccessResponse_3(attributeList); + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::MediaPlaybackClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_1(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_1(uint16_t clusterRevision) + { + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); + + NextTest(); + } + + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::MediaPlaybackClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_2(uint16_t clusterRevision) + { + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + NextTest(); + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::MediaPlaybackClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_3, OnFailureCallback_3, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_3(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_3(const chip::app::DataModel::DecodableList & attributeList) + { + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + NextTest(); + } +}; + +class Test_TC_MC_1_8Suite : public TestCommand +{ +public: + Test_TC_MC_1_8Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MC_1_8", credsIssuerConfig), mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_MC_1_8Suite() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_1_8\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_1_8\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // 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 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); + 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 = 4; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + + static void OnFailureCallback_1(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_1(error); + } + + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_1(clusterRevision); + } + + static void OnFailureCallback_2(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_2(error); + } + + static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_2(clusterRevision); + } + + static void OnFailureCallback_3(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_3(error); + } + + static void OnSuccessCallback_3(void * context, const chip::app::DataModel::DecodableList & attributeList) + { + (static_cast(context))->OnSuccessResponse_3(attributeList); + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::AudioOutputClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_1(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_1(uint16_t clusterRevision) + { + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); + + NextTest(); + } + + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::AudioOutputClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_2(uint16_t clusterRevision) + { + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + NextTest(); + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::AudioOutputClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_3, OnFailureCallback_3, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_3(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_3(const chip::app::DataModel::DecodableList & attributeList) + { + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + NextTest(); + } +}; + +class Test_TC_MC_1_9Suite : public TestCommand +{ +public: + Test_TC_MC_1_9Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MC_1_9", credsIssuerConfig), mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_MC_1_9Suite() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_1_9\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_1_9\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // 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 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); + 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 = 4; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + + static void OnFailureCallback_1(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_1(error); + } + + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_1(clusterRevision); + } + + static void OnFailureCallback_2(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_2(error); + } + + static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_2(clusterRevision); + } + + static void OnFailureCallback_3(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_3(error); + } + + static void OnSuccessCallback_3(void * context, const chip::app::DataModel::DecodableList & attributeList) + { + (static_cast(context))->OnSuccessResponse_3(attributeList); + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::TargetNavigatorClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_1(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_1(uint16_t clusterRevision) + { + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); + + NextTest(); + } + + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::TargetNavigatorClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_2(uint16_t clusterRevision) + { + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + NextTest(); + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::TargetNavigatorClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_3, OnFailureCallback_3, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_3(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_3(const chip::app::DataModel::DecodableList & attributeList) + { + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + NextTest(); + } +}; + +class Test_TC_MC_1_10Suite : public TestCommand +{ +public: + Test_TC_MC_1_10Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MC_1_10", credsIssuerConfig), mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_MC_1_10Suite() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_1_10\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_1_10\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // 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 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); + 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 = 4; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + + static void OnFailureCallback_1(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_1(error); + } + + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_1(clusterRevision); + } + + static void OnFailureCallback_2(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_2(error); + } + + static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_2(clusterRevision); + } + + static void OnFailureCallback_3(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_3(error); + } + + static void OnSuccessCallback_3(void * context, const chip::app::DataModel::DecodableList & attributeList) + { + (static_cast(context))->OnSuccessResponse_3(attributeList); + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ApplicationBasicClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_1(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_1(uint16_t clusterRevision) + { + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); + + NextTest(); + } + + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ApplicationBasicClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_2(uint16_t clusterRevision) + { + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + NextTest(); + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ApplicationBasicClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_3, OnFailureCallback_3, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_3(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_3(const chip::app::DataModel::DecodableList & attributeList) + { + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + NextTest(); + } +}; + +class Test_TC_MC_1_11Suite : public TestCommand +{ +public: + Test_TC_MC_1_11Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MC_1_11", credsIssuerConfig), mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_MC_1_11Suite() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_1_11\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_1_11\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // 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 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); + 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 = 4; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + + static void OnFailureCallback_1(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_1(error); + } + + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_1(clusterRevision); + } + + static void OnFailureCallback_2(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_2(error); + } + + static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_2(clusterRevision); + } + + static void OnFailureCallback_3(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_3(error); + } + + static void OnSuccessCallback_3(void * context, const chip::app::DataModel::DecodableList & attributeList) + { + (static_cast(context))->OnSuccessResponse_3(attributeList); + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ContentLauncherClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_1(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_1(uint16_t clusterRevision) + { + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); + + NextTest(); + } + + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ContentLauncherClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_2(uint16_t clusterRevision) + { + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + NextTest(); + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::ContentLauncherClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_3, OnFailureCallback_3, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_3(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_3(const chip::app::DataModel::DecodableList & attributeList) + { + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + NextTest(); + } +}; + +class Test_TC_MC_1_12Suite : public TestCommand +{ +public: + Test_TC_MC_1_12Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MC_1_12", credsIssuerConfig), mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_MC_1_12Suite() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_1_12\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_1_12\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // 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 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); + 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 = 4; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + + static void OnFailureCallback_1(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_1(error); + } + + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_1(clusterRevision); + } + + static void OnFailureCallback_2(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_2(error); + } + + static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_2(clusterRevision); + } + + static void OnFailureCallback_3(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_3(error); + } + + static void OnSuccessCallback_3(void * context, const chip::app::DataModel::DecodableList & attributeList) + { + (static_cast(context))->OnSuccessResponse_3(attributeList); + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::AccountLoginClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_1(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_1(uint16_t clusterRevision) + { + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 1U)); + + NextTest(); + } + + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::AccountLoginClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_2(uint16_t clusterRevision) + { + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + NextTest(); + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::AccountLoginClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_3, OnFailureCallback_3, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_3(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_3(const chip::app::DataModel::DecodableList & attributeList) { VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); @@ -36101,135 +38512,574 @@ class Test_TC_PCC_2_2Suite : public TestCommand } } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 4; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + + static void OnFailureCallback_1(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_1(error); + } + + static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } + + static void OnFailureCallback_2(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_2(error); + } + + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + + static void OnFailureCallback_3(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_3(error); + } + + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + + CHIP_ERROR TestWrite1ToTheOperationModeAttributeToDutOperationMode_1() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint8_t operationModeArgument; + operationModeArgument = 1; + + ReturnErrorOnFailure( + cluster.WriteAttribute( + operationModeArgument, this, OnSuccessCallback_1, OnFailureCallback_1)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_1(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_1() { NextTest(); } + + CHIP_ERROR TestWrite2ToTheOperationModeAttributeToDutOperationMode_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint8_t operationModeArgument; + operationModeArgument = 2; + + ReturnErrorOnFailure( + cluster.WriteAttribute( + operationModeArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_2() { NextTest(); } + + CHIP_ERROR TestWrite3ToTheOperationModeAttributeToDutOperationMode_3() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint8_t operationModeArgument; + operationModeArgument = 3; + + ReturnErrorOnFailure( + cluster.WriteAttribute( + operationModeArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_3(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_3() { NextTest(); } +}; + +class Test_TC_PCC_2_3Suite : public TestCommand +{ +public: + Test_TC_PCC_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_PCC_2_3", credsIssuerConfig), mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~Test_TC_PCC_2_3Suite() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_2_3\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_2_3\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // 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 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Write 0 to the OperationMode attribute to DUT\n"); + if (ShouldSkip("A_OPERATIONMODE")) + { + NextTest(); + return; + } + err = TestWrite0ToTheOperationModeAttributeToDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads the attribute: EffectiveOperationMode\n"); + if (ShouldSkip("A_EFFECTIVEOPERATIONMODE")) + { + NextTest(); + return; + } + err = TestReadsTheAttributeEffectiveOperationMode_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Write 0 to the ControlMode attribute to DUT\n"); + if (ShouldSkip("A_CONTROLMODE")) + { + NextTest(); + return; + } + err = TestWrite0ToTheControlModeAttributeToDut_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads the attribute: EffectiveControlMode\n"); + if (ShouldSkip("A_EFFECTIVECONTROLMODE")) + { + NextTest(); + return; + } + err = TestReadsTheAttributeEffectiveControlMode_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Write 1 to the ControlMode attribute to DUT\n"); + if (ShouldSkip("A_CONTROLMODE")) + { + NextTest(); + return; + } + err = TestWrite1ToTheControlModeAttributeToDut_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Write 2 to the ControlMode attribute to DUT\n"); + if (ShouldSkip("A_CONTROLMODE")) + { + NextTest(); + return; + } + err = TestWrite2ToTheControlModeAttributeToDut_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Write 3 to the ControlMode attribute to DUT\n"); + if (ShouldSkip("A_CONTROLMODE")) + { + NextTest(); + return; + } + err = TestWrite3ToTheControlModeAttributeToDut_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Write 5 to the ControlMode attribute to DUT\n"); + if (ShouldSkip("A_CONTROLMODE")) + { + NextTest(); + return; + } + err = TestWrite5ToTheControlModeAttributeToDut_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Write 7 to the ControlMode attribute to DUT\n"); + if (ShouldSkip("A_CONTROLMODE")) + { + NextTest(); + return; + } + err = TestWrite7ToTheControlModeAttributeToDut_9(); + 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 = 10; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + + static void OnFailureCallback_1(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_1(error); + } + + static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } + + static void OnFailureCallback_2(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_2(error); + } + + static void OnSuccessCallback_2(void * context, uint8_t effectiveOperationMode) + { + (static_cast(context))->OnSuccessResponse_2(effectiveOperationMode); + } + + static void OnFailureCallback_3(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_3(error); + } + + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + + static void OnFailureCallback_4(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_4(error); + } + + static void OnSuccessCallback_4(void * context, uint8_t effectiveControlMode) + { + (static_cast(context))->OnSuccessResponse_4(effectiveControlMode); + } + + static void OnFailureCallback_5(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_5(error); + } + + static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } + + static void OnFailureCallback_6(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_6(error); + } + + static void OnSuccessCallback_6(void * context) { (static_cast(context))->OnSuccessResponse_6(); } + + static void OnFailureCallback_7(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_7(error); + } + + static void OnSuccessCallback_7(void * context) { (static_cast(context))->OnSuccessResponse_7(); } + + static void OnFailureCallback_8(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_8(error); + } + + static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } + + static void OnFailureCallback_9(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_9(error); + } + + static void OnSuccessCallback_9(void * context) { (static_cast(context))->OnSuccessResponse_9(); } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + + CHIP_ERROR TestWrite0ToTheOperationModeAttributeToDut_1() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint8_t operationModeArgument; + operationModeArgument = 0; + + ReturnErrorOnFailure( + cluster.WriteAttribute( + operationModeArgument, this, OnSuccessCallback_1, OnFailureCallback_1)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_1(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_1() { NextTest(); } + + CHIP_ERROR TestReadsTheAttributeEffectiveOperationMode_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_2(uint8_t effectiveOperationMode) + { + VerifyOrReturn(CheckValue("effectiveOperationMode", effectiveOperationMode, 0)); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; + NextTest(); + } - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override + CHIP_ERROR TestWrite0ToTheControlModeAttributeToDut_3() { - bool isExpectedDnssdResult = false; + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); + uint8_t controlModeArgument; + controlModeArgument = 0; + + ReturnErrorOnFailure( + cluster.WriteAttribute( + controlModeArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); + return CHIP_NO_ERROR; } - static void OnFailureCallback_1(void * context, CHIP_ERROR error) + void OnFailureResponse_3(CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_1(error); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } + void OnSuccessResponse_3() { NextTest(); } - static void OnFailureCallback_2(void * context, CHIP_ERROR error) + CHIP_ERROR TestReadsTheAttributeEffectiveControlMode_4() { - (static_cast(context))->OnFailureResponse_2(error); + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_4, OnFailureCallback_4, true)); + return CHIP_NO_ERROR; } - static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } + void OnFailureResponse_4(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } - static void OnFailureCallback_3(void * context, CHIP_ERROR error) + void OnSuccessResponse_4(uint8_t effectiveControlMode) { - (static_cast(context))->OnFailureResponse_3(error); + VerifyOrReturn(CheckValue("effectiveControlMode", effectiveControlMode, 0)); + + NextTest(); } - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + CHIP_ERROR TestWrite1ToTheControlModeAttributeToDut_5() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - // - // Tests methods - // + uint8_t controlModeArgument; + controlModeArgument = 1; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + ReturnErrorOnFailure( + cluster.WriteAttribute( + controlModeArgument, this, OnSuccessCallback_5, OnFailureCallback_5)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_5(CHIP_ERROR error) { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + chip::app::StatusIB status(error); + ThrowFailureResponse(); } - CHIP_ERROR TestWrite1ToTheOperationModeAttributeToDutOperationMode_1() + void OnSuccessResponse_5() { NextTest(); } + + CHIP_ERROR TestWrite2ToTheControlModeAttributeToDut_6() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t operationModeArgument; - operationModeArgument = 1; + uint8_t controlModeArgument; + controlModeArgument = 2; ReturnErrorOnFailure( - cluster.WriteAttribute( - operationModeArgument, this, OnSuccessCallback_1, OnFailureCallback_1)); + cluster.WriteAttribute( + controlModeArgument, this, OnSuccessCallback_6, OnFailureCallback_6)); return CHIP_NO_ERROR; } - void OnFailureResponse_1(CHIP_ERROR error) + void OnFailureResponse_6(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_1() { NextTest(); } + void OnSuccessResponse_6() { NextTest(); } - CHIP_ERROR TestWrite2ToTheOperationModeAttributeToDutOperationMode_2() + CHIP_ERROR TestWrite3ToTheControlModeAttributeToDut_7() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t operationModeArgument; - operationModeArgument = 2; + uint8_t controlModeArgument; + controlModeArgument = 3; ReturnErrorOnFailure( - cluster.WriteAttribute( - operationModeArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); + cluster.WriteAttribute( + controlModeArgument, this, OnSuccessCallback_7, OnFailureCallback_7)); return CHIP_NO_ERROR; } - void OnFailureResponse_2(CHIP_ERROR error) + void OnFailureResponse_7(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_2() { NextTest(); } + void OnSuccessResponse_7() { NextTest(); } - CHIP_ERROR TestWrite3ToTheOperationModeAttributeToDutOperationMode_3() + CHIP_ERROR TestWrite5ToTheControlModeAttributeToDut_8() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t operationModeArgument; - operationModeArgument = 3; + uint8_t controlModeArgument; + controlModeArgument = 5; ReturnErrorOnFailure( - cluster.WriteAttribute( - operationModeArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); + cluster.WriteAttribute( + controlModeArgument, this, OnSuccessCallback_8, OnFailureCallback_8)); return CHIP_NO_ERROR; } - void OnFailureResponse_3(CHIP_ERROR error) + void OnFailureResponse_8(CHIP_ERROR error) { chip::app::StatusIB status(error); ThrowFailureResponse(); } - void OnSuccessResponse_3() { NextTest(); } + void OnSuccessResponse_8() { NextTest(); } + + CHIP_ERROR TestWrite7ToTheControlModeAttributeToDut_9() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint8_t controlModeArgument; + controlModeArgument = 7; + + ReturnErrorOnFailure( + cluster.WriteAttribute( + controlModeArgument, this, OnSuccessCallback_9, OnFailureCallback_9)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_9(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_9() { NextTest(); } }; -class Test_TC_PCC_2_3Suite : public TestCommand +class Test_TC_PCC_2_4Suite : public TestCommand { public: - Test_TC_PCC_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_PCC_2_3", credsIssuerConfig), mTestIndex(0) + Test_TC_PCC_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_PCC_2_4", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_PCC_2_3Suite() {} + ~Test_TC_PCC_2_4Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -36238,12 +39088,12 @@ class Test_TC_PCC_2_3Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_2_3\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_2_4\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_2_3\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_2_4\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -36261,85 +39111,48 @@ class Test_TC_PCC_2_3Suite : public TestCommand err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Write 0 to the OperationMode attribute to DUT\n"); - if (ShouldSkip("A_OPERATIONMODE")) - { - NextTest(); - return; - } - err = TestWrite0ToTheOperationModeAttributeToDut_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Write 1 to the LifetimeRunningHours attribute to DUT\n"); + err = TestWrite1ToTheLifetimeRunningHoursAttributeToDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Reads the attribute: EffectiveOperationMode\n"); - if (ShouldSkip("A_EFFECTIVEOPERATIONMODE")) - { - NextTest(); - return; - } - err = TestReadsTheAttributeEffectiveOperationMode_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads the attribute: LifetimeRunningHours\n"); + err = TestReadsTheAttributeLifetimeRunningHours_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Write 0 to the ControlMode attribute to DUT\n"); - if (ShouldSkip("A_CONTROLMODE")) - { - NextTest(); - return; - } - err = TestWrite0ToTheControlModeAttributeToDut_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Write 2 to the LifetimeRunningHours attribute to DUT\n"); + err = TestWrite2ToTheLifetimeRunningHoursAttributeToDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads the attribute: EffectiveControlMode\n"); - if (ShouldSkip("A_EFFECTIVECONTROLMODE")) - { - NextTest(); - return; - } - err = TestReadsTheAttributeEffectiveControlMode_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads the attribute: LifetimeRunningHours\n"); + err = TestReadsTheAttributeLifetimeRunningHours_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Write 1 to the ControlMode attribute to DUT\n"); - if (ShouldSkip("A_CONTROLMODE")) - { - NextTest(); - return; - } - err = TestWrite1ToTheControlModeAttributeToDut_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Write 3 to the LifetimeRunningHours attribute to DUT\n"); + err = TestWrite3ToTheLifetimeRunningHoursAttributeToDut_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Write 2 to the ControlMode attribute to DUT\n"); - if (ShouldSkip("A_CONTROLMODE")) - { - NextTest(); - return; - } - err = TestWrite2ToTheControlModeAttributeToDut_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Reads the attribute: LifetimeRunningHours\n"); + err = TestReadsTheAttributeLifetimeRunningHours_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Write 3 to the ControlMode attribute to DUT\n"); - if (ShouldSkip("A_CONTROLMODE")) - { - NextTest(); - return; - } - err = TestWrite3ToTheControlModeAttributeToDut_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Write 1 to the LifetimeEnergyConsumed attribute to DUT\n"); + err = TestWrite1ToTheLifetimeEnergyConsumedAttributeToDut_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Write 5 to the ControlMode attribute to DUT\n"); - if (ShouldSkip("A_CONTROLMODE")) - { - NextTest(); - return; - } - err = TestWrite5ToTheControlModeAttributeToDut_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Write 2 to the LifetimeEnergyConsumed attribute to DUT\n"); + err = TestWrite2ToTheLifetimeEnergyConsumedAttributeToDut_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Write 7 to the ControlMode attribute to DUT\n"); - if (ShouldSkip("A_CONTROLMODE")) - { - NextTest(); - return; - } - err = TestWrite7ToTheControlModeAttributeToDut_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Reads the attribute: LifetimeEnergyConsumed\n"); + err = TestReadsTheAttributeLifetimeEnergyConsumed_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Write 3 to the LifetimeEnergyConsumed attribute to DUT\n"); + err = TestWrite3ToTheLifetimeEnergyConsumedAttributeToDut_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Reads the attribute: LifetimeEnergyConsumed\n"); + err = TestReadsTheAttributeLifetimeEnergyConsumed_11(); break; } @@ -36352,7 +39165,7 @@ class Test_TC_PCC_2_3Suite : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + const uint16_t mTestCount = 12; chip::Optional mNodeId; chip::Optional mCluster; @@ -36368,72 +39181,95 @@ class Test_TC_PCC_2_3Suite : public TestCommand static void OnFailureCallback_1(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_1(error); + (static_cast(context))->OnFailureResponse_1(error); } - static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } + static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } static void OnFailureCallback_2(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_2(error); + (static_cast(context))->OnFailureResponse_2(error); } - static void OnSuccessCallback_2(void * context, uint8_t effectiveOperationMode) + static void OnSuccessCallback_2(void * context, const chip::app::DataModel::Nullable & lifetimeRunningHours) { - (static_cast(context))->OnSuccessResponse_2(effectiveOperationMode); + (static_cast(context))->OnSuccessResponse_2(lifetimeRunningHours); } static void OnFailureCallback_3(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_3(error); + (static_cast(context))->OnFailureResponse_3(error); } - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } static void OnFailureCallback_4(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_4(error); + (static_cast(context))->OnFailureResponse_4(error); } - static void OnSuccessCallback_4(void * context, uint8_t effectiveControlMode) + static void OnSuccessCallback_4(void * context, const chip::app::DataModel::Nullable & lifetimeRunningHours) { - (static_cast(context))->OnSuccessResponse_4(effectiveControlMode); + (static_cast(context))->OnSuccessResponse_4(lifetimeRunningHours); } static void OnFailureCallback_5(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_5(error); + (static_cast(context))->OnFailureResponse_5(error); } - static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } + static void OnSuccessCallback_5(void * context) { (static_cast(context))->OnSuccessResponse_5(); } static void OnFailureCallback_6(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_6(error); + (static_cast(context))->OnFailureResponse_6(error); } - static void OnSuccessCallback_6(void * context) { (static_cast(context))->OnSuccessResponse_6(); } + static void OnSuccessCallback_6(void * context, const chip::app::DataModel::Nullable & lifetimeRunningHours) + { + (static_cast(context))->OnSuccessResponse_6(lifetimeRunningHours); + } static void OnFailureCallback_7(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_7(error); + (static_cast(context))->OnFailureResponse_7(error); } - static void OnSuccessCallback_7(void * context) { (static_cast(context))->OnSuccessResponse_7(); } + static void OnSuccessCallback_7(void * context) { (static_cast(context))->OnSuccessResponse_7(); } static void OnFailureCallback_8(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_8(error); + (static_cast(context))->OnFailureResponse_8(error); } - static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } + static void OnSuccessCallback_8(void * context) { (static_cast(context))->OnSuccessResponse_8(); } static void OnFailureCallback_9(void * context, CHIP_ERROR error) { - (static_cast(context))->OnFailureResponse_9(error); + (static_cast(context))->OnFailureResponse_9(error); } - static void OnSuccessCallback_9(void * context) { (static_cast(context))->OnSuccessResponse_9(); } + static void OnSuccessCallback_9(void * context, const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) + { + (static_cast(context))->OnSuccessResponse_9(lifetimeEnergyConsumed); + } + + static void OnFailureCallback_10(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_10(error); + } + + static void OnSuccessCallback_10(void * context) { (static_cast(context))->OnSuccessResponse_10(); } + + static void OnFailureCallback_11(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_11(error); + } + + static void OnSuccessCallback_11(void * context, const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) + { + (static_cast(context))->OnSuccessResponse_11(lifetimeEnergyConsumed); + } // // Tests methods @@ -36445,18 +39281,19 @@ class Test_TC_PCC_2_3Suite : public TestCommand return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } - CHIP_ERROR TestWrite0ToTheOperationModeAttributeToDut_1() + CHIP_ERROR TestWrite1ToTheLifetimeRunningHoursAttributeToDut_1() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t operationModeArgument; - operationModeArgument = 0; + chip::app::DataModel::Nullable lifetimeRunningHoursArgument; + lifetimeRunningHoursArgument.SetNonNull(); + lifetimeRunningHoursArgument.Value() = 1UL; ReturnErrorOnFailure( - cluster.WriteAttribute( - operationModeArgument, this, OnSuccessCallback_1, OnFailureCallback_1)); + cluster.WriteAttribute( + lifetimeRunningHoursArgument, this, OnSuccessCallback_1, OnFailureCallback_1)); return CHIP_NO_ERROR; } @@ -36468,14 +39305,14 @@ class Test_TC_PCC_2_3Suite : public TestCommand void OnSuccessResponse_1() { NextTest(); } - CHIP_ERROR TestReadsTheAttributeEffectiveOperationMode_2() + CHIP_ERROR TestReadsTheAttributeLifetimeRunningHours_2() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( + cluster.ReadAttribute( this, OnSuccessCallback_2, OnFailureCallback_2, true)); return CHIP_NO_ERROR; } @@ -36486,25 +39323,27 @@ class Test_TC_PCC_2_3Suite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_2(uint8_t effectiveOperationMode) + void OnSuccessResponse_2(const chip::app::DataModel::Nullable & lifetimeRunningHours) { - VerifyOrReturn(CheckValue("effectiveOperationMode", effectiveOperationMode, 0)); + VerifyOrReturn(CheckValueNonNull("lifetimeRunningHours", lifetimeRunningHours)); + VerifyOrReturn(CheckValue("lifetimeRunningHours.Value()", lifetimeRunningHours.Value(), 1UL)); NextTest(); } - CHIP_ERROR TestWrite0ToTheControlModeAttributeToDut_3() + CHIP_ERROR TestWrite2ToTheLifetimeRunningHoursAttributeToDut_3() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t controlModeArgument; - controlModeArgument = 0; + chip::app::DataModel::Nullable lifetimeRunningHoursArgument; + lifetimeRunningHoursArgument.SetNonNull(); + lifetimeRunningHoursArgument.Value() = 2UL; ReturnErrorOnFailure( - cluster.WriteAttribute( - controlModeArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); + cluster.WriteAttribute( + lifetimeRunningHoursArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); return CHIP_NO_ERROR; } @@ -36516,14 +39355,14 @@ class Test_TC_PCC_2_3Suite : public TestCommand void OnSuccessResponse_3() { NextTest(); } - CHIP_ERROR TestReadsTheAttributeEffectiveControlMode_4() + CHIP_ERROR TestReadsTheAttributeLifetimeRunningHours_4() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure( - cluster.ReadAttribute( + cluster.ReadAttribute( this, OnSuccessCallback_4, OnFailureCallback_4, true)); return CHIP_NO_ERROR; } @@ -36534,25 +39373,27 @@ class Test_TC_PCC_2_3Suite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_4(uint8_t effectiveControlMode) + void OnSuccessResponse_4(const chip::app::DataModel::Nullable & lifetimeRunningHours) { - VerifyOrReturn(CheckValue("effectiveControlMode", effectiveControlMode, 0)); + VerifyOrReturn(CheckValueNonNull("lifetimeRunningHours", lifetimeRunningHours)); + VerifyOrReturn(CheckValue("lifetimeRunningHours.Value()", lifetimeRunningHours.Value(), 2UL)); NextTest(); } - CHIP_ERROR TestWrite1ToTheControlModeAttributeToDut_5() + CHIP_ERROR TestWrite3ToTheLifetimeRunningHoursAttributeToDut_5() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t controlModeArgument; - controlModeArgument = 1; + chip::app::DataModel::Nullable lifetimeRunningHoursArgument; + lifetimeRunningHoursArgument.SetNonNull(); + lifetimeRunningHoursArgument.Value() = 3UL; ReturnErrorOnFailure( - cluster.WriteAttribute( - controlModeArgument, this, OnSuccessCallback_5, OnFailureCallback_5)); + cluster.WriteAttribute( + lifetimeRunningHoursArgument, this, OnSuccessCallback_5, OnFailureCallback_5)); return CHIP_NO_ERROR; } @@ -36564,18 +39405,15 @@ class Test_TC_PCC_2_3Suite : public TestCommand void OnSuccessResponse_5() { NextTest(); } - CHIP_ERROR TestWrite2ToTheControlModeAttributeToDut_6() + CHIP_ERROR TestReadsTheAttributeLifetimeRunningHours_6() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t controlModeArgument; - controlModeArgument = 2; - ReturnErrorOnFailure( - cluster.WriteAttribute( - controlModeArgument, this, OnSuccessCallback_6, OnFailureCallback_6)); + cluster.ReadAttribute( + this, OnSuccessCallback_6, OnFailureCallback_6, true)); return CHIP_NO_ERROR; } @@ -36585,20 +39423,27 @@ class Test_TC_PCC_2_3Suite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_6() { NextTest(); } + void OnSuccessResponse_6(const chip::app::DataModel::Nullable & lifetimeRunningHours) + { + VerifyOrReturn(CheckValueNonNull("lifetimeRunningHours", lifetimeRunningHours)); + VerifyOrReturn(CheckValue("lifetimeRunningHours.Value()", lifetimeRunningHours.Value(), 3UL)); - CHIP_ERROR TestWrite3ToTheControlModeAttributeToDut_7() + NextTest(); + } + + CHIP_ERROR TestWrite1ToTheLifetimeEnergyConsumedAttributeToDut_7() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t controlModeArgument; - controlModeArgument = 3; + chip::app::DataModel::Nullable lifetimeEnergyConsumedArgument; + lifetimeEnergyConsumedArgument.SetNonNull(); + lifetimeEnergyConsumedArgument.Value() = 1UL; ReturnErrorOnFailure( - cluster.WriteAttribute( - controlModeArgument, this, OnSuccessCallback_7, OnFailureCallback_7)); + cluster.WriteAttribute( + lifetimeEnergyConsumedArgument, this, OnSuccessCallback_7, OnFailureCallback_7)); return CHIP_NO_ERROR; } @@ -36610,18 +39455,19 @@ class Test_TC_PCC_2_3Suite : public TestCommand void OnSuccessResponse_7() { NextTest(); } - CHIP_ERROR TestWrite5ToTheControlModeAttributeToDut_8() + CHIP_ERROR TestWrite2ToTheLifetimeEnergyConsumedAttributeToDut_8() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t controlModeArgument; - controlModeArgument = 5; + chip::app::DataModel::Nullable lifetimeEnergyConsumedArgument; + lifetimeEnergyConsumedArgument.SetNonNull(); + lifetimeEnergyConsumedArgument.Value() = 2UL; ReturnErrorOnFailure( - cluster.WriteAttribute( - controlModeArgument, this, OnSuccessCallback_8, OnFailureCallback_8)); + cluster.WriteAttribute( + lifetimeEnergyConsumedArgument, this, OnSuccessCallback_8, OnFailureCallback_8)); return CHIP_NO_ERROR; } @@ -36633,18 +39479,15 @@ class Test_TC_PCC_2_3Suite : public TestCommand void OnSuccessResponse_8() { NextTest(); } - CHIP_ERROR TestWrite7ToTheControlModeAttributeToDut_9() + CHIP_ERROR TestReadsTheAttributeLifetimeEnergyConsumed_9() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t controlModeArgument; - controlModeArgument = 7; - ReturnErrorOnFailure( - cluster.WriteAttribute( - controlModeArgument, this, OnSuccessCallback_9, OnFailureCallback_9)); + cluster.ReadAttribute( + this, OnSuccessCallback_9, OnFailureCallback_9, true)); return CHIP_NO_ERROR; } @@ -36654,7 +39497,63 @@ class Test_TC_PCC_2_3Suite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_9() { NextTest(); } + void OnSuccessResponse_9(const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) + { + VerifyOrReturn(CheckValueNonNull("lifetimeEnergyConsumed", lifetimeEnergyConsumed)); + VerifyOrReturn(CheckValue("lifetimeEnergyConsumed.Value()", lifetimeEnergyConsumed.Value(), 2UL)); + + NextTest(); + } + + CHIP_ERROR TestWrite3ToTheLifetimeEnergyConsumedAttributeToDut_10() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable lifetimeEnergyConsumedArgument; + lifetimeEnergyConsumedArgument.SetNonNull(); + lifetimeEnergyConsumedArgument.Value() = 3UL; + + ReturnErrorOnFailure( + cluster.WriteAttribute( + lifetimeEnergyConsumedArgument, this, OnSuccessCallback_10, OnFailureCallback_10)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_10(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_10() { NextTest(); } + + CHIP_ERROR TestReadsTheAttributeLifetimeEnergyConsumed_11() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_11, OnFailureCallback_11, true)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_11(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_11(const chip::app::DataModel::Nullable & lifetimeEnergyConsumed) + { + VerifyOrReturn(CheckValueNonNull("lifetimeEnergyConsumed", lifetimeEnergyConsumed)); + VerifyOrReturn(CheckValue("lifetimeEnergyConsumed.Value()", lifetimeEnergyConsumed.Value(), 3UL)); + + NextTest(); + } }; class Test_TC_RH_1_1Suite : public TestCommand @@ -98217,154 +101116,18 @@ class Test_TC_BDX_2_1Suite : public TestCommand // }; -class Test_TC_BDX_2_2Suite : public TestCommand -{ -public: - Test_TC_BDX_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_BDX_2_2", credsIssuerConfig), mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - } - - ~Test_TC_BDX_2_2Suite() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_BDX_2_2\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BDX_2_2\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // 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++) - { - } - - 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 = 0; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override - { - bool isExpectedDnssdResult = false; - - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); - } - - // - // Tests methods - // -}; - -class Test_TC_BDX_2_3Suite : public TestCommand -{ -public: - Test_TC_BDX_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_BDX_2_3", credsIssuerConfig), mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - } - - ~Test_TC_BDX_2_3Suite() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_BDX_2_3\n"); - } - - if (mTestCount == mTestIndex) - { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BDX_2_3\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // 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++) - { - } - - 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 = 0; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - - void OnDiscoveryCommandsResults(const DiscoveryCommandResult & value) override - { - bool isExpectedDnssdResult = false; - - VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); - NextTest(); - } - - // - // Tests methods - // -}; - -class Test_TC_BDX_2_4Suite : public TestCommand +class Test_TC_BDX_2_2Suite : public TestCommand { public: - Test_TC_BDX_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_BDX_2_4", credsIssuerConfig), mTestIndex(0) + Test_TC_BDX_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_BDX_2_2", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_BDX_2_4Suite() {} + ~Test_TC_BDX_2_2Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -98373,12 +101136,12 @@ class Test_TC_BDX_2_4Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_BDX_2_4\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_BDX_2_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BDX_2_4\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BDX_2_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -98421,18 +101184,18 @@ class Test_TC_BDX_2_4Suite : public TestCommand // }; -class Test_TC_BDX_2_5Suite : public TestCommand +class Test_TC_BDX_2_3Suite : public TestCommand { public: - Test_TC_BDX_2_5Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_BDX_2_5", credsIssuerConfig), mTestIndex(0) + Test_TC_BDX_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_BDX_2_3", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_BDX_2_5Suite() {} + ~Test_TC_BDX_2_3Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -98441,12 +101204,12 @@ class Test_TC_BDX_2_5Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_BDX_2_5\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_BDX_2_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BDX_2_5\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BDX_2_3\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -98489,17 +101252,18 @@ class Test_TC_BDX_2_5Suite : public TestCommand // }; -class Test_TC_BR_1Suite : public TestCommand +class Test_TC_BDX_2_4Suite : public TestCommand { public: - Test_TC_BR_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BR_1", credsIssuerConfig), mTestIndex(0) + Test_TC_BDX_2_4Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_BDX_2_4", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_BR_1Suite() {} + ~Test_TC_BDX_2_4Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -98508,12 +101272,12 @@ class Test_TC_BR_1Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_BR_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_BDX_2_4\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BR_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BDX_2_4\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -98556,17 +101320,18 @@ class Test_TC_BR_1Suite : public TestCommand // }; -class Test_TC_BR_2Suite : public TestCommand +class Test_TC_BDX_2_5Suite : public TestCommand { public: - Test_TC_BR_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BR_2", credsIssuerConfig), mTestIndex(0) + Test_TC_BDX_2_5Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_BDX_2_5", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_BR_2Suite() {} + ~Test_TC_BDX_2_5Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -98575,12 +101340,12 @@ class Test_TC_BR_2Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_BR_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_BDX_2_5\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BR_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BDX_2_5\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -98623,17 +101388,17 @@ class Test_TC_BR_2Suite : public TestCommand // }; -class Test_TC_BR_3Suite : public TestCommand +class Test_TC_BR_1Suite : public TestCommand { public: - Test_TC_BR_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BR_3", credsIssuerConfig), mTestIndex(0) + Test_TC_BR_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BR_1", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_BR_3Suite() {} + ~Test_TC_BR_1Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -98642,12 +101407,12 @@ class Test_TC_BR_3Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_BR_3\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_BR_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BR_3\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BR_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -98690,18 +101455,17 @@ class Test_TC_BR_3Suite : public TestCommand // }; -class Test_TC_BRAC_2_1Suite : public TestCommand +class Test_TC_BR_2Suite : public TestCommand { public: - Test_TC_BRAC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_BRAC_2_1", credsIssuerConfig), mTestIndex(0) + Test_TC_BR_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BR_2", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_BRAC_2_1Suite() {} + ~Test_TC_BR_2Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -98710,12 +101474,12 @@ class Test_TC_BRAC_2_1Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_BRAC_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_BR_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BRAC_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BR_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -98758,18 +101522,17 @@ class Test_TC_BRAC_2_1Suite : public TestCommand // }; -class Test_TC_BRAC_2_2Suite : public TestCommand +class Test_TC_BR_3Suite : public TestCommand { public: - Test_TC_BRAC_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_BRAC_2_2", credsIssuerConfig), mTestIndex(0) + Test_TC_BR_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BR_3", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_BRAC_2_2Suite() {} + ~Test_TC_BR_3Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -98778,12 +101541,12 @@ class Test_TC_BRAC_2_2Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_BRAC_2_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_BR_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BRAC_2_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BR_3\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -98826,18 +101589,18 @@ class Test_TC_BRAC_2_2Suite : public TestCommand // }; -class Test_TC_DM_1_2Suite : public TestCommand +class Test_TC_BRAC_2_1Suite : public TestCommand { public: - Test_TC_DM_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_DM_1_2", credsIssuerConfig), mTestIndex(0) + Test_TC_BRAC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_BRAC_2_1", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_DM_1_2Suite() {} + ~Test_TC_BRAC_2_1Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -98846,12 +101609,12 @@ class Test_TC_DM_1_2Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DM_1_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_BRAC_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DM_1_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BRAC_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -98894,18 +101657,18 @@ class Test_TC_DM_1_2Suite : public TestCommand // }; -class Test_TC_DM_2_3Suite : public TestCommand +class Test_TC_BRAC_2_2Suite : public TestCommand { public: - Test_TC_DM_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_DM_2_3", credsIssuerConfig), mTestIndex(0) + Test_TC_BRAC_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_BRAC_2_2", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_DM_2_3Suite() {} + ~Test_TC_BRAC_2_2Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -98914,12 +101677,12 @@ class Test_TC_DM_2_3Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DM_2_3\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_BRAC_2_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DM_2_3\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BRAC_2_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -98962,18 +101725,18 @@ class Test_TC_DM_2_3Suite : public TestCommand // }; -class Test_TC_DM_3_2Suite : public TestCommand +class Test_TC_DM_1_2Suite : public TestCommand { public: - Test_TC_DM_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_DM_3_2", credsIssuerConfig), mTestIndex(0) + Test_TC_DM_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DM_1_2", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_DM_3_2Suite() {} + ~Test_TC_DM_1_2Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -98982,12 +101745,12 @@ class Test_TC_DM_3_2Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DM_3_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DM_1_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DM_3_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DM_1_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -99030,18 +101793,18 @@ class Test_TC_DM_3_2Suite : public TestCommand // }; -class Test_TC_DIAG_LOG_1_1Suite : public TestCommand +class Test_TC_DM_2_3Suite : public TestCommand { public: - Test_TC_DIAG_LOG_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_DIAG_LOG_1_1", credsIssuerConfig), mTestIndex(0) + Test_TC_DM_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DM_2_3", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_DIAG_LOG_1_1Suite() {} + ~Test_TC_DM_2_3Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -99050,12 +101813,12 @@ class Test_TC_DIAG_LOG_1_1Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DIAG_LOG_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DM_2_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DIAG_LOG_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DM_2_3\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -99098,18 +101861,18 @@ class Test_TC_DIAG_LOG_1_1Suite : public TestCommand // }; -class Test_TC_DIAG_LOG_1_2Suite : public TestCommand +class Test_TC_DM_3_2Suite : public TestCommand { public: - Test_TC_DIAG_LOG_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_DIAG_LOG_1_2", credsIssuerConfig), mTestIndex(0) + Test_TC_DM_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DM_3_2", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_DIAG_LOG_1_2Suite() {} + ~Test_TC_DM_3_2Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -99118,12 +101881,12 @@ class Test_TC_DIAG_LOG_1_2Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DIAG_LOG_1_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DM_3_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DIAG_LOG_1_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DM_3_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -99166,18 +101929,18 @@ class Test_TC_DIAG_LOG_1_2Suite : public TestCommand // }; -class Test_TC_DIAG_LOG_1_3Suite : public TestCommand +class Test_TC_DIAG_LOG_1_1Suite : public TestCommand { public: - Test_TC_DIAG_LOG_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_DIAG_LOG_1_3", credsIssuerConfig), mTestIndex(0) + Test_TC_DIAG_LOG_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DIAG_LOG_1_1", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_DIAG_LOG_1_3Suite() {} + ~Test_TC_DIAG_LOG_1_1Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -99186,12 +101949,12 @@ class Test_TC_DIAG_LOG_1_3Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DIAG_LOG_1_3\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DIAG_LOG_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DIAG_LOG_1_3\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DIAG_LOG_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -99234,18 +101997,18 @@ class Test_TC_DIAG_LOG_1_3Suite : public TestCommand // }; -class Test_TC_DESC_1_1Suite : public TestCommand +class Test_TC_DIAG_LOG_1_2Suite : public TestCommand { public: - Test_TC_DESC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_DESC_1_1", credsIssuerConfig), mTestIndex(0) + Test_TC_DIAG_LOG_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DIAG_LOG_1_2", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_DESC_1_1Suite() {} + ~Test_TC_DIAG_LOG_1_2Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -99254,12 +102017,12 @@ class Test_TC_DESC_1_1Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DESC_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DIAG_LOG_1_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DESC_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DIAG_LOG_1_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -99302,18 +102065,18 @@ class Test_TC_DESC_1_1Suite : public TestCommand // }; -class Test_TC_ETHDIAG_1_2Suite : public TestCommand +class Test_TC_DIAG_LOG_1_3Suite : public TestCommand { public: - Test_TC_ETHDIAG_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_ETHDIAG_1_2", credsIssuerConfig), mTestIndex(0) + Test_TC_DIAG_LOG_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DIAG_LOG_1_3", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_ETHDIAG_1_2Suite() {} + ~Test_TC_DIAG_LOG_1_3Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -99322,12 +102085,12 @@ class Test_TC_ETHDIAG_1_2Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_ETHDIAG_1_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DIAG_LOG_1_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ETHDIAG_1_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DIAG_LOG_1_3\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -99370,18 +102133,18 @@ class Test_TC_ETHDIAG_1_2Suite : public TestCommand // }; -class Test_TC_GC_1_1Suite : public TestCommand +class Test_TC_DESC_1_1Suite : public TestCommand { public: - Test_TC_GC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_GC_1_1", credsIssuerConfig), mTestIndex(0) + Test_TC_DESC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_DESC_1_1", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_GC_1_1Suite() {} + ~Test_TC_DESC_1_1Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -99390,12 +102153,12 @@ class Test_TC_GC_1_1Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_GC_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DESC_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_GC_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DESC_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -99438,18 +102201,18 @@ class Test_TC_GC_1_1Suite : public TestCommand // }; -class Test_TC_GC_1_2Suite : public TestCommand +class Test_TC_ETHDIAG_1_2Suite : public TestCommand { public: - Test_TC_GC_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_GC_1_2", credsIssuerConfig), mTestIndex(0) + Test_TC_ETHDIAG_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_ETHDIAG_1_2", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_GC_1_2Suite() {} + ~Test_TC_ETHDIAG_1_2Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -99458,12 +102221,12 @@ class Test_TC_GC_1_2Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_GC_1_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_ETHDIAG_1_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_GC_1_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ETHDIAG_1_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -99506,18 +102269,18 @@ class Test_TC_GC_1_2Suite : public TestCommand // }; -class Test_TC_GC_1_3Suite : public TestCommand +class Test_TC_GC_1_1Suite : public TestCommand { public: - Test_TC_GC_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_GC_1_3", credsIssuerConfig), mTestIndex(0) + Test_TC_GC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_GC_1_1", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_GC_1_3Suite() {} + ~Test_TC_GC_1_1Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -99526,12 +102289,12 @@ class Test_TC_GC_1_3Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_GC_1_3\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_GC_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_GC_1_3\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_GC_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -99574,18 +102337,18 @@ class Test_TC_GC_1_3Suite : public TestCommand // }; -class Test_TC_GENDIAG_1_1Suite : public TestCommand +class Test_TC_GC_1_2Suite : public TestCommand { public: - Test_TC_GENDIAG_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_GENDIAG_1_1", credsIssuerConfig), mTestIndex(0) + Test_TC_GC_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_GC_1_2", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_GENDIAG_1_1Suite() {} + ~Test_TC_GC_1_2Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -99594,12 +102357,12 @@ class Test_TC_GENDIAG_1_1Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_GENDIAG_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_GC_1_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_GENDIAG_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_GC_1_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -99642,18 +102405,18 @@ class Test_TC_GENDIAG_1_1Suite : public TestCommand // }; -class Test_TC_GENDIAG_1_2Suite : public TestCommand +class Test_TC_GC_1_3Suite : public TestCommand { public: - Test_TC_GENDIAG_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_GENDIAG_1_2", credsIssuerConfig), mTestIndex(0) + Test_TC_GC_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_GC_1_3", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_GENDIAG_1_2Suite() {} + ~Test_TC_GC_1_3Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -99662,12 +102425,12 @@ class Test_TC_GENDIAG_1_2Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_GENDIAG_1_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_GC_1_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_GENDIAG_1_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_GC_1_3\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -99710,18 +102473,18 @@ class Test_TC_GENDIAG_1_2Suite : public TestCommand // }; -class Test_TC_I_1_1Suite : public TestCommand +class Test_TC_GENDIAG_1_1Suite : public TestCommand { public: - Test_TC_I_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_I_1_1", credsIssuerConfig), mTestIndex(0) + Test_TC_GENDIAG_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_GENDIAG_1_1", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_I_1_1Suite() {} + ~Test_TC_GENDIAG_1_1Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -99730,12 +102493,12 @@ class Test_TC_I_1_1Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_GENDIAG_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_GENDIAG_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -99778,18 +102541,18 @@ class Test_TC_I_1_1Suite : public TestCommand // }; -class Test_TC_I_2_1Suite : public TestCommand +class Test_TC_GENDIAG_1_2Suite : public TestCommand { public: - Test_TC_I_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_I_2_1", credsIssuerConfig), mTestIndex(0) + Test_TC_GENDIAG_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_GENDIAG_1_2", credsIssuerConfig), mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); } - ~Test_TC_I_2_1Suite() {} + ~Test_TC_GENDIAG_1_2Suite() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -99798,12 +102561,12 @@ class Test_TC_I_2_1Suite : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_GENDIAG_1_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_GENDIAG_1_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -104992,6 +107755,8 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -105001,6 +107766,17 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -105038,6 +107814,7 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -105151,8 +107928,6 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig),