From e178d3da83ba4ec103c91185363473e4aa249c5b Mon Sep 17 00:00:00 2001 From: Graf Tobias <4622393+tobiasgraf@users.noreply.github.com> Date: Fri, 26 May 2023 10:14:47 +0200 Subject: [PATCH 01/16] Add Test scripts for HepaFilterMonitoring Cluster #26842 --- .../certification/Test_TC_HEPAFREMON_1_1.yaml | 109 ++++++++++++++++++ .../certification/Test_TC_HEPAFREMON_2_1.yaml | 71 ++++++++++++ 2 files changed, 180 insertions(+) create mode 100644 src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_HEPAFREMON_2_1.yaml diff --git a/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml new file mode 100644 index 00000000000000..b3ef93f65a7581 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml @@ -0,0 +1,109 @@ +# 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: 164.1.1. [TC-HEPAFREMON-1.1] Global Attributes with DUT as Server + +PICS: + - HEPAFREMON.S + +config: + nodeId: 0x12344321 + cluster: "HepaFilterMonitoring" + # todo: is this correctly spelled? + 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 + constraints: + type: int16u + + - label: "Read the global attribute: FeatureMap" + command: "readAttribute" + attribute: "FeatureMap" + PICS: " !HEPAFREMON.S.F00 && !HEPAFREMON.S.F01" + response: + value: 0 + constraints: + type: bitmap32 + + - label: "Given HEPAFREMON.S.F00(Condition) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: HEPAFREMON.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: "Given HEPAFREMON.S.F01(Warning) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: HEPAFREMON.S.F01 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Read the feature dependent(HEPAFREMON.S.F00) attribute in AttributeList" + PICS: HEPAFREMON.S.F00 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [0, 1] + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [] + + - label: "Read the global attribute: GeneratedCommandList" + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + value: [] + constraints: + type: list + + - label: "TH reads EventList attribute from DUT" + command: "readAttribute" + attribute: "EventList" + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_HEPAFREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_HEPAFREMON_2_1.yaml new file mode 100644 index 00000000000000..f3878fb494f3ce --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_HEPAFREMON_2_1.yaml @@ -0,0 +1,71 @@ +# 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: 3.2.1. [TC-HEPAFREMON-2.1] Attributes with server as DUT + +PICS: + - HEPAFREMON.S + +config: + nodeId: 0x12344321 + cluster: "HepaFilterMonitoring" + # todo: is this correctly spelled? + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the Condition attribute." + PICS: HEPAFREMON.S.A0000 + command: "readAttribute" + attribute: "Condition" + response: + constraints: + type: uint8u + minValue: 0 + maxValue: 100 + + - label: "TH reads from the DUT the DegradationDirection attribute.." + PICS: HEPAFREMON.S.A0001 + command: "readAttribute" + attribute: "DegradationDirection" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 1 + + - label: "TH reads from the DUT the ChangeIndication attribute." + PICS: HEPAFREMON.S.A0002 + command: "readAttribute" + attribute: "ChangeIndication" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the InPlaceIndicator attribute" + PICS: HEPAFREMON.S.A0003 + command: "readAttribute" + attribute: "InPlaceIndicator" + response: + constraints: + type: boolean \ No newline at end of file From afe3f73b89de0d9971e82f24bb566cf6de29242b Mon Sep 17 00:00:00 2001 From: Graf Tobias <4622393+tobiasgraf@users.noreply.github.com> Date: Fri, 26 May 2023 13:58:56 +0200 Subject: [PATCH 02/16] Update Test scripts for Hepa Filter Monitoring #26842 --- .../tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml | 5 ++--- .../tests/suites/certification/Test_TC_HEPAFREMON_2_1.yaml | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml index b3ef93f65a7581..6cfde236881b4c 100644 --- a/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml @@ -12,15 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: 164.1.1. [TC-HEPAFREMON-1.1] Global Attributes with DUT as Server +name: 165.1.1. [TC-HEPAFREMON-1.1] Global Attributes with DUT as Server PICS: - HEPAFREMON.S config: nodeId: 0x12344321 - cluster: "HepaFilterMonitoring" - # todo: is this correctly spelled? + cluster: "HEPA Filter Monitoring" endpoint: 1 tests: diff --git a/src/app/tests/suites/certification/Test_TC_HEPAFREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_HEPAFREMON_2_1.yaml index f3878fb494f3ce..f8993b74f57af8 100644 --- a/src/app/tests/suites/certification/Test_TC_HEPAFREMON_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_HEPAFREMON_2_1.yaml @@ -12,14 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: 3.2.1. [TC-HEPAFREMON-2.1] Attributes with server as DUT +name: 165.2.1. [TC-HEPAFREMON-2.1] Attributes with server as DUT PICS: - HEPAFREMON.S config: nodeId: 0x12344321 - cluster: "HepaFilterMonitoring" + cluster: "HEPA Filter Monitoring" # todo: is this correctly spelled? endpoint: 1 @@ -38,7 +38,7 @@ tests: attribute: "Condition" response: constraints: - type: uint8u + type: percent minValue: 0 maxValue: 100 From 638b587d7f35555908a7960987c8e11bce2a4106 Mon Sep 17 00:00:00 2001 From: Graf Tobias <4622393+tobiasgraf@users.noreply.github.com> Date: Fri, 26 May 2023 13:59:26 +0200 Subject: [PATCH 03/16] Add Test Scripts for the remaining Replaceable Monitoring Aliased clusters #26842 --- .../certification/Test_TC_ACFREMON_1_1.yaml | 108 ++++++++++++++++++ .../certification/Test_TC_ACFREMON_2_1.yaml | 71 ++++++++++++ .../certification/Test_TC_CFREMON_1_1.yaml | 108 ++++++++++++++++++ .../certification/Test_TC_CFREMON_2_1.yaml | 71 ++++++++++++ .../certification/Test_TC_ESFREMON_1_1.yaml | 108 ++++++++++++++++++ .../certification/Test_TC_ESFREMON_2_1.yaml | 71 ++++++++++++ .../certification/Test_TC_FTREMON_1_1.yaml | 108 ++++++++++++++++++ .../certification/Test_TC_FTREMON_2_1.yaml | 71 ++++++++++++ .../certification/Test_TC_INKCREMON_1_1.yaml | 108 ++++++++++++++++++ .../certification/Test_TC_INKCREMON_2_1.yaml | 71 ++++++++++++ .../certification/Test_TC_IONFREMON_1_1.yaml | 108 ++++++++++++++++++ .../certification/Test_TC_IONFREMON_2_1.yaml | 71 ++++++++++++ .../certification/Test_TC_OZFREMON_1_1.yaml | 108 ++++++++++++++++++ .../certification/Test_TC_OZFREMON_2_1.yaml | 71 ++++++++++++ .../certification/Test_TC_TCREMON_1_1.yaml | 108 ++++++++++++++++++ .../certification/Test_TC_TCREMON_2_1.yaml | 71 ++++++++++++ .../certification/Test_TC_UVFREMON_1_1.yaml | 108 ++++++++++++++++++ .../certification/Test_TC_UVFREMON_2_1.yaml | 71 ++++++++++++ .../certification/Test_TC_WTREMON_1_1.yaml | 108 ++++++++++++++++++ .../certification/Test_TC_WTREMON_2_1.yaml | 71 ++++++++++++ .../certification/Test_TC_ZEOFREMON_1_1.yaml | 108 ++++++++++++++++++ .../certification/Test_TC_ZEOFREMON_2_1.yaml | 71 ++++++++++++ 22 files changed, 1969 insertions(+) create mode 100644 src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_ACFREMON_2_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_CFREMON_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_CFREMON_2_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_ESFREMON_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_ESFREMON_2_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_FTREMON_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_FTREMON_2_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_INKCREMON_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_INKCREMON_2_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_IONFREMON_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_IONFREMON_2_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_OZFREMON_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_OZFREMON_2_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_TCREMON_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_TCREMON_2_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_UVFREMON_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_UVFREMON_2_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_WTREMON_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_WTREMON_2_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_ZEOFREMON_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_ZEOFREMON_2_1.yaml diff --git a/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml new file mode 100644 index 00000000000000..9810ea2df3fab3 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml @@ -0,0 +1,108 @@ +# 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: 165.1.1. [TC-ACFREMON-1.1] Global Attributes with DUT as Server + +PICS: + - ACFREMON.S + +config: + nodeId: 0x12344321 + cluster: "Activated Carbon Filter Monitoring" + 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 + constraints: + type: int16u + + - label: "Read the global attribute: FeatureMap" + command: "readAttribute" + attribute: "FeatureMap" + PICS: " !ACFREMON.S.F00 && !ACFREMON.S.F01" + response: + value: 0 + constraints: + type: bitmap32 + + - label: "Given ACFREMON.S.F00(Condition) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: ACFREMON.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: "Given ACFREMON.S.F01(Warning) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: ACFREMON.S.F01 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Read the feature dependent(ACFREMON.S.F00) attribute in AttributeList" + PICS: ACFREMON.S.F00 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [0, 1] + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [] + + - label: "Read the global attribute: GeneratedCommandList" + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + value: [] + constraints: + type: list + + - label: "TH reads EventList attribute from DUT" + command: "readAttribute" + attribute: "EventList" + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_ACFREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_ACFREMON_2_1.yaml new file mode 100644 index 00000000000000..c7a0e64aa7f966 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_ACFREMON_2_1.yaml @@ -0,0 +1,71 @@ +# 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: 165.2.1. [TC-ACFREMON-2.1] Attributes with server as DUT + +PICS: + - ACFREMON.S + +config: + nodeId: 0x12344321 + cluster: "Activated Carbon Filter Monitoring" + # todo: is this correctly spelled? + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the Condition attribute." + PICS: ACFREMON.S.A0000 + command: "readAttribute" + attribute: "Condition" + response: + constraints: + type: percent + minValue: 0 + maxValue: 100 + + - label: "TH reads from the DUT the DegradationDirection attribute.." + PICS: ACFREMON.S.A0001 + command: "readAttribute" + attribute: "DegradationDirection" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 1 + + - label: "TH reads from the DUT the ChangeIndication attribute." + PICS: ACFREMON.S.A0002 + command: "readAttribute" + attribute: "ChangeIndication" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the InPlaceIndicator attribute" + PICS: ACFREMON.S.A0003 + command: "readAttribute" + attribute: "InPlaceIndicator" + response: + constraints: + type: boolean \ No newline at end of file diff --git a/src/app/tests/suites/certification/Test_TC_CFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_CFREMON_1_1.yaml new file mode 100644 index 00000000000000..51188a5143a239 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_CFREMON_1_1.yaml @@ -0,0 +1,108 @@ +# 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: 165.1.1. [TC-CFREMON-1.1] Global Attributes with DUT as Server + +PICS: + - CFREMON.S + +config: + nodeId: 0x12344321 + cluster: "Ceramic Filter Monitoring" + 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 + constraints: + type: int16u + + - label: "Read the global attribute: FeatureMap" + command: "readAttribute" + attribute: "FeatureMap" + PICS: " !CFREMON.S.F00 && !CFREMON.S.F01" + response: + value: 0 + constraints: + type: bitmap32 + + - label: "Given CFREMON.S.F00(Condition) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CFREMON.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: "Given CFREMON.S.F01(Warning) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CFREMON.S.F01 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Read the feature dependent(CFREMON.S.F00) attribute in AttributeList" + PICS: CFREMON.S.F00 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [0, 1] + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [] + + - label: "Read the global attribute: GeneratedCommandList" + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + value: [] + constraints: + type: list + + - label: "TH reads EventList attribute from DUT" + command: "readAttribute" + attribute: "EventList" + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_CFREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_CFREMON_2_1.yaml new file mode 100644 index 00000000000000..70ee6e0de8b51b --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_CFREMON_2_1.yaml @@ -0,0 +1,71 @@ +# 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: 165.2.1. [TC-CFREMON-2.1] Attributes with server as DUT + +PICS: + - CFREMON.S + +config: + nodeId: 0x12344321 + cluster: "Ceramic Filter Monitoring" + # todo: is this correctly spelled? + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the Condition attribute." + PICS: CFREMON.S.A0000 + command: "readAttribute" + attribute: "Condition" + response: + constraints: + type: percent + minValue: 0 + maxValue: 100 + + - label: "TH reads from the DUT the DegradationDirection attribute.." + PICS: CFREMON.S.A0001 + command: "readAttribute" + attribute: "DegradationDirection" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 1 + + - label: "TH reads from the DUT the ChangeIndication attribute." + PICS: CFREMON.S.A0002 + command: "readAttribute" + attribute: "ChangeIndication" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the InPlaceIndicator attribute" + PICS: CFREMON.S.A0003 + command: "readAttribute" + attribute: "InPlaceIndicator" + response: + constraints: + type: boolean \ No newline at end of file diff --git a/src/app/tests/suites/certification/Test_TC_ESFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_ESFREMON_1_1.yaml new file mode 100644 index 00000000000000..443c7e54770dbb --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_ESFREMON_1_1.yaml @@ -0,0 +1,108 @@ +# 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: 165.1.1. [TC-ESFREMON-1.1] Global Attributes with DUT as Server + +PICS: + - ESFREMON.S + +config: + nodeId: 0x12344321 + cluster: "Electrostatic Filter Monitoring" + 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 + constraints: + type: int16u + + - label: "Read the global attribute: FeatureMap" + command: "readAttribute" + attribute: "FeatureMap" + PICS: " !ESFREMON.S.F00 && !ESFREMON.S.F01" + response: + value: 0 + constraints: + type: bitmap32 + + - label: "Given ESFREMON.S.F00(Condition) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: ESFREMON.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: "Given ESFREMON.S.F01(Warning) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: ESFREMON.S.F01 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Read the feature dependent(ESFREMON.S.F00) attribute in AttributeList" + PICS: ESFREMON.S.F00 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [0, 1] + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [] + + - label: "Read the global attribute: GeneratedCommandList" + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + value: [] + constraints: + type: list + + - label: "TH reads EventList attribute from DUT" + command: "readAttribute" + attribute: "EventList" + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_ESFREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_ESFREMON_2_1.yaml new file mode 100644 index 00000000000000..4c20d5948c5bf9 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_ESFREMON_2_1.yaml @@ -0,0 +1,71 @@ +# 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: 165.2.1. [TC-ESFREMON-2.1] Attributes with server as DUT + +PICS: + - ESFREMON.S + +config: + nodeId: 0x12344321 + cluster: "Electrostatic Filter Monitoring" + # todo: is this correctly spelled? + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the Condition attribute." + PICS: ESFREMON.S.A0000 + command: "readAttribute" + attribute: "Condition" + response: + constraints: + type: percent + minValue: 0 + maxValue: 100 + + - label: "TH reads from the DUT the DegradationDirection attribute.." + PICS: ESFREMON.S.A0001 + command: "readAttribute" + attribute: "DegradationDirection" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 1 + + - label: "TH reads from the DUT the ChangeIndication attribute." + PICS: ESFREMON.S.A0002 + command: "readAttribute" + attribute: "ChangeIndication" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the InPlaceIndicator attribute" + PICS: ESFREMON.S.A0003 + command: "readAttribute" + attribute: "InPlaceIndicator" + response: + constraints: + type: boolean \ No newline at end of file diff --git a/src/app/tests/suites/certification/Test_TC_FTREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_FTREMON_1_1.yaml new file mode 100644 index 00000000000000..81973082cc71e8 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_FTREMON_1_1.yaml @@ -0,0 +1,108 @@ +# 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: 165.1.1. [TC-FTREMON-1.1] Global Attributes with DUT as Server + +PICS: + - FTREMON.S + +config: + nodeId: 0x12344321 + cluster: "Fuel Tank Monitoring" + 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 + constraints: + type: int16u + + - label: "Read the global attribute: FeatureMap" + command: "readAttribute" + attribute: "FeatureMap" + PICS: " !FTREMON.S.F00 && !FTREMON.S.F01" + response: + value: 0 + constraints: + type: bitmap32 + + - label: "Given FTREMON.S.F00(Condition) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: FTREMON.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: "Given FTREMON.S.F01(Warning) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: FTREMON.S.F01 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Read the feature dependent(FTREMON.S.F00) attribute in AttributeList" + PICS: FTREMON.S.F00 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [0, 1] + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [] + + - label: "Read the global attribute: GeneratedCommandList" + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + value: [] + constraints: + type: list + + - label: "TH reads EventList attribute from DUT" + command: "readAttribute" + attribute: "EventList" + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_FTREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_FTREMON_2_1.yaml new file mode 100644 index 00000000000000..70083b2cc54ddc --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_FTREMON_2_1.yaml @@ -0,0 +1,71 @@ +# 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: 165.2.1. [TC-FTREMON-2.1] Attributes with server as DUT + +PICS: + - FTREMON.S + +config: + nodeId: 0x12344321 + cluster: "Fuel Tank Monitoring" + # todo: is this correctly spelled? + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the Condition attribute." + PICS: FTREMON.S.A0000 + command: "readAttribute" + attribute: "Condition" + response: + constraints: + type: percent + minValue: 0 + maxValue: 100 + + - label: "TH reads from the DUT the DegradationDirection attribute.." + PICS: FTREMON.S.A0001 + command: "readAttribute" + attribute: "DegradationDirection" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 1 + + - label: "TH reads from the DUT the ChangeIndication attribute." + PICS: FTREMON.S.A0002 + command: "readAttribute" + attribute: "ChangeIndication" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the InPlaceIndicator attribute" + PICS: FTREMON.S.A0003 + command: "readAttribute" + attribute: "InPlaceIndicator" + response: + constraints: + type: boolean \ No newline at end of file diff --git a/src/app/tests/suites/certification/Test_TC_INKCREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_INKCREMON_1_1.yaml new file mode 100644 index 00000000000000..d015e50e68b897 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_INKCREMON_1_1.yaml @@ -0,0 +1,108 @@ +# 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: 165.1.1. [TC-INKCREMON-1.1] Global Attributes with DUT as Server + +PICS: + - INKCREMON.S + +config: + nodeId: 0x12344321 + cluster: "Ink Cartridge Monitoring" + 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 + constraints: + type: int16u + + - label: "Read the global attribute: FeatureMap" + command: "readAttribute" + attribute: "FeatureMap" + PICS: " !INKCREMON.S.F00 && !INKCREMON.S.F01" + response: + value: 0 + constraints: + type: bitmap32 + + - label: "Given INKCREMON.S.F00(Condition) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: INKCREMON.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: "Given INKCREMON.S.F01(Warning) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: INKCREMON.S.F01 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Read the feature dependent(INKCREMON.S.F00) attribute in AttributeList" + PICS: INKCREMON.S.F00 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [0, 1] + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [] + + - label: "Read the global attribute: GeneratedCommandList" + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + value: [] + constraints: + type: list + + - label: "TH reads EventList attribute from DUT" + command: "readAttribute" + attribute: "EventList" + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_INKCREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_INKCREMON_2_1.yaml new file mode 100644 index 00000000000000..d8676631fb5b93 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_INKCREMON_2_1.yaml @@ -0,0 +1,71 @@ +# 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: 165.2.1. [TC-INKCREMON-2.1] Attributes with server as DUT + +PICS: + - INKCREMON.S + +config: + nodeId: 0x12344321 + cluster: "Ink Cartridge Monitoring" + # todo: is this correctly spelled? + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the Condition attribute." + PICS: INKCREMON.S.A0000 + command: "readAttribute" + attribute: "Condition" + response: + constraints: + type: percent + minValue: 0 + maxValue: 100 + + - label: "TH reads from the DUT the DegradationDirection attribute.." + PICS: INKCREMON.S.A0001 + command: "readAttribute" + attribute: "DegradationDirection" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 1 + + - label: "TH reads from the DUT the ChangeIndication attribute." + PICS: INKCREMON.S.A0002 + command: "readAttribute" + attribute: "ChangeIndication" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the InPlaceIndicator attribute" + PICS: INKCREMON.S.A0003 + command: "readAttribute" + attribute: "InPlaceIndicator" + response: + constraints: + type: boolean \ No newline at end of file diff --git a/src/app/tests/suites/certification/Test_TC_IONFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_IONFREMON_1_1.yaml new file mode 100644 index 00000000000000..35d13629c036d4 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_IONFREMON_1_1.yaml @@ -0,0 +1,108 @@ +# 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: 165.1.1. [TC-IONFREMON-1.1] Global Attributes with DUT as Server + +PICS: + - IONFREMON.S + +config: + nodeId: 0x12344321 + cluster: "Ionizing Filter Monitoring" + 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 + constraints: + type: int16u + + - label: "Read the global attribute: FeatureMap" + command: "readAttribute" + attribute: "FeatureMap" + PICS: " !IONFREMON.S.F00 && !IONFREMON.S.F01" + response: + value: 0 + constraints: + type: bitmap32 + + - label: "Given IONFREMON.S.F00(Condition) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: IONFREMON.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: "Given IONFREMON.S.F01(Warning) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: IONFREMON.S.F01 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Read the feature dependent(IONFREMON.S.F00) attribute in AttributeList" + PICS: IONFREMON.S.F00 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [0, 1] + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [] + + - label: "Read the global attribute: GeneratedCommandList" + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + value: [] + constraints: + type: list + + - label: "TH reads EventList attribute from DUT" + command: "readAttribute" + attribute: "EventList" + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_IONFREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_IONFREMON_2_1.yaml new file mode 100644 index 00000000000000..5b8525c16de43a --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_IONFREMON_2_1.yaml @@ -0,0 +1,71 @@ +# 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: 165.2.1. [TC-IONFREMON-2.1] Attributes with server as DUT + +PICS: + - IONFREMON.S + +config: + nodeId: 0x12344321 + cluster: "Ionizing Filter Monitoring" + # todo: is this correctly spelled? + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the Condition attribute." + PICS: IONFREMON.S.A0000 + command: "readAttribute" + attribute: "Condition" + response: + constraints: + type: percent + minValue: 0 + maxValue: 100 + + - label: "TH reads from the DUT the DegradationDirection attribute.." + PICS: IONFREMON.S.A0001 + command: "readAttribute" + attribute: "DegradationDirection" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 1 + + - label: "TH reads from the DUT the ChangeIndication attribute." + PICS: IONFREMON.S.A0002 + command: "readAttribute" + attribute: "ChangeIndication" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the InPlaceIndicator attribute" + PICS: IONFREMON.S.A0003 + command: "readAttribute" + attribute: "InPlaceIndicator" + response: + constraints: + type: boolean \ No newline at end of file diff --git a/src/app/tests/suites/certification/Test_TC_OZFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_OZFREMON_1_1.yaml new file mode 100644 index 00000000000000..678707ddcea69a --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_OZFREMON_1_1.yaml @@ -0,0 +1,108 @@ +# 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: 165.1.1. [TC-OZFREMON-1.1] Global Attributes with DUT as Server + +PICS: + - OZFREMON.S + +config: + nodeId: 0x12344321 + cluster: "Ozone Filter Monitoring" + 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 + constraints: + type: int16u + + - label: "Read the global attribute: FeatureMap" + command: "readAttribute" + attribute: "FeatureMap" + PICS: " !OZFREMON.S.F00 && !OZFREMON.S.F01" + response: + value: 0 + constraints: + type: bitmap32 + + - label: "Given OZFREMON.S.F00(Condition) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: OZFREMON.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: "Given OZFREMON.S.F01(Warning) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: OZFREMON.S.F01 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Read the feature dependent(OZFREMON.S.F00) attribute in AttributeList" + PICS: OZFREMON.S.F00 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [0, 1] + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [] + + - label: "Read the global attribute: GeneratedCommandList" + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + value: [] + constraints: + type: list + + - label: "TH reads EventList attribute from DUT" + command: "readAttribute" + attribute: "EventList" + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_OZFREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_OZFREMON_2_1.yaml new file mode 100644 index 00000000000000..6c5c7807f49275 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_OZFREMON_2_1.yaml @@ -0,0 +1,71 @@ +# 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: 165.2.1. [TC-OZFREMON-2.1] Attributes with server as DUT + +PICS: + - OZFREMON.S + +config: + nodeId: 0x12344321 + cluster: "Ozone Filter Monitoring" + # todo: is this correctly spelled? + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the Condition attribute." + PICS: OZFREMON.S.A0000 + command: "readAttribute" + attribute: "Condition" + response: + constraints: + type: percent + minValue: 0 + maxValue: 100 + + - label: "TH reads from the DUT the DegradationDirection attribute.." + PICS: OZFREMON.S.A0001 + command: "readAttribute" + attribute: "DegradationDirection" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 1 + + - label: "TH reads from the DUT the ChangeIndication attribute." + PICS: OZFREMON.S.A0002 + command: "readAttribute" + attribute: "ChangeIndication" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the InPlaceIndicator attribute" + PICS: OZFREMON.S.A0003 + command: "readAttribute" + attribute: "InPlaceIndicator" + response: + constraints: + type: boolean \ No newline at end of file diff --git a/src/app/tests/suites/certification/Test_TC_TCREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_TCREMON_1_1.yaml new file mode 100644 index 00000000000000..02fb9cbeb78ee9 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_TCREMON_1_1.yaml @@ -0,0 +1,108 @@ +# 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: 165.1.1. [TC-TCREMON-1.1] Global Attributes with DUT as Server + +PICS: + - TCREMON.S + +config: + nodeId: 0x12344321 + cluster: "Toner Cartridge Monitoring" + 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 + constraints: + type: int16u + + - label: "Read the global attribute: FeatureMap" + command: "readAttribute" + attribute: "FeatureMap" + PICS: " !TCREMON.S.F00 && !TCREMON.S.F01" + response: + value: 0 + constraints: + type: bitmap32 + + - label: "Given TCREMON.S.F00(Condition) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: TCREMON.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: "Given TCREMON.S.F01(Warning) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: TCREMON.S.F01 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Read the feature dependent(TCREMON.S.F00) attribute in AttributeList" + PICS: TCREMON.S.F00 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [0, 1] + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [] + + - label: "Read the global attribute: GeneratedCommandList" + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + value: [] + constraints: + type: list + + - label: "TH reads EventList attribute from DUT" + command: "readAttribute" + attribute: "EventList" + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_TCREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_TCREMON_2_1.yaml new file mode 100644 index 00000000000000..36ce1db8405dd0 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_TCREMON_2_1.yaml @@ -0,0 +1,71 @@ +# 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: 165.2.1. [TC-TCREMON-2.1] Attributes with server as DUT + +PICS: + - TCREMON.S + +config: + nodeId: 0x12344321 + cluster: "Toner Cartridge Monitoring" + # todo: is this correctly spelled? + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the Condition attribute." + PICS: TCREMON.S.A0000 + command: "readAttribute" + attribute: "Condition" + response: + constraints: + type: percent + minValue: 0 + maxValue: 100 + + - label: "TH reads from the DUT the DegradationDirection attribute.." + PICS: TCREMON.S.A0001 + command: "readAttribute" + attribute: "DegradationDirection" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 1 + + - label: "TH reads from the DUT the ChangeIndication attribute." + PICS: TCREMON.S.A0002 + command: "readAttribute" + attribute: "ChangeIndication" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the InPlaceIndicator attribute" + PICS: TCREMON.S.A0003 + command: "readAttribute" + attribute: "InPlaceIndicator" + response: + constraints: + type: boolean \ No newline at end of file diff --git a/src/app/tests/suites/certification/Test_TC_UVFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_UVFREMON_1_1.yaml new file mode 100644 index 00000000000000..93a14b30200473 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_UVFREMON_1_1.yaml @@ -0,0 +1,108 @@ +# 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: 165.1.1. [TC-UVFREMON-1.1] Global Attributes with DUT as Server + +PICS: + - UVFREMON.S + +config: + nodeId: 0x12344321 + cluster: "UV Filter Monitoring" + 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 + constraints: + type: int16u + + - label: "Read the global attribute: FeatureMap" + command: "readAttribute" + attribute: "FeatureMap" + PICS: " !UVFREMON.S.F00 && !UVFREMON.S.F01" + response: + value: 0 + constraints: + type: bitmap32 + + - label: "Given UVFREMON.S.F00(Condition) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: UVFREMON.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: "Given UVFREMON.S.F01(Warning) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: UVFREMON.S.F01 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Read the feature dependent(UVFREMON.S.F00) attribute in AttributeList" + PICS: UVFREMON.S.F00 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [0, 1] + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [] + + - label: "Read the global attribute: GeneratedCommandList" + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + value: [] + constraints: + type: list + + - label: "TH reads EventList attribute from DUT" + command: "readAttribute" + attribute: "EventList" + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_UVFREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_UVFREMON_2_1.yaml new file mode 100644 index 00000000000000..157bd4c42994b6 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_UVFREMON_2_1.yaml @@ -0,0 +1,71 @@ +# 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: 165.2.1. [TC-UVFREMON-2.1] Attributes with server as DUT + +PICS: + - UVFREMON.S + +config: + nodeId: 0x12344321 + cluster: "UV Filter Monitoring" + # todo: is this correctly spelled? + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the Condition attribute." + PICS: UVFREMON.S.A0000 + command: "readAttribute" + attribute: "Condition" + response: + constraints: + type: percent + minValue: 0 + maxValue: 100 + + - label: "TH reads from the DUT the DegradationDirection attribute.." + PICS: UVFREMON.S.A0001 + command: "readAttribute" + attribute: "DegradationDirection" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 1 + + - label: "TH reads from the DUT the ChangeIndication attribute." + PICS: UVFREMON.S.A0002 + command: "readAttribute" + attribute: "ChangeIndication" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the InPlaceIndicator attribute" + PICS: UVFREMON.S.A0003 + command: "readAttribute" + attribute: "InPlaceIndicator" + response: + constraints: + type: boolean \ No newline at end of file diff --git a/src/app/tests/suites/certification/Test_TC_WTREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_WTREMON_1_1.yaml new file mode 100644 index 00000000000000..ef5097cf59dcc4 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_WTREMON_1_1.yaml @@ -0,0 +1,108 @@ +# 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: 165.1.1. [TC-WTREMON-1.1] Global Attributes with DUT as Server + +PICS: + - WTREMON.S + +config: + nodeId: 0x12344321 + cluster: "Water Tank Monitoring" + 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 + constraints: + type: int16u + + - label: "Read the global attribute: FeatureMap" + command: "readAttribute" + attribute: "FeatureMap" + PICS: " !WTREMON.S.F00 && !WTREMON.S.F01" + response: + value: 0 + constraints: + type: bitmap32 + + - label: "Given WTREMON.S.F00(Condition) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: WTREMON.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: "Given WTREMON.S.F01(Warning) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: WTREMON.S.F01 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Read the feature dependent(WTREMON.S.F00) attribute in AttributeList" + PICS: WTREMON.S.F00 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [0, 1] + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [] + + - label: "Read the global attribute: GeneratedCommandList" + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + value: [] + constraints: + type: list + + - label: "TH reads EventList attribute from DUT" + command: "readAttribute" + attribute: "EventList" + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_WTREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_WTREMON_2_1.yaml new file mode 100644 index 00000000000000..619351813e59ef --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_WTREMON_2_1.yaml @@ -0,0 +1,71 @@ +# 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: 165.2.1. [TC-WTREMON-2.1] Attributes with server as DUT + +PICS: + - WTREMON.S + +config: + nodeId: 0x12344321 + cluster: "Water Tank Monitoring" + # todo: is this correctly spelled? + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the Condition attribute." + PICS: WTREMON.S.A0000 + command: "readAttribute" + attribute: "Condition" + response: + constraints: + type: percent + minValue: 0 + maxValue: 100 + + - label: "TH reads from the DUT the DegradationDirection attribute.." + PICS: WTREMON.S.A0001 + command: "readAttribute" + attribute: "DegradationDirection" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 1 + + - label: "TH reads from the DUT the ChangeIndication attribute." + PICS: WTREMON.S.A0002 + command: "readAttribute" + attribute: "ChangeIndication" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the InPlaceIndicator attribute" + PICS: WTREMON.S.A0003 + command: "readAttribute" + attribute: "InPlaceIndicator" + response: + constraints: + type: boolean \ No newline at end of file diff --git a/src/app/tests/suites/certification/Test_TC_ZEOFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_ZEOFREMON_1_1.yaml new file mode 100644 index 00000000000000..adf36147e3ca46 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_ZEOFREMON_1_1.yaml @@ -0,0 +1,108 @@ +# 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: 165.1.1. [TC-ZEOFREMON-1.1] Global Attributes with DUT as Server + +PICS: + - ZEOFREMON.S + +config: + nodeId: 0x12344321 + cluster: "Zeolite Filter Monitoring" + 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 + constraints: + type: int16u + + - label: "Read the global attribute: FeatureMap" + command: "readAttribute" + attribute: "FeatureMap" + PICS: " !ZEOFREMON.S.F00 && !ZEOFREMON.S.F01" + response: + value: 0 + constraints: + type: bitmap32 + + - label: "Given ZEOFREMON.S.F00(Condition) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: ZEOFREMON.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: "Given ZEOFREMON.S.F01(Warning) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: ZEOFREMON.S.F01 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Read the feature dependent(ZEOFREMON.S.F00) attribute in AttributeList" + PICS: ZEOFREMON.S.F00 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [0, 1] + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [] + + - label: "Read the global attribute: GeneratedCommandList" + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + value: [] + constraints: + type: list + + - label: "TH reads EventList attribute from DUT" + command: "readAttribute" + attribute: "EventList" + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_ZEOFREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_ZEOFREMON_2_1.yaml new file mode 100644 index 00000000000000..02c833c6683917 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_ZEOFREMON_2_1.yaml @@ -0,0 +1,71 @@ +# 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: 165.2.1. [TC-ZEOFREMON-2.1] Attributes with server as DUT + +PICS: + - ZEOFREMON.S + +config: + nodeId: 0x12344321 + cluster: "Zeolite Filter Monitoring" + # todo: is this correctly spelled? + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the Condition attribute." + PICS: ZEOFREMON.S.A0000 + command: "readAttribute" + attribute: "Condition" + response: + constraints: + type: percent + minValue: 0 + maxValue: 100 + + - label: "TH reads from the DUT the DegradationDirection attribute.." + PICS: ZEOFREMON.S.A0001 + command: "readAttribute" + attribute: "DegradationDirection" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 1 + + - label: "TH reads from the DUT the ChangeIndication attribute." + PICS: ZEOFREMON.S.A0002 + command: "readAttribute" + attribute: "ChangeIndication" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the InPlaceIndicator attribute" + PICS: ZEOFREMON.S.A0003 + command: "readAttribute" + attribute: "InPlaceIndicator" + response: + constraints: + type: boolean \ No newline at end of file From 5b72a8697b7dc96dd07843b8d06608e5c21af491 Mon Sep 17 00:00:00 2001 From: Graf Tobias <4622393+tobiasgraf@users.noreply.github.com> Date: Fri, 26 May 2023 14:00:23 +0200 Subject: [PATCH 04/16] Update ciTests.json and PICS.yaml --- src/app/tests/suites/certification/PICS.yaml | 372 +++++++++++++++++++ src/app/tests/suites/ciTests.json | 29 +- 2 files changed, 400 insertions(+), 1 deletion(-) diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index 56aea7c1c2416d..4e5183ad78b947 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -3751,6 +3751,378 @@ PICS: AddGroupIfIdentifying Command?" id: G.C.C05.Tx + # HEPA Filter Monitoring Cluster Test Plan + - label: "Does the device implement the HEPA Filter Monitoring cluster as a server?" + id: HEPAFREMON.S + + - label: "Does the device implement the HEPA Filter Monitoring cluster as a client?" + id: HEPAFREMON.C + + # + # server / attributes + # + - label: "Does the device implement the Condition attribute?" + id: HEPAFREMON.S.A0000 + + - label: "Does the device implement the DegradationDirection attribute?" + id: HEPAFREMON.S.A0001 + + - label: "Does the device implement the ChangeIndication attribute?" + id: HEPAFREMON.S.A0002 + + - label: "Does the device implement the InPlaceIndicator attribute?" + id: HEPAFREMON.S.A0003 + + # + # server / features + # + - label: "Does the device support the Condition feature?" + id: HEPAFREMON.S.F00 + + - label: "Does the device support the Warning feature?" + id: HEPAFREMON.S.F01 + + # Activated Carbon Filter Monitoring Cluster Test Plan + - label: "Does the device implement the Activated Carbon Filter Monitoring cluster as a server?" + id: ACFREMON.S + + - label: "Does the device implement the Activated Carbon Filter Monitoring cluster as a client?" + id: ACFREMON.C + + # + # server / attributes + # + - label: "Does the device implement the Condition attribute?" + id: ACFREMON.S.A0000 + + - label: "Does the device implement the DegradationDirection attribute?" + id: ACFREMON.S.A0001 + + - label: "Does the device implement the ChangeIndication attribute?" + id: ACFREMON.S.A0002 + + - label: "Does the device implement the InPlaceIndicator attribute?" + id: ACFREMON.S.A0003 + + # + # server / features + # + - label: "Does the device support the Condition feature?" + id: ACFREMON.S.F00 + + - label: "Does the device support the Warning feature?" + id: ACFREMON.S.F01 + + # Ceramic Filter Monitoring Cluster Test Plan + - label: "Does the device implement the Ceramic Filter Monitoring cluster as a server?" + id: CFREMON.S + + - label: "Does the device implement the Ceramic Filter Monitoring cluster as a client?" + id: CFREMON.C + + # + # server / attributes + # + - label: "Does the device implement the Condition attribute?" + id: CFREMON.S.A0000 + + - label: "Does the device implement the DegradationDirection attribute?" + id: CFREMON.S.A0001 + + - label: "Does the device implement the ChangeIndication attribute?" + id: CFREMON.S.A0002 + + - label: "Does the device implement the InPlaceIndicator attribute?" + id: CFREMON.S.A0003 + + # + # server / features + # + - label: "Does the device support the Condition feature?" + id: CFREMON.S.F00 + + - label: "Does the device support the Warning feature?" + id: CFREMON.S.F01 + + # Electrostatic Filter Monitoring Cluster Test Plan + - label: "Does the device implement the Electrostatic Filter Monitoring cluster as a server?" + id: ESFREMON.S + + - label: "Does the device implement the Electrostatic Filter Monitoring cluster as a client?" + id: ESFREMON.C + + # + # server / attributes + # + - label: "Does the device implement the Condition attribute?" + id: ESFREMON.S.A0000 + + - label: "Does the device implement the DegradationDirection attribute?" + id: ESFREMON.S.A0001 + + - label: "Does the device implement the ChangeIndication attribute?" + id: ESFREMON.S.A0002 + + - label: "Does the device implement the InPlaceIndicator attribute?" + id: ESFREMON.S.A0003 + + # + # server / features + # + - label: "Does the device support the Condition feature?" + id: ESFREMON.S.F00 + + - label: "Does the device support the Warning feature?" + id: ESFREMON.S.F01 + + # Fuel Tank Monitoring Cluster Test Plan + - label: "Does the device implement the Fuel Tank Monitoring cluster as a server?" + id: FTREMON.S + + - label: "Does the device implement the Fuel Tank Monitoring cluster as a client?" + id: FTREMON.C + + # + # server / attributes + # + - label: "Does the device implement the Condition attribute?" + id: FTREMON.S.A0000 + + - label: "Does the device implement the DegradationDirection attribute?" + id: FTREMON.S.A0001 + + - label: "Does the device implement the ChangeIndication attribute?" + id: FTREMON.S.A0002 + + - label: "Does the device implement the InPlaceIndicator attribute?" + id: FTREMON.S.A0003 + + # + # server / features + # + - label: "Does the device support the Condition feature?" + id: FTREMON.S.F00 + + - label: "Does the device support the Warning feature?" + id: FTREMON.S.F01 + + # Ink Cartridge Monitoring Cluster Test Plan + - label: "Does the device implement the Ink Cartridge Monitoring cluster as a server?" + id: INKCREMON.S + + - label: "Does the device implement the Ink Cartridge Monitoring cluster as a client?" + id: INKCREMON.C + + # + # server / attributes + # + - label: "Does the device implement the Condition attribute?" + id: INKCREMON.S.A0000 + + - label: "Does the device implement the DegradationDirection attribute?" + id: INKCREMON.S.A0001 + + - label: "Does the device implement the ChangeIndication attribute?" + id: INKCREMON.S.A0002 + + - label: "Does the device implement the InPlaceIndicator attribute?" + id: INKCREMON.S.A0003 + + # + # server / features + # + - label: "Does the device support the Condition feature?" + id: INKCREMON.S.F00 + + - label: "Does the device support the Warning feature?" + id: INKCREMON.S.F01 + + # Ionizing Filter Monitoring Cluster Test Plan + - label: "Does the device implement the Ionizing Filter Monitoring cluster as a server?" + id: IONFREMON.S + + - label: "Does the device implement the Ionizing Filter Monitoring cluster as a client?" + id: IONFREMON.C + + # + # server / attributes + # + - label: "Does the device implement the Condition attribute?" + id: IONFREMON.S.A0000 + + - label: "Does the device implement the DegradationDirection attribute?" + id: IONFREMON.S.A0001 + + - label: "Does the device implement the ChangeIndication attribute?" + id: IONFREMON.S.A0002 + + - label: "Does the device implement the InPlaceIndicator attribute?" + id: IONFREMON.S.A0003 + + # + # server / features + # + - label: "Does the device support the Condition feature?" + id: IONFREMON.S.F00 + + - label: "Does the device support the Warning feature?" + id: IONFREMON.S.F01 + + # Ozone Filter Monitoring Cluster Test Plan + - label: "Does the device implement the Ozone Filter Monitoring cluster as a server?" + id: OZFREMON.S + + - label: "Does the device implement the Ozone Filter Monitoring cluster as a client?" + id: OZFREMON.C + + # + # server / attributes + # + - label: "Does the device implement the Condition attribute?" + id: OZFREMON.S.A0000 + + - label: "Does the device implement the DegradationDirection attribute?" + id: OZFREMON.S.A0001 + + - label: "Does the device implement the ChangeIndication attribute?" + id: OZFREMON.S.A0002 + + - label: "Does the device implement the InPlaceIndicator attribute?" + id: OZFREMON.S.A0003 + + # + # server / features + # + - label: "Does the device support the Condition feature?" + id: OZFREMON.S.F00 + + - label: "Does the device support the Warning feature?" + id: OZFREMON.S.F01 + + # Toner Cartridge Monitoring Cluster Test Plan + - label: "Does the device implement the Toner Cartridge Monitoring cluster as a server?" + id: TCREMON.S + + - label: "Does the device implement the Toner Cartridge Monitoring cluster as a client?" + id: TCREMON.C + + # + # server / attributes + # + - label: "Does the device implement the Condition attribute?" + id: TCREMON.S.A0000 + + - label: "Does the device implement the DegradationDirection attribute?" + id: TCREMON.S.A0001 + + - label: "Does the device implement the ChangeIndication attribute?" + id: TCREMON.S.A0002 + + - label: "Does the device implement the InPlaceIndicator attribute?" + id: TCREMON.S.A0003 + + # + # server / features + # + - label: "Does the device support the Condition feature?" + id: TCREMON.S.F00 + + - label: "Does the device support the Warning feature?" + id: TCREMON.S.F01 + + # UV Filter Monitoring Cluster Test Plan + - label: "Does the device implement the UV Filter Monitoring cluster as a server?" + id: UVFREMON.S + + - label: "Does the device implement the UV Filter Monitoring cluster as a client?" + id: UVFREMON.C + + # + # server / attributes + # + - label: "Does the device implement the Condition attribute?" + id: UVFREMON.S.A0000 + + - label: "Does the device implement the DegradationDirection attribute?" + id: UVFREMON.S.A0001 + + - label: "Does the device implement the ChangeIndication attribute?" + id: UVFREMON.S.A0002 + + - label: "Does the device implement the InPlaceIndicator attribute?" + id: UVFREMON.S.A0003 + + # + # server / features + # + - label: "Does the device support the Condition feature?" + id: UVFREMON.S.F00 + + - label: "Does the device support the Warning feature?" + id: UVFREMON.S.F01 + + # Water Tank Monitoring Cluster Test Plan + - label: "Does the device implement the Water Tank Monitoring cluster as a server?" + id: WTREMON.S + + - label: "Does the device implement the Water Tank Monitoring cluster as a client?" + id: WTREMON.C + + # + # server / attributes + # + - label: "Does the device implement the Condition attribute?" + id: WTREMON.S.A0000 + + - label: "Does the device implement the DegradationDirection attribute?" + id: WTREMON.S.A0001 + + - label: "Does the device implement the ChangeIndication attribute?" + id: WTREMON.S.A0002 + + - label: "Does the device implement the InPlaceIndicator attribute?" + id: WTREMON.S.A0003 + + # + # server / features + # + - label: "Does the device support the Condition feature?" + id: WTREMON.S.F00 + + - label: "Does the device support the Warning feature?" + id: WTREMON.S.F01 + + # Zeolite Filter Monitoring Cluster Test Plan + - label: "Does the device implement the Zeolite Filter Monitoring cluster as a server?" + id: ZEOFREMON.S + + - label: "Does the device implement the Zeolite Filter Monitoring cluster as a client?" + id: ZEOFREMON.C + + # + # server / attributes + # + - label: "Does the device implement the Condition attribute?" + id: ZEOFREMON.S.A0000 + + - label: "Does the device implement the DegradationDirection attribute?" + id: ZEOFREMON.S.A0001 + + - label: "Does the device implement the ChangeIndication attribute?" + id: ZEOFREMON.S.A0002 + + - label: "Does the device implement the InPlaceIndicator attribute?" + id: ZEOFREMON.S.A0003 + + # + # server / features + # + - label: "Does the device support the Condition feature?" + id: ZEOFREMON.S.F00 + + - label: "Does the device support the Warning feature?" + id: ZEOFREMON.S.F01 + # Identify Cluster Test Plan - label: "Does the device implement the Identify cluster as a server?" id: I.S diff --git a/src/app/tests/suites/ciTests.json b/src/app/tests/suites/ciTests.json index f552cecf1cb2d4..bef648f4d6a337 100644 --- a/src/app/tests/suites/ciTests.json +++ b/src/app/tests/suites/ciTests.json @@ -272,6 +272,32 @@ "Test_TC_G_2_1" ], "Scenes": ["Test_TC_S_1_1"], + "ReplaceableMonitoring": [ + "Test_TC_ACFREMON_1_1", + "Test_TC_ACFREMON_2_1", + "Test_TC_CFREMON_1_1", + "Test_TC_CFREMON_2_1", + "Test_TC_ESFREMON_1_1", + "Test_TC_ESFREMON_2_1", + "Test_TC_FTREMON_1_1", + "Test_TC_FTREMON_2_1", + "Test_TC_HEPAFREMON_1_1", + "Test_TC_HEPAFREMON_2_1", + "Test_TC_INKCREMON_1_1", + "Test_TC_INKCREMON_2_1", + "Test_TC_IONFREMON_1_1", + "Test_TC_IONFREMON_2_1", + "Test_TC_OZFREMON_1_1", + "Test_TC_OZFREMON_2_1", + "Test_TC_TCREMON_1_1", + "Test_TC_TCREMON_2_1", + "Test_TC_UVFREMON_1_1", + "Test_TC_UVFREMON_2_1", + "Test_TC_WTREMON_1_1", + "Test_TC_WTREMON_2_1", + "Test_TC_ZEOFREMON_1_1", + "Test_TC_ZEOFREMON_2_1" + ], "collection": [ "AccessControl", "AccessControlEnforcement", @@ -320,6 +346,7 @@ "SoftwareDiagnostics", "Subscriptions", "DoorLock", - "Groups" + "Groups", + "ReplaceableMonitoring" ] } From d17d79ca3798127c02a1274e22f6f8fe03040762 Mon Sep 17 00:00:00 2001 From: Graf Tobias <4622393+tobiasgraf@users.noreply.github.com> Date: Fri, 26 May 2023 14:00:53 +0200 Subject: [PATCH 05/16] Update generated code --- .../chip-tool/zap-generated/test/Commands.h | 4128 +++++++++ .../zap-generated/test/Commands.h | 7356 +++++++++++++++++ 2 files changed, 11484 insertions(+) diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 688b47fe0e9a2d..0347678e40f2c4 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -271,6 +271,30 @@ class TestList : public Command printf("TestGroupKeyManagementCluster\n"); printf("Test_TC_G_1_1\n"); printf("Test_TC_G_2_1\n"); + printf("Test_TC_ACFREMON_1_1\n"); + printf("Test_TC_ACFREMON_2_1\n"); + printf("Test_TC_CFREMON_1_1\n"); + printf("Test_TC_CFREMON_2_1\n"); + printf("Test_TC_ESFREMON_1_1\n"); + printf("Test_TC_ESFREMON_2_1\n"); + printf("Test_TC_FTREMON_1_1\n"); + printf("Test_TC_FTREMON_2_1\n"); + printf("Test_TC_HEPAFREMON_1_1\n"); + printf("Test_TC_HEPAFREMON_2_1\n"); + printf("Test_TC_INKCREMON_1_1\n"); + printf("Test_TC_INKCREMON_2_1\n"); + printf("Test_TC_IONFREMON_1_1\n"); + printf("Test_TC_IONFREMON_2_1\n"); + printf("Test_TC_OZFREMON_1_1\n"); + printf("Test_TC_OZFREMON_2_1\n"); + printf("Test_TC_TCREMON_1_1\n"); + printf("Test_TC_TCREMON_2_1\n"); + printf("Test_TC_UVFREMON_1_1\n"); + printf("Test_TC_UVFREMON_2_1\n"); + printf("Test_TC_WTREMON_1_1\n"); + printf("Test_TC_WTREMON_2_1\n"); + printf("Test_TC_ZEOFREMON_1_1\n"); + printf("Test_TC_ZEOFREMON_2_1\n"); return CHIP_NO_ERROR; } @@ -95679,6 +95703,4086 @@ class Test_TC_G_2_1Suite : public TestCommand } }; +class Test_TC_ACFREMON_1_1Suite : public TestCommand +{ +public: + Test_TC_ACFREMON_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_ACFREMON_1_1", 10, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ACFREMON_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip(" !ACFREMON.S.F00 && !ACFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Given ACFREMON.S.F00(Condition) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("ACFREMON.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Given ACFREMON.S.F01(Warning) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("ACFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Read the global attribute: AttributeList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Read the feature dependent(ACFREMON.S.F00) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("ACFREMON.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads EventList attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::EventList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ACFREMON_2_1Suite : public TestCommand +{ +public: + Test_TC_ACFREMON_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_ACFREMON_2_1", 5, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ACFREMON_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::Percent value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "percent", "percent")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 100U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ActivatedCarbonFilterMonitoring::DegradationDirectionEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ActivatedCarbonFilterMonitoring::ChangeIndicationEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the Condition attribute."); + VerifyOrDo(!ShouldSkip("ACFREMON.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::Condition::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the DegradationDirection attribute.."); + VerifyOrDo(!ShouldSkip("ACFREMON.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::DegradationDirection::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the ChangeIndication attribute."); + VerifyOrDo(!ShouldSkip("ACFREMON.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::ChangeIndication::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the InPlaceIndicator attribute"); + VerifyOrDo(!ShouldSkip("ACFREMON.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::InPlaceIndicator::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CFREMON_1_1Suite : public TestCommand +{ +public: + Test_TC_CFREMON_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CFREMON_1_1", 10, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CFREMON_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CeramicFilterMonitoring::Id, + CeramicFilterMonitoring::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip(" !CFREMON.S.F00 && !CFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CeramicFilterMonitoring::Id, + CeramicFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Given CFREMON.S.F00(Condition) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("CFREMON.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CeramicFilterMonitoring::Id, + CeramicFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Given CFREMON.S.F01(Warning) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("CFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CeramicFilterMonitoring::Id, + CeramicFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Read the global attribute: AttributeList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CeramicFilterMonitoring::Id, + CeramicFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Read the feature dependent(CFREMON.S.F00) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("CFREMON.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CeramicFilterMonitoring::Id, + CeramicFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CeramicFilterMonitoring::Id, + CeramicFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CeramicFilterMonitoring::Id, + CeramicFilterMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads EventList attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CeramicFilterMonitoring::Id, + CeramicFilterMonitoring::Attributes::EventList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CFREMON_2_1Suite : public TestCommand +{ +public: + Test_TC_CFREMON_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CFREMON_2_1", 5, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CFREMON_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::Percent value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "percent", "percent")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 100U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CeramicFilterMonitoring::DegradationDirectionEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CeramicFilterMonitoring::ChangeIndicationEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the Condition attribute."); + VerifyOrDo(!ShouldSkip("CFREMON.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CeramicFilterMonitoring::Id, + CeramicFilterMonitoring::Attributes::Condition::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the DegradationDirection attribute.."); + VerifyOrDo(!ShouldSkip("CFREMON.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CeramicFilterMonitoring::Id, + CeramicFilterMonitoring::Attributes::DegradationDirection::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the ChangeIndication attribute."); + VerifyOrDo(!ShouldSkip("CFREMON.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CeramicFilterMonitoring::Id, + CeramicFilterMonitoring::Attributes::ChangeIndication::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the InPlaceIndicator attribute"); + VerifyOrDo(!ShouldSkip("CFREMON.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CeramicFilterMonitoring::Id, + CeramicFilterMonitoring::Attributes::InPlaceIndicator::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ESFREMON_1_1Suite : public TestCommand +{ +public: + Test_TC_ESFREMON_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_ESFREMON_1_1", 10, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ESFREMON_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ElectrostaticFilterMonitoring::Id, + ElectrostaticFilterMonitoring::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip(" !ESFREMON.S.F00 && !ESFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ElectrostaticFilterMonitoring::Id, + ElectrostaticFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Given ESFREMON.S.F00(Condition) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("ESFREMON.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ElectrostaticFilterMonitoring::Id, + ElectrostaticFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Given ESFREMON.S.F01(Warning) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("ESFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ElectrostaticFilterMonitoring::Id, + ElectrostaticFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Read the global attribute: AttributeList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ElectrostaticFilterMonitoring::Id, + ElectrostaticFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Read the feature dependent(ESFREMON.S.F00) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("ESFREMON.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ElectrostaticFilterMonitoring::Id, + ElectrostaticFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ElectrostaticFilterMonitoring::Id, + ElectrostaticFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ElectrostaticFilterMonitoring::Id, + ElectrostaticFilterMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads EventList attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ElectrostaticFilterMonitoring::Id, + ElectrostaticFilterMonitoring::Attributes::EventList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ESFREMON_2_1Suite : public TestCommand +{ +public: + Test_TC_ESFREMON_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_ESFREMON_2_1", 5, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ESFREMON_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::Percent value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "percent", "percent")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 100U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ElectrostaticFilterMonitoring::DegradationDirectionEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ElectrostaticFilterMonitoring::ChangeIndicationEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the Condition attribute."); + VerifyOrDo(!ShouldSkip("ESFREMON.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ElectrostaticFilterMonitoring::Id, + ElectrostaticFilterMonitoring::Attributes::Condition::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the DegradationDirection attribute.."); + VerifyOrDo(!ShouldSkip("ESFREMON.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ElectrostaticFilterMonitoring::Id, + ElectrostaticFilterMonitoring::Attributes::DegradationDirection::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the ChangeIndication attribute."); + VerifyOrDo(!ShouldSkip("ESFREMON.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ElectrostaticFilterMonitoring::Id, + ElectrostaticFilterMonitoring::Attributes::ChangeIndication::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the InPlaceIndicator attribute"); + VerifyOrDo(!ShouldSkip("ESFREMON.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ElectrostaticFilterMonitoring::Id, + ElectrostaticFilterMonitoring::Attributes::InPlaceIndicator::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_FTREMON_1_1Suite : public TestCommand +{ +public: + Test_TC_FTREMON_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_FTREMON_1_1", 10, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_FTREMON_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FuelTankMonitoring::Id, + FuelTankMonitoring::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip(" !FTREMON.S.F00 && !FTREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FuelTankMonitoring::Id, + FuelTankMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Given FTREMON.S.F00(Condition) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("FTREMON.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FuelTankMonitoring::Id, + FuelTankMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Given FTREMON.S.F01(Warning) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("FTREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FuelTankMonitoring::Id, + FuelTankMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Read the global attribute: AttributeList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FuelTankMonitoring::Id, + FuelTankMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Read the feature dependent(FTREMON.S.F00) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("FTREMON.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FuelTankMonitoring::Id, + FuelTankMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FuelTankMonitoring::Id, + FuelTankMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FuelTankMonitoring::Id, + FuelTankMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads EventList attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FuelTankMonitoring::Id, + FuelTankMonitoring::Attributes::EventList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_FTREMON_2_1Suite : public TestCommand +{ +public: + Test_TC_FTREMON_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_FTREMON_2_1", 5, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_FTREMON_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::Percent value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "percent", "percent")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 100U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::FuelTankMonitoring::DegradationDirectionEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::FuelTankMonitoring::ChangeIndicationEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the Condition attribute."); + VerifyOrDo(!ShouldSkip("FTREMON.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FuelTankMonitoring::Id, + FuelTankMonitoring::Attributes::Condition::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the DegradationDirection attribute.."); + VerifyOrDo(!ShouldSkip("FTREMON.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FuelTankMonitoring::Id, + FuelTankMonitoring::Attributes::DegradationDirection::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the ChangeIndication attribute."); + VerifyOrDo(!ShouldSkip("FTREMON.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FuelTankMonitoring::Id, + FuelTankMonitoring::Attributes::ChangeIndication::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the InPlaceIndicator attribute"); + VerifyOrDo(!ShouldSkip("FTREMON.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FuelTankMonitoring::Id, + FuelTankMonitoring::Attributes::InPlaceIndicator::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_HEPAFREMON_1_1Suite : public TestCommand +{ +public: + Test_TC_HEPAFREMON_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_HEPAFREMON_1_1", 10, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_HEPAFREMON_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip(" !HEPAFREMON.S.F00 && !HEPAFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Given HEPAFREMON.S.F00(Condition) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("HEPAFREMON.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Given HEPAFREMON.S.F01(Warning) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("HEPAFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Read the global attribute: AttributeList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Read the feature dependent(HEPAFREMON.S.F00) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("HEPAFREMON.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads EventList attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::EventList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_HEPAFREMON_2_1Suite : public TestCommand +{ +public: + Test_TC_HEPAFREMON_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_HEPAFREMON_2_1", 5, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_HEPAFREMON_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::Percent value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "percent", "percent")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 100U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::HepaFilterMonitoring::DegradationDirectionEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::HepaFilterMonitoring::ChangeIndicationEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the Condition attribute."); + VerifyOrDo(!ShouldSkip("HEPAFREMON.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::Condition::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the DegradationDirection attribute.."); + VerifyOrDo(!ShouldSkip("HEPAFREMON.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::DegradationDirection::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the ChangeIndication attribute."); + VerifyOrDo(!ShouldSkip("HEPAFREMON.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::ChangeIndication::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the InPlaceIndicator attribute"); + VerifyOrDo(!ShouldSkip("HEPAFREMON.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::InPlaceIndicator::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_INKCREMON_1_1Suite : public TestCommand +{ +public: + Test_TC_INKCREMON_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_INKCREMON_1_1", 10, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_INKCREMON_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), InkCartridgeMonitoring::Id, + InkCartridgeMonitoring::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip(" !INKCREMON.S.F00 && !INKCREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), InkCartridgeMonitoring::Id, + InkCartridgeMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Given INKCREMON.S.F00(Condition) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("INKCREMON.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), InkCartridgeMonitoring::Id, + InkCartridgeMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Given INKCREMON.S.F01(Warning) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("INKCREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), InkCartridgeMonitoring::Id, + InkCartridgeMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Read the global attribute: AttributeList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), InkCartridgeMonitoring::Id, + InkCartridgeMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Read the feature dependent(INKCREMON.S.F00) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("INKCREMON.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), InkCartridgeMonitoring::Id, + InkCartridgeMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), InkCartridgeMonitoring::Id, + InkCartridgeMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), InkCartridgeMonitoring::Id, + InkCartridgeMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads EventList attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), InkCartridgeMonitoring::Id, + InkCartridgeMonitoring::Attributes::EventList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_INKCREMON_2_1Suite : public TestCommand +{ +public: + Test_TC_INKCREMON_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_INKCREMON_2_1", 5, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_INKCREMON_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::Percent value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "percent", "percent")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 100U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::InkCartridgeMonitoring::DegradationDirectionEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::InkCartridgeMonitoring::ChangeIndicationEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the Condition attribute."); + VerifyOrDo(!ShouldSkip("INKCREMON.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), InkCartridgeMonitoring::Id, + InkCartridgeMonitoring::Attributes::Condition::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the DegradationDirection attribute.."); + VerifyOrDo(!ShouldSkip("INKCREMON.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), InkCartridgeMonitoring::Id, + InkCartridgeMonitoring::Attributes::DegradationDirection::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the ChangeIndication attribute."); + VerifyOrDo(!ShouldSkip("INKCREMON.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), InkCartridgeMonitoring::Id, + InkCartridgeMonitoring::Attributes::ChangeIndication::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the InPlaceIndicator attribute"); + VerifyOrDo(!ShouldSkip("INKCREMON.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), InkCartridgeMonitoring::Id, + InkCartridgeMonitoring::Attributes::InPlaceIndicator::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IONFREMON_1_1Suite : public TestCommand +{ +public: + Test_TC_IONFREMON_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_IONFREMON_1_1", 10, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IONFREMON_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IonizingFilterMonitoring::Id, + IonizingFilterMonitoring::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip(" !IONFREMON.S.F00 && !IONFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IonizingFilterMonitoring::Id, + IonizingFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Given IONFREMON.S.F00(Condition) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("IONFREMON.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IonizingFilterMonitoring::Id, + IonizingFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Given IONFREMON.S.F01(Warning) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("IONFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IonizingFilterMonitoring::Id, + IonizingFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Read the global attribute: AttributeList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IonizingFilterMonitoring::Id, + IonizingFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Read the feature dependent(IONFREMON.S.F00) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("IONFREMON.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IonizingFilterMonitoring::Id, + IonizingFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IonizingFilterMonitoring::Id, + IonizingFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IonizingFilterMonitoring::Id, + IonizingFilterMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads EventList attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IonizingFilterMonitoring::Id, + IonizingFilterMonitoring::Attributes::EventList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IONFREMON_2_1Suite : public TestCommand +{ +public: + Test_TC_IONFREMON_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_IONFREMON_2_1", 5, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_IONFREMON_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::Percent value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "percent", "percent")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 100U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::IonizingFilterMonitoring::DegradationDirectionEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::IonizingFilterMonitoring::ChangeIndicationEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the Condition attribute."); + VerifyOrDo(!ShouldSkip("IONFREMON.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IonizingFilterMonitoring::Id, + IonizingFilterMonitoring::Attributes::Condition::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the DegradationDirection attribute.."); + VerifyOrDo(!ShouldSkip("IONFREMON.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IonizingFilterMonitoring::Id, + IonizingFilterMonitoring::Attributes::DegradationDirection::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the ChangeIndication attribute."); + VerifyOrDo(!ShouldSkip("IONFREMON.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IonizingFilterMonitoring::Id, + IonizingFilterMonitoring::Attributes::ChangeIndication::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the InPlaceIndicator attribute"); + VerifyOrDo(!ShouldSkip("IONFREMON.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IonizingFilterMonitoring::Id, + IonizingFilterMonitoring::Attributes::InPlaceIndicator::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OZFREMON_1_1Suite : public TestCommand +{ +public: + Test_TC_OZFREMON_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_OZFREMON_1_1", 10, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_OZFREMON_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneFilterMonitoring::Id, + OzoneFilterMonitoring::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip(" !OZFREMON.S.F00 && !OZFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneFilterMonitoring::Id, + OzoneFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Given OZFREMON.S.F00(Condition) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("OZFREMON.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneFilterMonitoring::Id, + OzoneFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Given OZFREMON.S.F01(Warning) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("OZFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneFilterMonitoring::Id, + OzoneFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Read the global attribute: AttributeList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneFilterMonitoring::Id, + OzoneFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Read the feature dependent(OZFREMON.S.F00) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("OZFREMON.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneFilterMonitoring::Id, + OzoneFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneFilterMonitoring::Id, + OzoneFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneFilterMonitoring::Id, + OzoneFilterMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads EventList attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneFilterMonitoring::Id, + OzoneFilterMonitoring::Attributes::EventList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OZFREMON_2_1Suite : public TestCommand +{ +public: + Test_TC_OZFREMON_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_OZFREMON_2_1", 5, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_OZFREMON_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::Percent value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "percent", "percent")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 100U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OzoneFilterMonitoring::DegradationDirectionEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OzoneFilterMonitoring::ChangeIndicationEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the Condition attribute."); + VerifyOrDo(!ShouldSkip("OZFREMON.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneFilterMonitoring::Id, + OzoneFilterMonitoring::Attributes::Condition::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the DegradationDirection attribute.."); + VerifyOrDo(!ShouldSkip("OZFREMON.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneFilterMonitoring::Id, + OzoneFilterMonitoring::Attributes::DegradationDirection::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the ChangeIndication attribute."); + VerifyOrDo(!ShouldSkip("OZFREMON.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneFilterMonitoring::Id, + OzoneFilterMonitoring::Attributes::ChangeIndication::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the InPlaceIndicator attribute"); + VerifyOrDo(!ShouldSkip("OZFREMON.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneFilterMonitoring::Id, + OzoneFilterMonitoring::Attributes::InPlaceIndicator::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TCREMON_1_1Suite : public TestCommand +{ +public: + Test_TC_TCREMON_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_TCREMON_1_1", 10, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TCREMON_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TonerCartridgeMonitoring::Id, + TonerCartridgeMonitoring::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip(" !TCREMON.S.F00 && !TCREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TonerCartridgeMonitoring::Id, + TonerCartridgeMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Given TCREMON.S.F00(Condition) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("TCREMON.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TonerCartridgeMonitoring::Id, + TonerCartridgeMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Given TCREMON.S.F01(Warning) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("TCREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TonerCartridgeMonitoring::Id, + TonerCartridgeMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Read the global attribute: AttributeList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TonerCartridgeMonitoring::Id, + TonerCartridgeMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Read the feature dependent(TCREMON.S.F00) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("TCREMON.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TonerCartridgeMonitoring::Id, + TonerCartridgeMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TonerCartridgeMonitoring::Id, + TonerCartridgeMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TonerCartridgeMonitoring::Id, + TonerCartridgeMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads EventList attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TonerCartridgeMonitoring::Id, + TonerCartridgeMonitoring::Attributes::EventList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TCREMON_2_1Suite : public TestCommand +{ +public: + Test_TC_TCREMON_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_TCREMON_2_1", 5, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TCREMON_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::Percent value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "percent", "percent")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 100U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::TonerCartridgeMonitoring::DegradationDirectionEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::TonerCartridgeMonitoring::ChangeIndicationEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the Condition attribute."); + VerifyOrDo(!ShouldSkip("TCREMON.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TonerCartridgeMonitoring::Id, + TonerCartridgeMonitoring::Attributes::Condition::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the DegradationDirection attribute.."); + VerifyOrDo(!ShouldSkip("TCREMON.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TonerCartridgeMonitoring::Id, + TonerCartridgeMonitoring::Attributes::DegradationDirection::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the ChangeIndication attribute."); + VerifyOrDo(!ShouldSkip("TCREMON.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TonerCartridgeMonitoring::Id, + TonerCartridgeMonitoring::Attributes::ChangeIndication::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the InPlaceIndicator attribute"); + VerifyOrDo(!ShouldSkip("TCREMON.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TonerCartridgeMonitoring::Id, + TonerCartridgeMonitoring::Attributes::InPlaceIndicator::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_UVFREMON_1_1Suite : public TestCommand +{ +public: + Test_TC_UVFREMON_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_UVFREMON_1_1", 10, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_UVFREMON_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UvFilterMonitoring::Id, + UvFilterMonitoring::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip(" !UVFREMON.S.F00 && !UVFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UvFilterMonitoring::Id, + UvFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Given UVFREMON.S.F00(Condition) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("UVFREMON.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UvFilterMonitoring::Id, + UvFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Given UVFREMON.S.F01(Warning) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("UVFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UvFilterMonitoring::Id, + UvFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Read the global attribute: AttributeList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UvFilterMonitoring::Id, + UvFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Read the feature dependent(UVFREMON.S.F00) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("UVFREMON.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UvFilterMonitoring::Id, + UvFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UvFilterMonitoring::Id, + UvFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UvFilterMonitoring::Id, + UvFilterMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads EventList attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UvFilterMonitoring::Id, + UvFilterMonitoring::Attributes::EventList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_UVFREMON_2_1Suite : public TestCommand +{ +public: + Test_TC_UVFREMON_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_UVFREMON_2_1", 5, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_UVFREMON_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::Percent value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "percent", "percent")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 100U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UvFilterMonitoring::DegradationDirectionEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::UvFilterMonitoring::ChangeIndicationEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the Condition attribute."); + VerifyOrDo(!ShouldSkip("UVFREMON.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UvFilterMonitoring::Id, + UvFilterMonitoring::Attributes::Condition::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the DegradationDirection attribute.."); + VerifyOrDo(!ShouldSkip("UVFREMON.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UvFilterMonitoring::Id, + UvFilterMonitoring::Attributes::DegradationDirection::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the ChangeIndication attribute."); + VerifyOrDo(!ShouldSkip("UVFREMON.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UvFilterMonitoring::Id, + UvFilterMonitoring::Attributes::ChangeIndication::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the InPlaceIndicator attribute"); + VerifyOrDo(!ShouldSkip("UVFREMON.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UvFilterMonitoring::Id, + UvFilterMonitoring::Attributes::InPlaceIndicator::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WTREMON_1_1Suite : public TestCommand +{ +public: + Test_TC_WTREMON_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_WTREMON_1_1", 10, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_WTREMON_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WaterTankMonitoring::Id, + WaterTankMonitoring::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip(" !WTREMON.S.F00 && !WTREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WaterTankMonitoring::Id, + WaterTankMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Given WTREMON.S.F00(Condition) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("WTREMON.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WaterTankMonitoring::Id, + WaterTankMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Given WTREMON.S.F01(Warning) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("WTREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WaterTankMonitoring::Id, + WaterTankMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Read the global attribute: AttributeList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WaterTankMonitoring::Id, + WaterTankMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Read the feature dependent(WTREMON.S.F00) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("WTREMON.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WaterTankMonitoring::Id, + WaterTankMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WaterTankMonitoring::Id, + WaterTankMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WaterTankMonitoring::Id, + WaterTankMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads EventList attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WaterTankMonitoring::Id, + WaterTankMonitoring::Attributes::EventList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WTREMON_2_1Suite : public TestCommand +{ +public: + Test_TC_WTREMON_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_WTREMON_2_1", 5, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_WTREMON_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::Percent value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "percent", "percent")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 100U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::WaterTankMonitoring::DegradationDirectionEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::WaterTankMonitoring::ChangeIndicationEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the Condition attribute."); + VerifyOrDo(!ShouldSkip("WTREMON.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WaterTankMonitoring::Id, + WaterTankMonitoring::Attributes::Condition::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the DegradationDirection attribute.."); + VerifyOrDo(!ShouldSkip("WTREMON.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WaterTankMonitoring::Id, + WaterTankMonitoring::Attributes::DegradationDirection::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the ChangeIndication attribute."); + VerifyOrDo(!ShouldSkip("WTREMON.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WaterTankMonitoring::Id, + WaterTankMonitoring::Attributes::ChangeIndication::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the InPlaceIndicator attribute"); + VerifyOrDo(!ShouldSkip("WTREMON.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WaterTankMonitoring::Id, + WaterTankMonitoring::Attributes::InPlaceIndicator::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ZEOFREMON_1_1Suite : public TestCommand +{ +public: + Test_TC_ZEOFREMON_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_ZEOFREMON_1_1", 10, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ZEOFREMON_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ZeoliteFilterMonitoring::Id, + ZeoliteFilterMonitoring::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip(" !ZEOFREMON.S.F00 && !ZEOFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ZeoliteFilterMonitoring::Id, + ZeoliteFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Given ZEOFREMON.S.F00(Condition) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("ZEOFREMON.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ZeoliteFilterMonitoring::Id, + ZeoliteFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Given ZEOFREMON.S.F01(Warning) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("ZEOFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ZeoliteFilterMonitoring::Id, + ZeoliteFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Read the global attribute: AttributeList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ZeoliteFilterMonitoring::Id, + ZeoliteFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Read the feature dependent(ZEOFREMON.S.F00) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("ZEOFREMON.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ZeoliteFilterMonitoring::Id, + ZeoliteFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ZeoliteFilterMonitoring::Id, + ZeoliteFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ZeoliteFilterMonitoring::Id, + ZeoliteFilterMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads EventList attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ZeoliteFilterMonitoring::Id, + ZeoliteFilterMonitoring::Attributes::EventList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ZEOFREMON_2_1Suite : public TestCommand +{ +public: + Test_TC_ZEOFREMON_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_ZEOFREMON_2_1", 5, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ZEOFREMON_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::Percent value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "percent", "percent")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 100U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ZeoliteFilterMonitoring::DegradationDirectionEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ZeoliteFilterMonitoring::ChangeIndicationEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the Condition attribute."); + VerifyOrDo(!ShouldSkip("ZEOFREMON.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ZeoliteFilterMonitoring::Id, + ZeoliteFilterMonitoring::Attributes::Condition::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the DegradationDirection attribute.."); + VerifyOrDo(!ShouldSkip("ZEOFREMON.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ZeoliteFilterMonitoring::Id, + ZeoliteFilterMonitoring::Attributes::DegradationDirection::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the ChangeIndication attribute."); + VerifyOrDo(!ShouldSkip("ZEOFREMON.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ZeoliteFilterMonitoring::Id, + ZeoliteFilterMonitoring::Attributes::ChangeIndication::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the InPlaceIndicator attribute"); + VerifyOrDo(!ShouldSkip("ZEOFREMON.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ZeoliteFilterMonitoring::Id, + ZeoliteFilterMonitoring::Attributes::InPlaceIndicator::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + class Test_TC_DD_1_5Suite : public TestCommand { public: @@ -118690,6 +122794,30 @@ 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), + 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), diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index 0c5f225c2dd691..45ea9f122b6dbf 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -243,6 +243,30 @@ class TestList : public Command { printf("TestGroupsCluster\n"); printf("TestGroupKeyManagementCluster\n"); printf("Test_TC_G_1_1\n"); + printf("Test_TC_ACFREMON_1_1\n"); + printf("Test_TC_ACFREMON_2_1\n"); + printf("Test_TC_CFREMON_1_1\n"); + printf("Test_TC_CFREMON_2_1\n"); + printf("Test_TC_ESFREMON_1_1\n"); + printf("Test_TC_ESFREMON_2_1\n"); + printf("Test_TC_FTREMON_1_1\n"); + printf("Test_TC_FTREMON_2_1\n"); + printf("Test_TC_HEPAFREMON_1_1\n"); + printf("Test_TC_HEPAFREMON_2_1\n"); + printf("Test_TC_INKCREMON_1_1\n"); + printf("Test_TC_INKCREMON_2_1\n"); + printf("Test_TC_IONFREMON_1_1\n"); + printf("Test_TC_IONFREMON_2_1\n"); + printf("Test_TC_OZFREMON_1_1\n"); + printf("Test_TC_OZFREMON_2_1\n"); + printf("Test_TC_TCREMON_1_1\n"); + printf("Test_TC_TCREMON_2_1\n"); + printf("Test_TC_UVFREMON_1_1\n"); + printf("Test_TC_UVFREMON_2_1\n"); + printf("Test_TC_WTREMON_1_1\n"); + printf("Test_TC_WTREMON_2_1\n"); + printf("Test_TC_ZEOFREMON_1_1\n"); + printf("Test_TC_ZEOFREMON_2_1\n"); return CHIP_NO_ERROR; } @@ -145830,6 +145854,7314 @@ class Test_TC_G_1_1 : public TestCommandBridge { } }; +class Test_TC_ACFREMON_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_ACFREMON_1_1() + : TestCommandBridge("Test_TC_ACFREMON_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_ACFREMON_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_ACFREMON_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ACFREMON_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 : Read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); + if (ShouldSkip(" !ACFREMON.S.F00 && !ACFREMON.S.F01")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeFeatureMap_2(); + break; + case 3: + ChipLogProgress( + chipTool, " ***** Test Step 3 : Given ACFREMON.S.F00(Condition) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("ACFREMON.S.F00")) { + NextTest(); + return; + } + err = TestGivenACFREMONSF00ConditionEnsureFeaturemapHasTheCorrectBitSet_3(); + break; + case 4: + ChipLogProgress( + chipTool, " ***** Test Step 4 : Given ACFREMON.S.F01(Warning) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("ACFREMON.S.F01")) { + NextTest(); + return; + } + err = TestGivenACFREMONSF01WarningEnsureFeaturemapHasTheCorrectBitSet_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_5(); + break; + case 6: + ChipLogProgress( + chipTool, " ***** Test Step 6 : Read the feature dependent(ACFREMON.S.F00) attribute in AttributeList\n"); + if (ShouldSkip("ACFREMON.S.F00")) { + NextTest(); + return; + } + err = TestReadTheFeatureDependentACFREMONSF00AttributeInAttributeList_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads EventList attribute from DUT\n"); + err = TestThReadsEventListAttributeFromDut_9(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 10; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterActivatedCarbonFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterActivatedCarbonFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenACFREMONSF00ConditionEnsureFeaturemapHasTheCorrectBitSet_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterActivatedCarbonFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given ACFREMON.S.F00(Condition) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenACFREMONSF01WarningEnsureFeaturemapHasTheCorrectBitSet_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterActivatedCarbonFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given ACFREMON.S.F01(Warning) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterActivatedCarbonFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheFeatureDependentACFREMONSF00AttributeInAttributeList_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterActivatedCarbonFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the feature dependent(ACFREMON.S.F00) attribute in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterActivatedCarbonFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterActivatedCarbonFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsEventListAttributeFromDut_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterActivatedCarbonFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads EventList attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EventList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("eventList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ACFREMON_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_ACFREMON_2_1() + : TestCommandBridge("Test_TC_ACFREMON_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_ACFREMON_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_ACFREMON_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ACFREMON_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 from the DUT the Condition attribute.\n"); + if (ShouldSkip("ACFREMON.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheConditionAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads from the DUT the DegradationDirection attribute..\n"); + if (ShouldSkip("ACFREMON.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheDegradationDirectionAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads from the DUT the ChangeIndication attribute.\n"); + if (ShouldSkip("ACFREMON.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheChangeIndicationAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the InPlaceIndicator attribute\n"); + if (ShouldSkip("ACFREMON.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheInPlaceIndicatorAttribute_4(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 5; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestThReadsFromTheDutTheConditionAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterActivatedCarbonFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeConditionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the Condition attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("condition", "percent", "percent")); + VerifyOrReturn(CheckConstraintMinValue("condition", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("condition", [value unsignedCharValue], 100U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheDegradationDirectionAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterActivatedCarbonFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeDegradationDirectionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the DegradationDirection attribute.. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("degradationDirection", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("degradationDirection", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("degradationDirection", [value unsignedCharValue], 1U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheChangeIndicationAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterActivatedCarbonFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeChangeIndicationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the ChangeIndication attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("changeIndication", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("changeIndication", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("changeIndication", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheInPlaceIndicatorAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterActivatedCarbonFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInPlaceIndicatorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the InPlaceIndicator attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("inPlaceIndicator", "boolean", "boolean")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CFREMON_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_CFREMON_1_1() + : TestCommandBridge("Test_TC_CFREMON_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_CFREMON_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CFREMON_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CFREMON_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 : Read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); + if (ShouldSkip(" !CFREMON.S.F00 && !CFREMON.S.F01")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeFeatureMap_2(); + break; + case 3: + ChipLogProgress( + chipTool, " ***** Test Step 3 : Given CFREMON.S.F00(Condition) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("CFREMON.S.F00")) { + NextTest(); + return; + } + err = TestGivenCFREMONSF00ConditionEnsureFeaturemapHasTheCorrectBitSet_3(); + break; + case 4: + ChipLogProgress( + chipTool, " ***** Test Step 4 : Given CFREMON.S.F01(Warning) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("CFREMON.S.F01")) { + NextTest(); + return; + } + err = TestGivenCFREMONSF01WarningEnsureFeaturemapHasTheCorrectBitSet_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_5(); + break; + case 6: + ChipLogProgress( + chipTool, " ***** Test Step 6 : Read the feature dependent(CFREMON.S.F00) attribute in AttributeList\n"); + if (ShouldSkip("CFREMON.S.F00")) { + NextTest(); + return; + } + err = TestReadTheFeatureDependentCFREMONSF00AttributeInAttributeList_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads EventList attribute from DUT\n"); + err = TestThReadsEventListAttributeFromDut_9(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 10; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCeramicFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCeramicFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCFREMONSF00ConditionEnsureFeaturemapHasTheCorrectBitSet_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCeramicFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CFREMON.S.F00(Condition) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCFREMONSF01WarningEnsureFeaturemapHasTheCorrectBitSet_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCeramicFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CFREMON.S.F01(Warning) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCeramicFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheFeatureDependentCFREMONSF00AttributeInAttributeList_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCeramicFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the feature dependent(CFREMON.S.F00) attribute in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCeramicFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCeramicFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsEventListAttributeFromDut_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCeramicFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads EventList attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EventList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("eventList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CFREMON_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_CFREMON_2_1() + : TestCommandBridge("Test_TC_CFREMON_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_CFREMON_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CFREMON_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CFREMON_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 from the DUT the Condition attribute.\n"); + if (ShouldSkip("CFREMON.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheConditionAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads from the DUT the DegradationDirection attribute..\n"); + if (ShouldSkip("CFREMON.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheDegradationDirectionAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads from the DUT the ChangeIndication attribute.\n"); + if (ShouldSkip("CFREMON.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheChangeIndicationAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the InPlaceIndicator attribute\n"); + if (ShouldSkip("CFREMON.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheInPlaceIndicatorAttribute_4(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 5; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestThReadsFromTheDutTheConditionAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCeramicFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeConditionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the Condition attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("condition", "percent", "percent")); + VerifyOrReturn(CheckConstraintMinValue("condition", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("condition", [value unsignedCharValue], 100U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheDegradationDirectionAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCeramicFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeDegradationDirectionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the DegradationDirection attribute.. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("degradationDirection", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("degradationDirection", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("degradationDirection", [value unsignedCharValue], 1U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheChangeIndicationAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCeramicFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeChangeIndicationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the ChangeIndication attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("changeIndication", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("changeIndication", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("changeIndication", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheInPlaceIndicatorAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCeramicFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInPlaceIndicatorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the InPlaceIndicator attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("inPlaceIndicator", "boolean", "boolean")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ESFREMON_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_ESFREMON_1_1() + : TestCommandBridge("Test_TC_ESFREMON_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_ESFREMON_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_ESFREMON_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ESFREMON_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 : Read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); + if (ShouldSkip(" !ESFREMON.S.F00 && !ESFREMON.S.F01")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeFeatureMap_2(); + break; + case 3: + ChipLogProgress( + chipTool, " ***** Test Step 3 : Given ESFREMON.S.F00(Condition) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("ESFREMON.S.F00")) { + NextTest(); + return; + } + err = TestGivenESFREMONSF00ConditionEnsureFeaturemapHasTheCorrectBitSet_3(); + break; + case 4: + ChipLogProgress( + chipTool, " ***** Test Step 4 : Given ESFREMON.S.F01(Warning) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("ESFREMON.S.F01")) { + NextTest(); + return; + } + err = TestGivenESFREMONSF01WarningEnsureFeaturemapHasTheCorrectBitSet_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_5(); + break; + case 6: + ChipLogProgress( + chipTool, " ***** Test Step 6 : Read the feature dependent(ESFREMON.S.F00) attribute in AttributeList\n"); + if (ShouldSkip("ESFREMON.S.F00")) { + NextTest(); + return; + } + err = TestReadTheFeatureDependentESFREMONSF00AttributeInAttributeList_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads EventList attribute from DUT\n"); + err = TestThReadsEventListAttributeFromDut_9(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 10; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterElectrostaticFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterElectrostaticFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenESFREMONSF00ConditionEnsureFeaturemapHasTheCorrectBitSet_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterElectrostaticFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given ESFREMON.S.F00(Condition) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenESFREMONSF01WarningEnsureFeaturemapHasTheCorrectBitSet_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterElectrostaticFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given ESFREMON.S.F01(Warning) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterElectrostaticFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheFeatureDependentESFREMONSF00AttributeInAttributeList_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterElectrostaticFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the feature dependent(ESFREMON.S.F00) attribute in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterElectrostaticFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterElectrostaticFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsEventListAttributeFromDut_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterElectrostaticFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads EventList attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EventList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("eventList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ESFREMON_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_ESFREMON_2_1() + : TestCommandBridge("Test_TC_ESFREMON_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_ESFREMON_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_ESFREMON_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ESFREMON_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 from the DUT the Condition attribute.\n"); + if (ShouldSkip("ESFREMON.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheConditionAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads from the DUT the DegradationDirection attribute..\n"); + if (ShouldSkip("ESFREMON.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheDegradationDirectionAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads from the DUT the ChangeIndication attribute.\n"); + if (ShouldSkip("ESFREMON.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheChangeIndicationAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the InPlaceIndicator attribute\n"); + if (ShouldSkip("ESFREMON.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheInPlaceIndicatorAttribute_4(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 5; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestThReadsFromTheDutTheConditionAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterElectrostaticFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeConditionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the Condition attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("condition", "percent", "percent")); + VerifyOrReturn(CheckConstraintMinValue("condition", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("condition", [value unsignedCharValue], 100U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheDegradationDirectionAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterElectrostaticFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeDegradationDirectionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the DegradationDirection attribute.. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("degradationDirection", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("degradationDirection", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("degradationDirection", [value unsignedCharValue], 1U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheChangeIndicationAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterElectrostaticFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeChangeIndicationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the ChangeIndication attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("changeIndication", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("changeIndication", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("changeIndication", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheInPlaceIndicatorAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterElectrostaticFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInPlaceIndicatorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the InPlaceIndicator attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("inPlaceIndicator", "boolean", "boolean")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_FTREMON_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_FTREMON_1_1() + : TestCommandBridge("Test_TC_FTREMON_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_FTREMON_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_FTREMON_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_FTREMON_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 : Read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); + if (ShouldSkip(" !FTREMON.S.F00 && !FTREMON.S.F01")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeFeatureMap_2(); + break; + case 3: + ChipLogProgress( + chipTool, " ***** Test Step 3 : Given FTREMON.S.F00(Condition) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("FTREMON.S.F00")) { + NextTest(); + return; + } + err = TestGivenFTREMONSF00ConditionEnsureFeaturemapHasTheCorrectBitSet_3(); + break; + case 4: + ChipLogProgress( + chipTool, " ***** Test Step 4 : Given FTREMON.S.F01(Warning) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("FTREMON.S.F01")) { + NextTest(); + return; + } + err = TestGivenFTREMONSF01WarningEnsureFeaturemapHasTheCorrectBitSet_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_5(); + break; + case 6: + ChipLogProgress( + chipTool, " ***** Test Step 6 : Read the feature dependent(FTREMON.S.F00) attribute in AttributeList\n"); + if (ShouldSkip("FTREMON.S.F00")) { + NextTest(); + return; + } + err = TestReadTheFeatureDependentFTREMONSF00AttributeInAttributeList_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads EventList attribute from DUT\n"); + err = TestThReadsEventListAttributeFromDut_9(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 10; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFuelTankMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFuelTankMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenFTREMONSF00ConditionEnsureFeaturemapHasTheCorrectBitSet_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFuelTankMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given FTREMON.S.F00(Condition) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenFTREMONSF01WarningEnsureFeaturemapHasTheCorrectBitSet_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFuelTankMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given FTREMON.S.F01(Warning) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFuelTankMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheFeatureDependentFTREMONSF00AttributeInAttributeList_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFuelTankMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the feature dependent(FTREMON.S.F00) attribute in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFuelTankMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFuelTankMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsEventListAttributeFromDut_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFuelTankMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads EventList attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EventList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("eventList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_FTREMON_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_FTREMON_2_1() + : TestCommandBridge("Test_TC_FTREMON_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_FTREMON_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_FTREMON_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_FTREMON_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 from the DUT the Condition attribute.\n"); + if (ShouldSkip("FTREMON.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheConditionAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads from the DUT the DegradationDirection attribute..\n"); + if (ShouldSkip("FTREMON.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheDegradationDirectionAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads from the DUT the ChangeIndication attribute.\n"); + if (ShouldSkip("FTREMON.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheChangeIndicationAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the InPlaceIndicator attribute\n"); + if (ShouldSkip("FTREMON.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheInPlaceIndicatorAttribute_4(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 5; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestThReadsFromTheDutTheConditionAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFuelTankMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeConditionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the Condition attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("condition", "percent", "percent")); + VerifyOrReturn(CheckConstraintMinValue("condition", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("condition", [value unsignedCharValue], 100U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheDegradationDirectionAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFuelTankMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeDegradationDirectionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the DegradationDirection attribute.. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("degradationDirection", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("degradationDirection", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("degradationDirection", [value unsignedCharValue], 1U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheChangeIndicationAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFuelTankMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeChangeIndicationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the ChangeIndication attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("changeIndication", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("changeIndication", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("changeIndication", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheInPlaceIndicatorAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFuelTankMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInPlaceIndicatorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the InPlaceIndicator attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("inPlaceIndicator", "boolean", "boolean")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_HEPAFREMON_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_HEPAFREMON_1_1() + : TestCommandBridge("Test_TC_HEPAFREMON_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_HEPAFREMON_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_HEPAFREMON_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_HEPAFREMON_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 : Read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); + if (ShouldSkip(" !HEPAFREMON.S.F00 && !HEPAFREMON.S.F01")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeFeatureMap_2(); + break; + case 3: + ChipLogProgress( + chipTool, " ***** Test Step 3 : Given HEPAFREMON.S.F00(Condition) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("HEPAFREMON.S.F00")) { + NextTest(); + return; + } + err = TestGivenHEPAFREMONSF00ConditionEnsureFeaturemapHasTheCorrectBitSet_3(); + break; + case 4: + ChipLogProgress( + chipTool, " ***** Test Step 4 : Given HEPAFREMON.S.F01(Warning) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("HEPAFREMON.S.F01")) { + NextTest(); + return; + } + err = TestGivenHEPAFREMONSF01WarningEnsureFeaturemapHasTheCorrectBitSet_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_5(); + break; + case 6: + ChipLogProgress( + chipTool, " ***** Test Step 6 : Read the feature dependent(HEPAFREMON.S.F00) attribute in AttributeList\n"); + if (ShouldSkip("HEPAFREMON.S.F00")) { + NextTest(); + return; + } + err = TestReadTheFeatureDependentHEPAFREMONSF00AttributeInAttributeList_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads EventList attribute from DUT\n"); + err = TestThReadsEventListAttributeFromDut_9(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 10; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterHEPAFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterHEPAFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenHEPAFREMONSF00ConditionEnsureFeaturemapHasTheCorrectBitSet_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterHEPAFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given HEPAFREMON.S.F00(Condition) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenHEPAFREMONSF01WarningEnsureFeaturemapHasTheCorrectBitSet_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterHEPAFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given HEPAFREMON.S.F01(Warning) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterHEPAFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheFeatureDependentHEPAFREMONSF00AttributeInAttributeList_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterHEPAFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the feature dependent(HEPAFREMON.S.F00) attribute in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterHEPAFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterHEPAFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsEventListAttributeFromDut_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterHEPAFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads EventList attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EventList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("eventList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_HEPAFREMON_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_HEPAFREMON_2_1() + : TestCommandBridge("Test_TC_HEPAFREMON_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_HEPAFREMON_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_HEPAFREMON_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_HEPAFREMON_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 from the DUT the Condition attribute.\n"); + if (ShouldSkip("HEPAFREMON.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheConditionAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads from the DUT the DegradationDirection attribute..\n"); + if (ShouldSkip("HEPAFREMON.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheDegradationDirectionAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads from the DUT the ChangeIndication attribute.\n"); + if (ShouldSkip("HEPAFREMON.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheChangeIndicationAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the InPlaceIndicator attribute\n"); + if (ShouldSkip("HEPAFREMON.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheInPlaceIndicatorAttribute_4(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 5; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestThReadsFromTheDutTheConditionAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterHEPAFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeConditionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the Condition attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("condition", "percent", "percent")); + VerifyOrReturn(CheckConstraintMinValue("condition", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("condition", [value unsignedCharValue], 100U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheDegradationDirectionAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterHEPAFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeDegradationDirectionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the DegradationDirection attribute.. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("degradationDirection", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("degradationDirection", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("degradationDirection", [value unsignedCharValue], 1U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheChangeIndicationAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterHEPAFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeChangeIndicationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the ChangeIndication attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("changeIndication", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("changeIndication", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("changeIndication", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheInPlaceIndicatorAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterHEPAFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInPlaceIndicatorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the InPlaceIndicator attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("inPlaceIndicator", "boolean", "boolean")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_INKCREMON_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_INKCREMON_1_1() + : TestCommandBridge("Test_TC_INKCREMON_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_INKCREMON_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_INKCREMON_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_INKCREMON_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 : Read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); + if (ShouldSkip(" !INKCREMON.S.F00 && !INKCREMON.S.F01")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeFeatureMap_2(); + break; + case 3: + ChipLogProgress( + chipTool, " ***** Test Step 3 : Given INKCREMON.S.F00(Condition) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("INKCREMON.S.F00")) { + NextTest(); + return; + } + err = TestGivenINKCREMONSF00ConditionEnsureFeaturemapHasTheCorrectBitSet_3(); + break; + case 4: + ChipLogProgress( + chipTool, " ***** Test Step 4 : Given INKCREMON.S.F01(Warning) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("INKCREMON.S.F01")) { + NextTest(); + return; + } + err = TestGivenINKCREMONSF01WarningEnsureFeaturemapHasTheCorrectBitSet_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_5(); + break; + case 6: + ChipLogProgress( + chipTool, " ***** Test Step 6 : Read the feature dependent(INKCREMON.S.F00) attribute in AttributeList\n"); + if (ShouldSkip("INKCREMON.S.F00")) { + NextTest(); + return; + } + err = TestReadTheFeatureDependentINKCREMONSF00AttributeInAttributeList_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads EventList attribute from DUT\n"); + err = TestThReadsEventListAttributeFromDut_9(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 10; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterInkCartridgeMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterInkCartridgeMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenINKCREMONSF00ConditionEnsureFeaturemapHasTheCorrectBitSet_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterInkCartridgeMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given INKCREMON.S.F00(Condition) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenINKCREMONSF01WarningEnsureFeaturemapHasTheCorrectBitSet_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterInkCartridgeMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given INKCREMON.S.F01(Warning) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterInkCartridgeMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheFeatureDependentINKCREMONSF00AttributeInAttributeList_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterInkCartridgeMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the feature dependent(INKCREMON.S.F00) attribute in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterInkCartridgeMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterInkCartridgeMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsEventListAttributeFromDut_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterInkCartridgeMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads EventList attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EventList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("eventList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_INKCREMON_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_INKCREMON_2_1() + : TestCommandBridge("Test_TC_INKCREMON_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_INKCREMON_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_INKCREMON_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_INKCREMON_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 from the DUT the Condition attribute.\n"); + if (ShouldSkip("INKCREMON.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheConditionAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads from the DUT the DegradationDirection attribute..\n"); + if (ShouldSkip("INKCREMON.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheDegradationDirectionAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads from the DUT the ChangeIndication attribute.\n"); + if (ShouldSkip("INKCREMON.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheChangeIndicationAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the InPlaceIndicator attribute\n"); + if (ShouldSkip("INKCREMON.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheInPlaceIndicatorAttribute_4(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 5; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestThReadsFromTheDutTheConditionAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterInkCartridgeMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeConditionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the Condition attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("condition", "percent", "percent")); + VerifyOrReturn(CheckConstraintMinValue("condition", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("condition", [value unsignedCharValue], 100U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheDegradationDirectionAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterInkCartridgeMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeDegradationDirectionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the DegradationDirection attribute.. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("degradationDirection", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("degradationDirection", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("degradationDirection", [value unsignedCharValue], 1U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheChangeIndicationAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterInkCartridgeMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeChangeIndicationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the ChangeIndication attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("changeIndication", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("changeIndication", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("changeIndication", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheInPlaceIndicatorAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterInkCartridgeMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInPlaceIndicatorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the InPlaceIndicator attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("inPlaceIndicator", "boolean", "boolean")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IONFREMON_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_IONFREMON_1_1() + : TestCommandBridge("Test_TC_IONFREMON_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_IONFREMON_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_IONFREMON_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_IONFREMON_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 : Read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); + if (ShouldSkip(" !IONFREMON.S.F00 && !IONFREMON.S.F01")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeFeatureMap_2(); + break; + case 3: + ChipLogProgress( + chipTool, " ***** Test Step 3 : Given IONFREMON.S.F00(Condition) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("IONFREMON.S.F00")) { + NextTest(); + return; + } + err = TestGivenIONFREMONSF00ConditionEnsureFeaturemapHasTheCorrectBitSet_3(); + break; + case 4: + ChipLogProgress( + chipTool, " ***** Test Step 4 : Given IONFREMON.S.F01(Warning) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("IONFREMON.S.F01")) { + NextTest(); + return; + } + err = TestGivenIONFREMONSF01WarningEnsureFeaturemapHasTheCorrectBitSet_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_5(); + break; + case 6: + ChipLogProgress( + chipTool, " ***** Test Step 6 : Read the feature dependent(IONFREMON.S.F00) attribute in AttributeList\n"); + if (ShouldSkip("IONFREMON.S.F00")) { + NextTest(); + return; + } + err = TestReadTheFeatureDependentIONFREMONSF00AttributeInAttributeList_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads EventList attribute from DUT\n"); + err = TestThReadsEventListAttributeFromDut_9(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 10; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterIonizingFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterIonizingFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenIONFREMONSF00ConditionEnsureFeaturemapHasTheCorrectBitSet_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterIonizingFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given IONFREMON.S.F00(Condition) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenIONFREMONSF01WarningEnsureFeaturemapHasTheCorrectBitSet_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterIonizingFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given IONFREMON.S.F01(Warning) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterIonizingFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheFeatureDependentIONFREMONSF00AttributeInAttributeList_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterIonizingFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the feature dependent(IONFREMON.S.F00) attribute in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterIonizingFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterIonizingFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsEventListAttributeFromDut_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterIonizingFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads EventList attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EventList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("eventList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_IONFREMON_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_IONFREMON_2_1() + : TestCommandBridge("Test_TC_IONFREMON_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_IONFREMON_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_IONFREMON_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_IONFREMON_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 from the DUT the Condition attribute.\n"); + if (ShouldSkip("IONFREMON.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheConditionAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads from the DUT the DegradationDirection attribute..\n"); + if (ShouldSkip("IONFREMON.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheDegradationDirectionAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads from the DUT the ChangeIndication attribute.\n"); + if (ShouldSkip("IONFREMON.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheChangeIndicationAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the InPlaceIndicator attribute\n"); + if (ShouldSkip("IONFREMON.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheInPlaceIndicatorAttribute_4(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 5; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestThReadsFromTheDutTheConditionAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterIonizingFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeConditionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the Condition attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("condition", "percent", "percent")); + VerifyOrReturn(CheckConstraintMinValue("condition", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("condition", [value unsignedCharValue], 100U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheDegradationDirectionAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterIonizingFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeDegradationDirectionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the DegradationDirection attribute.. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("degradationDirection", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("degradationDirection", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("degradationDirection", [value unsignedCharValue], 1U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheChangeIndicationAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterIonizingFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeChangeIndicationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the ChangeIndication attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("changeIndication", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("changeIndication", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("changeIndication", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheInPlaceIndicatorAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterIonizingFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInPlaceIndicatorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the InPlaceIndicator attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("inPlaceIndicator", "boolean", "boolean")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OZFREMON_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_OZFREMON_1_1() + : TestCommandBridge("Test_TC_OZFREMON_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_OZFREMON_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OZFREMON_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OZFREMON_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 : Read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); + if (ShouldSkip(" !OZFREMON.S.F00 && !OZFREMON.S.F01")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeFeatureMap_2(); + break; + case 3: + ChipLogProgress( + chipTool, " ***** Test Step 3 : Given OZFREMON.S.F00(Condition) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("OZFREMON.S.F00")) { + NextTest(); + return; + } + err = TestGivenOZFREMONSF00ConditionEnsureFeaturemapHasTheCorrectBitSet_3(); + break; + case 4: + ChipLogProgress( + chipTool, " ***** Test Step 4 : Given OZFREMON.S.F01(Warning) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("OZFREMON.S.F01")) { + NextTest(); + return; + } + err = TestGivenOZFREMONSF01WarningEnsureFeaturemapHasTheCorrectBitSet_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_5(); + break; + case 6: + ChipLogProgress( + chipTool, " ***** Test Step 6 : Read the feature dependent(OZFREMON.S.F00) attribute in AttributeList\n"); + if (ShouldSkip("OZFREMON.S.F00")) { + NextTest(); + return; + } + err = TestReadTheFeatureDependentOZFREMONSF00AttributeInAttributeList_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads EventList attribute from DUT\n"); + err = TestThReadsEventListAttributeFromDut_9(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 10; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenOZFREMONSF00ConditionEnsureFeaturemapHasTheCorrectBitSet_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given OZFREMON.S.F00(Condition) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenOZFREMONSF01WarningEnsureFeaturemapHasTheCorrectBitSet_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given OZFREMON.S.F01(Warning) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheFeatureDependentOZFREMONSF00AttributeInAttributeList_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the feature dependent(OZFREMON.S.F00) attribute in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsEventListAttributeFromDut_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads EventList attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EventList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("eventList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OZFREMON_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_OZFREMON_2_1() + : TestCommandBridge("Test_TC_OZFREMON_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_OZFREMON_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OZFREMON_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OZFREMON_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 from the DUT the Condition attribute.\n"); + if (ShouldSkip("OZFREMON.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheConditionAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads from the DUT the DegradationDirection attribute..\n"); + if (ShouldSkip("OZFREMON.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheDegradationDirectionAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads from the DUT the ChangeIndication attribute.\n"); + if (ShouldSkip("OZFREMON.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheChangeIndicationAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the InPlaceIndicator attribute\n"); + if (ShouldSkip("OZFREMON.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheInPlaceIndicatorAttribute_4(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 5; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestThReadsFromTheDutTheConditionAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeConditionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the Condition attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("condition", "percent", "percent")); + VerifyOrReturn(CheckConstraintMinValue("condition", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("condition", [value unsignedCharValue], 100U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheDegradationDirectionAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeDegradationDirectionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the DegradationDirection attribute.. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("degradationDirection", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("degradationDirection", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("degradationDirection", [value unsignedCharValue], 1U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheChangeIndicationAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeChangeIndicationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the ChangeIndication attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("changeIndication", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("changeIndication", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("changeIndication", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheInPlaceIndicatorAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInPlaceIndicatorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the InPlaceIndicator attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("inPlaceIndicator", "boolean", "boolean")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TCREMON_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_TCREMON_1_1() + : TestCommandBridge("Test_TC_TCREMON_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_TCREMON_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TCREMON_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TCREMON_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 : Read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); + if (ShouldSkip(" !TCREMON.S.F00 && !TCREMON.S.F01")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeFeatureMap_2(); + break; + case 3: + ChipLogProgress( + chipTool, " ***** Test Step 3 : Given TCREMON.S.F00(Condition) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("TCREMON.S.F00")) { + NextTest(); + return; + } + err = TestGivenTCREMONSF00ConditionEnsureFeaturemapHasTheCorrectBitSet_3(); + break; + case 4: + ChipLogProgress( + chipTool, " ***** Test Step 4 : Given TCREMON.S.F01(Warning) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("TCREMON.S.F01")) { + NextTest(); + return; + } + err = TestGivenTCREMONSF01WarningEnsureFeaturemapHasTheCorrectBitSet_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_5(); + break; + case 6: + ChipLogProgress( + chipTool, " ***** Test Step 6 : Read the feature dependent(TCREMON.S.F00) attribute in AttributeList\n"); + if (ShouldSkip("TCREMON.S.F00")) { + NextTest(); + return; + } + err = TestReadTheFeatureDependentTCREMONSF00AttributeInAttributeList_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads EventList attribute from DUT\n"); + err = TestThReadsEventListAttributeFromDut_9(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 10; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTonerCartridgeMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTonerCartridgeMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenTCREMONSF00ConditionEnsureFeaturemapHasTheCorrectBitSet_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTonerCartridgeMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given TCREMON.S.F00(Condition) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenTCREMONSF01WarningEnsureFeaturemapHasTheCorrectBitSet_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTonerCartridgeMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given TCREMON.S.F01(Warning) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTonerCartridgeMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheFeatureDependentTCREMONSF00AttributeInAttributeList_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTonerCartridgeMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the feature dependent(TCREMON.S.F00) attribute in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTonerCartridgeMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTonerCartridgeMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsEventListAttributeFromDut_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTonerCartridgeMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads EventList attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EventList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("eventList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TCREMON_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_TCREMON_2_1() + : TestCommandBridge("Test_TC_TCREMON_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_TCREMON_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TCREMON_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TCREMON_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 from the DUT the Condition attribute.\n"); + if (ShouldSkip("TCREMON.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheConditionAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads from the DUT the DegradationDirection attribute..\n"); + if (ShouldSkip("TCREMON.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheDegradationDirectionAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads from the DUT the ChangeIndication attribute.\n"); + if (ShouldSkip("TCREMON.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheChangeIndicationAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the InPlaceIndicator attribute\n"); + if (ShouldSkip("TCREMON.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheInPlaceIndicatorAttribute_4(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 5; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestThReadsFromTheDutTheConditionAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTonerCartridgeMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeConditionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the Condition attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("condition", "percent", "percent")); + VerifyOrReturn(CheckConstraintMinValue("condition", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("condition", [value unsignedCharValue], 100U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheDegradationDirectionAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTonerCartridgeMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeDegradationDirectionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the DegradationDirection attribute.. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("degradationDirection", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("degradationDirection", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("degradationDirection", [value unsignedCharValue], 1U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheChangeIndicationAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTonerCartridgeMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeChangeIndicationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the ChangeIndication attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("changeIndication", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("changeIndication", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("changeIndication", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheInPlaceIndicatorAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTonerCartridgeMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInPlaceIndicatorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the InPlaceIndicator attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("inPlaceIndicator", "boolean", "boolean")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_UVFREMON_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_UVFREMON_1_1() + : TestCommandBridge("Test_TC_UVFREMON_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_UVFREMON_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_UVFREMON_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_UVFREMON_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 : Read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); + if (ShouldSkip(" !UVFREMON.S.F00 && !UVFREMON.S.F01")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeFeatureMap_2(); + break; + case 3: + ChipLogProgress( + chipTool, " ***** Test Step 3 : Given UVFREMON.S.F00(Condition) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("UVFREMON.S.F00")) { + NextTest(); + return; + } + err = TestGivenUVFREMONSF00ConditionEnsureFeaturemapHasTheCorrectBitSet_3(); + break; + case 4: + ChipLogProgress( + chipTool, " ***** Test Step 4 : Given UVFREMON.S.F01(Warning) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("UVFREMON.S.F01")) { + NextTest(); + return; + } + err = TestGivenUVFREMONSF01WarningEnsureFeaturemapHasTheCorrectBitSet_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_5(); + break; + case 6: + ChipLogProgress( + chipTool, " ***** Test Step 6 : Read the feature dependent(UVFREMON.S.F00) attribute in AttributeList\n"); + if (ShouldSkip("UVFREMON.S.F00")) { + NextTest(); + return; + } + err = TestReadTheFeatureDependentUVFREMONSF00AttributeInAttributeList_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads EventList attribute from DUT\n"); + err = TestThReadsEventListAttributeFromDut_9(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 10; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUVFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUVFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenUVFREMONSF00ConditionEnsureFeaturemapHasTheCorrectBitSet_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUVFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given UVFREMON.S.F00(Condition) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenUVFREMONSF01WarningEnsureFeaturemapHasTheCorrectBitSet_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUVFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given UVFREMON.S.F01(Warning) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUVFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheFeatureDependentUVFREMONSF00AttributeInAttributeList_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUVFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the feature dependent(UVFREMON.S.F00) attribute in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUVFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUVFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsEventListAttributeFromDut_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUVFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads EventList attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EventList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("eventList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_UVFREMON_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_UVFREMON_2_1() + : TestCommandBridge("Test_TC_UVFREMON_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_UVFREMON_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_UVFREMON_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_UVFREMON_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 from the DUT the Condition attribute.\n"); + if (ShouldSkip("UVFREMON.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheConditionAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads from the DUT the DegradationDirection attribute..\n"); + if (ShouldSkip("UVFREMON.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheDegradationDirectionAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads from the DUT the ChangeIndication attribute.\n"); + if (ShouldSkip("UVFREMON.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheChangeIndicationAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the InPlaceIndicator attribute\n"); + if (ShouldSkip("UVFREMON.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheInPlaceIndicatorAttribute_4(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 5; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestThReadsFromTheDutTheConditionAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUVFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeConditionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the Condition attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("condition", "percent", "percent")); + VerifyOrReturn(CheckConstraintMinValue("condition", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("condition", [value unsignedCharValue], 100U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheDegradationDirectionAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUVFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeDegradationDirectionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the DegradationDirection attribute.. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("degradationDirection", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("degradationDirection", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("degradationDirection", [value unsignedCharValue], 1U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheChangeIndicationAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUVFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeChangeIndicationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the ChangeIndication attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("changeIndication", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("changeIndication", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("changeIndication", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheInPlaceIndicatorAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUVFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInPlaceIndicatorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the InPlaceIndicator attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("inPlaceIndicator", "boolean", "boolean")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WTREMON_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_WTREMON_1_1() + : TestCommandBridge("Test_TC_WTREMON_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_WTREMON_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WTREMON_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WTREMON_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 : Read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); + if (ShouldSkip(" !WTREMON.S.F00 && !WTREMON.S.F01")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeFeatureMap_2(); + break; + case 3: + ChipLogProgress( + chipTool, " ***** Test Step 3 : Given WTREMON.S.F00(Condition) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("WTREMON.S.F00")) { + NextTest(); + return; + } + err = TestGivenWTREMONSF00ConditionEnsureFeaturemapHasTheCorrectBitSet_3(); + break; + case 4: + ChipLogProgress( + chipTool, " ***** Test Step 4 : Given WTREMON.S.F01(Warning) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("WTREMON.S.F01")) { + NextTest(); + return; + } + err = TestGivenWTREMONSF01WarningEnsureFeaturemapHasTheCorrectBitSet_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_5(); + break; + case 6: + ChipLogProgress( + chipTool, " ***** Test Step 6 : Read the feature dependent(WTREMON.S.F00) attribute in AttributeList\n"); + if (ShouldSkip("WTREMON.S.F00")) { + NextTest(); + return; + } + err = TestReadTheFeatureDependentWTREMONSF00AttributeInAttributeList_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads EventList attribute from DUT\n"); + err = TestThReadsEventListAttributeFromDut_9(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 10; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterWaterTankMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterWaterTankMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenWTREMONSF00ConditionEnsureFeaturemapHasTheCorrectBitSet_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterWaterTankMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given WTREMON.S.F00(Condition) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenWTREMONSF01WarningEnsureFeaturemapHasTheCorrectBitSet_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterWaterTankMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given WTREMON.S.F01(Warning) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterWaterTankMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheFeatureDependentWTREMONSF00AttributeInAttributeList_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterWaterTankMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the feature dependent(WTREMON.S.F00) attribute in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterWaterTankMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterWaterTankMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsEventListAttributeFromDut_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterWaterTankMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads EventList attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EventList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("eventList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WTREMON_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_WTREMON_2_1() + : TestCommandBridge("Test_TC_WTREMON_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_WTREMON_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WTREMON_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WTREMON_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 from the DUT the Condition attribute.\n"); + if (ShouldSkip("WTREMON.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheConditionAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads from the DUT the DegradationDirection attribute..\n"); + if (ShouldSkip("WTREMON.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheDegradationDirectionAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads from the DUT the ChangeIndication attribute.\n"); + if (ShouldSkip("WTREMON.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheChangeIndicationAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the InPlaceIndicator attribute\n"); + if (ShouldSkip("WTREMON.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheInPlaceIndicatorAttribute_4(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 5; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestThReadsFromTheDutTheConditionAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterWaterTankMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeConditionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the Condition attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("condition", "percent", "percent")); + VerifyOrReturn(CheckConstraintMinValue("condition", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("condition", [value unsignedCharValue], 100U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheDegradationDirectionAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterWaterTankMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeDegradationDirectionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the DegradationDirection attribute.. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("degradationDirection", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("degradationDirection", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("degradationDirection", [value unsignedCharValue], 1U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheChangeIndicationAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterWaterTankMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeChangeIndicationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the ChangeIndication attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("changeIndication", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("changeIndication", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("changeIndication", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheInPlaceIndicatorAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterWaterTankMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInPlaceIndicatorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the InPlaceIndicator attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("inPlaceIndicator", "boolean", "boolean")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ZEOFREMON_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_ZEOFREMON_1_1() + : TestCommandBridge("Test_TC_ZEOFREMON_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_ZEOFREMON_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_ZEOFREMON_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ZEOFREMON_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 : Read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); + if (ShouldSkip(" !ZEOFREMON.S.F00 && !ZEOFREMON.S.F01")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeFeatureMap_2(); + break; + case 3: + ChipLogProgress( + chipTool, " ***** Test Step 3 : Given ZEOFREMON.S.F00(Condition) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("ZEOFREMON.S.F00")) { + NextTest(); + return; + } + err = TestGivenZEOFREMONSF00ConditionEnsureFeaturemapHasTheCorrectBitSet_3(); + break; + case 4: + ChipLogProgress( + chipTool, " ***** Test Step 4 : Given ZEOFREMON.S.F01(Warning) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("ZEOFREMON.S.F01")) { + NextTest(); + return; + } + err = TestGivenZEOFREMONSF01WarningEnsureFeaturemapHasTheCorrectBitSet_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_5(); + break; + case 6: + ChipLogProgress( + chipTool, " ***** Test Step 6 : Read the feature dependent(ZEOFREMON.S.F00) attribute in AttributeList\n"); + if (ShouldSkip("ZEOFREMON.S.F00")) { + NextTest(); + return; + } + err = TestReadTheFeatureDependentZEOFREMONSF00AttributeInAttributeList_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads EventList attribute from DUT\n"); + err = TestThReadsEventListAttributeFromDut_9(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 10; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterZeoliteFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterZeoliteFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenZEOFREMONSF00ConditionEnsureFeaturemapHasTheCorrectBitSet_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterZeoliteFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given ZEOFREMON.S.F00(Condition) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenZEOFREMONSF01WarningEnsureFeaturemapHasTheCorrectBitSet_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterZeoliteFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given ZEOFREMON.S.F01(Warning) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterZeoliteFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheFeatureDependentZEOFREMONSF00AttributeInAttributeList_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterZeoliteFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the feature dependent(ZEOFREMON.S.F00) attribute in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterZeoliteFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterZeoliteFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsEventListAttributeFromDut_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterZeoliteFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads EventList attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EventList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("eventList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ZEOFREMON_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_ZEOFREMON_2_1() + : TestCommandBridge("Test_TC_ZEOFREMON_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_ZEOFREMON_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_ZEOFREMON_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ZEOFREMON_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 from the DUT the Condition attribute.\n"); + if (ShouldSkip("ZEOFREMON.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheConditionAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads from the DUT the DegradationDirection attribute..\n"); + if (ShouldSkip("ZEOFREMON.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheDegradationDirectionAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads from the DUT the ChangeIndication attribute.\n"); + if (ShouldSkip("ZEOFREMON.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheChangeIndicationAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the InPlaceIndicator attribute\n"); + if (ShouldSkip("ZEOFREMON.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheInPlaceIndicatorAttribute_4(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 5; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestThReadsFromTheDutTheConditionAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterZeoliteFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeConditionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the Condition attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("condition", "percent", "percent")); + VerifyOrReturn(CheckConstraintMinValue("condition", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("condition", [value unsignedCharValue], 100U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheDegradationDirectionAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterZeoliteFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeDegradationDirectionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the DegradationDirection attribute.. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("degradationDirection", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("degradationDirection", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("degradationDirection", [value unsignedCharValue], 1U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheChangeIndicationAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterZeoliteFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeChangeIndicationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the ChangeIndication attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("changeIndication", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("changeIndication", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("changeIndication", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheInPlaceIndicatorAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterZeoliteFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInPlaceIndicatorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the InPlaceIndicator attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("inPlaceIndicator", "boolean", "boolean")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + #endif // CONFIG_ENABLE_YAML_TESTS void registerCommandsTests(Commands & commands) @@ -146047,6 +153379,30 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), #endif // CONFIG_ENABLE_YAML_TESTS }; From 4235c51bd25f1b34f6c3378045972a49af39f8f9 Mon Sep 17 00:00:00 2001 From: Graf Tobias <4622393+tobiasgraf@users.noreply.github.com> Date: Fri, 26 May 2023 14:38:01 +0200 Subject: [PATCH 06/16] Fix minor formatting --- src/app/tests/suites/certification/Test_TC_ACFREMON_2_1.yaml | 2 +- src/app/tests/suites/certification/Test_TC_CFREMON_2_1.yaml | 2 +- src/app/tests/suites/certification/Test_TC_ESFREMON_2_1.yaml | 2 +- src/app/tests/suites/certification/Test_TC_FTREMON_2_1.yaml | 2 +- src/app/tests/suites/certification/Test_TC_HEPAFREMON_2_1.yaml | 2 +- src/app/tests/suites/certification/Test_TC_INKCREMON_2_1.yaml | 2 +- src/app/tests/suites/certification/Test_TC_IONFREMON_2_1.yaml | 2 +- src/app/tests/suites/certification/Test_TC_OZFREMON_2_1.yaml | 2 +- src/app/tests/suites/certification/Test_TC_TCREMON_2_1.yaml | 2 +- src/app/tests/suites/certification/Test_TC_UVFREMON_2_1.yaml | 2 +- src/app/tests/suites/certification/Test_TC_WTREMON_2_1.yaml | 2 +- src/app/tests/suites/certification/Test_TC_ZEOFREMON_2_1.yaml | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/app/tests/suites/certification/Test_TC_ACFREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_ACFREMON_2_1.yaml index c7a0e64aa7f966..798cefd703f771 100644 --- a/src/app/tests/suites/certification/Test_TC_ACFREMON_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACFREMON_2_1.yaml @@ -68,4 +68,4 @@ tests: attribute: "InPlaceIndicator" response: constraints: - type: boolean \ No newline at end of file + type: boolean diff --git a/src/app/tests/suites/certification/Test_TC_CFREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_CFREMON_2_1.yaml index 70ee6e0de8b51b..58a0e23726efca 100644 --- a/src/app/tests/suites/certification/Test_TC_CFREMON_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CFREMON_2_1.yaml @@ -68,4 +68,4 @@ tests: attribute: "InPlaceIndicator" response: constraints: - type: boolean \ No newline at end of file + type: boolean diff --git a/src/app/tests/suites/certification/Test_TC_ESFREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_ESFREMON_2_1.yaml index 4c20d5948c5bf9..22696949e64860 100644 --- a/src/app/tests/suites/certification/Test_TC_ESFREMON_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ESFREMON_2_1.yaml @@ -68,4 +68,4 @@ tests: attribute: "InPlaceIndicator" response: constraints: - type: boolean \ No newline at end of file + type: boolean diff --git a/src/app/tests/suites/certification/Test_TC_FTREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_FTREMON_2_1.yaml index 70083b2cc54ddc..9726c49d993c22 100644 --- a/src/app/tests/suites/certification/Test_TC_FTREMON_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_FTREMON_2_1.yaml @@ -68,4 +68,4 @@ tests: attribute: "InPlaceIndicator" response: constraints: - type: boolean \ No newline at end of file + type: boolean diff --git a/src/app/tests/suites/certification/Test_TC_HEPAFREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_HEPAFREMON_2_1.yaml index f8993b74f57af8..7e8627040ede0e 100644 --- a/src/app/tests/suites/certification/Test_TC_HEPAFREMON_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_HEPAFREMON_2_1.yaml @@ -68,4 +68,4 @@ tests: attribute: "InPlaceIndicator" response: constraints: - type: boolean \ No newline at end of file + type: boolean diff --git a/src/app/tests/suites/certification/Test_TC_INKCREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_INKCREMON_2_1.yaml index d8676631fb5b93..07de48db7f6bde 100644 --- a/src/app/tests/suites/certification/Test_TC_INKCREMON_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_INKCREMON_2_1.yaml @@ -68,4 +68,4 @@ tests: attribute: "InPlaceIndicator" response: constraints: - type: boolean \ No newline at end of file + type: boolean diff --git a/src/app/tests/suites/certification/Test_TC_IONFREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_IONFREMON_2_1.yaml index 5b8525c16de43a..7045b8157b88a3 100644 --- a/src/app/tests/suites/certification/Test_TC_IONFREMON_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_IONFREMON_2_1.yaml @@ -68,4 +68,4 @@ tests: attribute: "InPlaceIndicator" response: constraints: - type: boolean \ No newline at end of file + type: boolean diff --git a/src/app/tests/suites/certification/Test_TC_OZFREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_OZFREMON_2_1.yaml index 6c5c7807f49275..7e38963bf1dc7d 100644 --- a/src/app/tests/suites/certification/Test_TC_OZFREMON_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_OZFREMON_2_1.yaml @@ -68,4 +68,4 @@ tests: attribute: "InPlaceIndicator" response: constraints: - type: boolean \ No newline at end of file + type: boolean diff --git a/src/app/tests/suites/certification/Test_TC_TCREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_TCREMON_2_1.yaml index 36ce1db8405dd0..8433b67a7fd2e4 100644 --- a/src/app/tests/suites/certification/Test_TC_TCREMON_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCREMON_2_1.yaml @@ -68,4 +68,4 @@ tests: attribute: "InPlaceIndicator" response: constraints: - type: boolean \ No newline at end of file + type: boolean diff --git a/src/app/tests/suites/certification/Test_TC_UVFREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_UVFREMON_2_1.yaml index 157bd4c42994b6..54cbcf446f9958 100644 --- a/src/app/tests/suites/certification/Test_TC_UVFREMON_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_UVFREMON_2_1.yaml @@ -68,4 +68,4 @@ tests: attribute: "InPlaceIndicator" response: constraints: - type: boolean \ No newline at end of file + type: boolean diff --git a/src/app/tests/suites/certification/Test_TC_WTREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_WTREMON_2_1.yaml index 619351813e59ef..f41ffef4b4fe3a 100644 --- a/src/app/tests/suites/certification/Test_TC_WTREMON_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_WTREMON_2_1.yaml @@ -68,4 +68,4 @@ tests: attribute: "InPlaceIndicator" response: constraints: - type: boolean \ No newline at end of file + type: boolean diff --git a/src/app/tests/suites/certification/Test_TC_ZEOFREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_ZEOFREMON_2_1.yaml index 02c833c6683917..0ebbdecde5d11c 100644 --- a/src/app/tests/suites/certification/Test_TC_ZEOFREMON_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ZEOFREMON_2_1.yaml @@ -68,4 +68,4 @@ tests: attribute: "InPlaceIndicator" response: constraints: - type: boolean \ No newline at end of file + type: boolean From ef73fa9ed3b6bf550b42ef0e20f591a782c8ecbc Mon Sep 17 00:00:00 2001 From: Graf Tobias <4622393+tobiasgraf@users.noreply.github.com> Date: Fri, 26 May 2023 15:33:46 +0200 Subject: [PATCH 07/16] Fix minor formatting --- src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml | 4 ++-- src/app/tests/suites/certification/Test_TC_ACFREMON_2_1.yaml | 3 +-- src/app/tests/suites/certification/Test_TC_CFREMON_1_1.yaml | 4 ++-- src/app/tests/suites/certification/Test_TC_CFREMON_2_1.yaml | 3 +-- src/app/tests/suites/certification/Test_TC_ESFREMON_1_1.yaml | 4 ++-- src/app/tests/suites/certification/Test_TC_ESFREMON_2_1.yaml | 3 +-- src/app/tests/suites/certification/Test_TC_FTREMON_1_1.yaml | 4 ++-- src/app/tests/suites/certification/Test_TC_FTREMON_2_1.yaml | 3 +-- .../tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml | 4 ++-- .../tests/suites/certification/Test_TC_HEPAFREMON_2_1.yaml | 3 +-- src/app/tests/suites/certification/Test_TC_INKCREMON_1_1.yaml | 4 ++-- src/app/tests/suites/certification/Test_TC_INKCREMON_2_1.yaml | 3 +-- src/app/tests/suites/certification/Test_TC_IONFREMON_1_1.yaml | 4 ++-- src/app/tests/suites/certification/Test_TC_IONFREMON_2_1.yaml | 3 +-- src/app/tests/suites/certification/Test_TC_OZFREMON_1_1.yaml | 4 ++-- src/app/tests/suites/certification/Test_TC_OZFREMON_2_1.yaml | 3 +-- src/app/tests/suites/certification/Test_TC_TCREMON_1_1.yaml | 4 ++-- src/app/tests/suites/certification/Test_TC_TCREMON_2_1.yaml | 3 +-- src/app/tests/suites/certification/Test_TC_UVFREMON_1_1.yaml | 4 ++-- src/app/tests/suites/certification/Test_TC_UVFREMON_2_1.yaml | 3 +-- src/app/tests/suites/certification/Test_TC_WTREMON_1_1.yaml | 4 ++-- src/app/tests/suites/certification/Test_TC_WTREMON_2_1.yaml | 3 +-- src/app/tests/suites/certification/Test_TC_ZEOFREMON_1_1.yaml | 4 ++-- src/app/tests/suites/certification/Test_TC_ZEOFREMON_2_1.yaml | 3 +-- 24 files changed, 36 insertions(+), 48 deletions(-) diff --git a/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml index 9810ea2df3fab3..ed7e3f796e9693 100644 --- a/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2023 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. @@ -42,7 +42,7 @@ tests: - label: "Read the global attribute: FeatureMap" command: "readAttribute" attribute: "FeatureMap" - PICS: " !ACFREMON.S.F00 && !ACFREMON.S.F01" + PICS: "!ACFREMON.S.F00 && !ACFREMON.S.F01" response: value: 0 constraints: diff --git a/src/app/tests/suites/certification/Test_TC_ACFREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_ACFREMON_2_1.yaml index 798cefd703f771..b3a1fa14045a8b 100644 --- a/src/app/tests/suites/certification/Test_TC_ACFREMON_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACFREMON_2_1.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2023 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. @@ -20,7 +20,6 @@ PICS: config: nodeId: 0x12344321 cluster: "Activated Carbon Filter Monitoring" - # todo: is this correctly spelled? endpoint: 1 tests: diff --git a/src/app/tests/suites/certification/Test_TC_CFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_CFREMON_1_1.yaml index 51188a5143a239..5de308eae7326c 100644 --- a/src/app/tests/suites/certification/Test_TC_CFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CFREMON_1_1.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2023 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. @@ -42,7 +42,7 @@ tests: - label: "Read the global attribute: FeatureMap" command: "readAttribute" attribute: "FeatureMap" - PICS: " !CFREMON.S.F00 && !CFREMON.S.F01" + PICS: "!CFREMON.S.F00 && !CFREMON.S.F01" response: value: 0 constraints: diff --git a/src/app/tests/suites/certification/Test_TC_CFREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_CFREMON_2_1.yaml index 58a0e23726efca..4d98d1f40e2d2a 100644 --- a/src/app/tests/suites/certification/Test_TC_CFREMON_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CFREMON_2_1.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2023 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. @@ -20,7 +20,6 @@ PICS: config: nodeId: 0x12344321 cluster: "Ceramic Filter Monitoring" - # todo: is this correctly spelled? endpoint: 1 tests: diff --git a/src/app/tests/suites/certification/Test_TC_ESFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_ESFREMON_1_1.yaml index 443c7e54770dbb..c3c6af8cbb91a4 100644 --- a/src/app/tests/suites/certification/Test_TC_ESFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ESFREMON_1_1.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2023 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. @@ -42,7 +42,7 @@ tests: - label: "Read the global attribute: FeatureMap" command: "readAttribute" attribute: "FeatureMap" - PICS: " !ESFREMON.S.F00 && !ESFREMON.S.F01" + PICS: "!ESFREMON.S.F00 && !ESFREMON.S.F01" response: value: 0 constraints: diff --git a/src/app/tests/suites/certification/Test_TC_ESFREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_ESFREMON_2_1.yaml index 22696949e64860..9fccbc32d10826 100644 --- a/src/app/tests/suites/certification/Test_TC_ESFREMON_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ESFREMON_2_1.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2023 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. @@ -20,7 +20,6 @@ PICS: config: nodeId: 0x12344321 cluster: "Electrostatic Filter Monitoring" - # todo: is this correctly spelled? endpoint: 1 tests: diff --git a/src/app/tests/suites/certification/Test_TC_FTREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_FTREMON_1_1.yaml index 81973082cc71e8..47b9c896c735db 100644 --- a/src/app/tests/suites/certification/Test_TC_FTREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_FTREMON_1_1.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2023 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. @@ -42,7 +42,7 @@ tests: - label: "Read the global attribute: FeatureMap" command: "readAttribute" attribute: "FeatureMap" - PICS: " !FTREMON.S.F00 && !FTREMON.S.F01" + PICS: "!FTREMON.S.F00 && !FTREMON.S.F01" response: value: 0 constraints: diff --git a/src/app/tests/suites/certification/Test_TC_FTREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_FTREMON_2_1.yaml index 9726c49d993c22..864fff73f2535f 100644 --- a/src/app/tests/suites/certification/Test_TC_FTREMON_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_FTREMON_2_1.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2023 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. @@ -20,7 +20,6 @@ PICS: config: nodeId: 0x12344321 cluster: "Fuel Tank Monitoring" - # todo: is this correctly spelled? endpoint: 1 tests: diff --git a/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml index 6cfde236881b4c..6eeff123cfde65 100644 --- a/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2023 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. @@ -42,7 +42,7 @@ tests: - label: "Read the global attribute: FeatureMap" command: "readAttribute" attribute: "FeatureMap" - PICS: " !HEPAFREMON.S.F00 && !HEPAFREMON.S.F01" + PICS: "!HEPAFREMON.S.F00 && !HEPAFREMON.S.F01" response: value: 0 constraints: diff --git a/src/app/tests/suites/certification/Test_TC_HEPAFREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_HEPAFREMON_2_1.yaml index 7e8627040ede0e..af9f1c26218e71 100644 --- a/src/app/tests/suites/certification/Test_TC_HEPAFREMON_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_HEPAFREMON_2_1.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2023 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. @@ -20,7 +20,6 @@ PICS: config: nodeId: 0x12344321 cluster: "HEPA Filter Monitoring" - # todo: is this correctly spelled? endpoint: 1 tests: diff --git a/src/app/tests/suites/certification/Test_TC_INKCREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_INKCREMON_1_1.yaml index d015e50e68b897..04c49ee78c7cb3 100644 --- a/src/app/tests/suites/certification/Test_TC_INKCREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_INKCREMON_1_1.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2023 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. @@ -42,7 +42,7 @@ tests: - label: "Read the global attribute: FeatureMap" command: "readAttribute" attribute: "FeatureMap" - PICS: " !INKCREMON.S.F00 && !INKCREMON.S.F01" + PICS: "!INKCREMON.S.F00 && !INKCREMON.S.F01" response: value: 0 constraints: diff --git a/src/app/tests/suites/certification/Test_TC_INKCREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_INKCREMON_2_1.yaml index 07de48db7f6bde..b2be9f2b8eeae7 100644 --- a/src/app/tests/suites/certification/Test_TC_INKCREMON_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_INKCREMON_2_1.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2023 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. @@ -20,7 +20,6 @@ PICS: config: nodeId: 0x12344321 cluster: "Ink Cartridge Monitoring" - # todo: is this correctly spelled? endpoint: 1 tests: diff --git a/src/app/tests/suites/certification/Test_TC_IONFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_IONFREMON_1_1.yaml index 35d13629c036d4..cdbe335dc70d85 100644 --- a/src/app/tests/suites/certification/Test_TC_IONFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_IONFREMON_1_1.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2023 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. @@ -42,7 +42,7 @@ tests: - label: "Read the global attribute: FeatureMap" command: "readAttribute" attribute: "FeatureMap" - PICS: " !IONFREMON.S.F00 && !IONFREMON.S.F01" + PICS: "!IONFREMON.S.F00 && !IONFREMON.S.F01" response: value: 0 constraints: diff --git a/src/app/tests/suites/certification/Test_TC_IONFREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_IONFREMON_2_1.yaml index 7045b8157b88a3..4e8dd20e5e9e0e 100644 --- a/src/app/tests/suites/certification/Test_TC_IONFREMON_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_IONFREMON_2_1.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2023 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. @@ -20,7 +20,6 @@ PICS: config: nodeId: 0x12344321 cluster: "Ionizing Filter Monitoring" - # todo: is this correctly spelled? endpoint: 1 tests: diff --git a/src/app/tests/suites/certification/Test_TC_OZFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_OZFREMON_1_1.yaml index 678707ddcea69a..8c8b30bec13d6b 100644 --- a/src/app/tests/suites/certification/Test_TC_OZFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_OZFREMON_1_1.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2023 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. @@ -42,7 +42,7 @@ tests: - label: "Read the global attribute: FeatureMap" command: "readAttribute" attribute: "FeatureMap" - PICS: " !OZFREMON.S.F00 && !OZFREMON.S.F01" + PICS: "!OZFREMON.S.F00 && !OZFREMON.S.F01" response: value: 0 constraints: diff --git a/src/app/tests/suites/certification/Test_TC_OZFREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_OZFREMON_2_1.yaml index 7e38963bf1dc7d..485746f366cd00 100644 --- a/src/app/tests/suites/certification/Test_TC_OZFREMON_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_OZFREMON_2_1.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2023 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. @@ -20,7 +20,6 @@ PICS: config: nodeId: 0x12344321 cluster: "Ozone Filter Monitoring" - # todo: is this correctly spelled? endpoint: 1 tests: diff --git a/src/app/tests/suites/certification/Test_TC_TCREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_TCREMON_1_1.yaml index 02fb9cbeb78ee9..65d0293f647b81 100644 --- a/src/app/tests/suites/certification/Test_TC_TCREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCREMON_1_1.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2023 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. @@ -42,7 +42,7 @@ tests: - label: "Read the global attribute: FeatureMap" command: "readAttribute" attribute: "FeatureMap" - PICS: " !TCREMON.S.F00 && !TCREMON.S.F01" + PICS: "!TCREMON.S.F00 && !TCREMON.S.F01" response: value: 0 constraints: diff --git a/src/app/tests/suites/certification/Test_TC_TCREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_TCREMON_2_1.yaml index 8433b67a7fd2e4..6fec88313ff8e3 100644 --- a/src/app/tests/suites/certification/Test_TC_TCREMON_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCREMON_2_1.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2023 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. @@ -20,7 +20,6 @@ PICS: config: nodeId: 0x12344321 cluster: "Toner Cartridge Monitoring" - # todo: is this correctly spelled? endpoint: 1 tests: diff --git a/src/app/tests/suites/certification/Test_TC_UVFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_UVFREMON_1_1.yaml index 93a14b30200473..c764cead8248d2 100644 --- a/src/app/tests/suites/certification/Test_TC_UVFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_UVFREMON_1_1.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2023 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. @@ -42,7 +42,7 @@ tests: - label: "Read the global attribute: FeatureMap" command: "readAttribute" attribute: "FeatureMap" - PICS: " !UVFREMON.S.F00 && !UVFREMON.S.F01" + PICS: "!UVFREMON.S.F00 && !UVFREMON.S.F01" response: value: 0 constraints: diff --git a/src/app/tests/suites/certification/Test_TC_UVFREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_UVFREMON_2_1.yaml index 54cbcf446f9958..39eb219fec51c1 100644 --- a/src/app/tests/suites/certification/Test_TC_UVFREMON_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_UVFREMON_2_1.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2023 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. @@ -20,7 +20,6 @@ PICS: config: nodeId: 0x12344321 cluster: "UV Filter Monitoring" - # todo: is this correctly spelled? endpoint: 1 tests: diff --git a/src/app/tests/suites/certification/Test_TC_WTREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_WTREMON_1_1.yaml index ef5097cf59dcc4..5bb80f63044a4d 100644 --- a/src/app/tests/suites/certification/Test_TC_WTREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_WTREMON_1_1.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2023 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. @@ -42,7 +42,7 @@ tests: - label: "Read the global attribute: FeatureMap" command: "readAttribute" attribute: "FeatureMap" - PICS: " !WTREMON.S.F00 && !WTREMON.S.F01" + PICS: "!WTREMON.S.F00 && !WTREMON.S.F01" response: value: 0 constraints: diff --git a/src/app/tests/suites/certification/Test_TC_WTREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_WTREMON_2_1.yaml index f41ffef4b4fe3a..717ec77a4e9a10 100644 --- a/src/app/tests/suites/certification/Test_TC_WTREMON_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_WTREMON_2_1.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2023 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. @@ -20,7 +20,6 @@ PICS: config: nodeId: 0x12344321 cluster: "Water Tank Monitoring" - # todo: is this correctly spelled? endpoint: 1 tests: diff --git a/src/app/tests/suites/certification/Test_TC_ZEOFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_ZEOFREMON_1_1.yaml index adf36147e3ca46..6e74849ca4af85 100644 --- a/src/app/tests/suites/certification/Test_TC_ZEOFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ZEOFREMON_1_1.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2023 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. @@ -42,7 +42,7 @@ tests: - label: "Read the global attribute: FeatureMap" command: "readAttribute" attribute: "FeatureMap" - PICS: " !ZEOFREMON.S.F00 && !ZEOFREMON.S.F01" + PICS: "!ZEOFREMON.S.F00 && !ZEOFREMON.S.F01" response: value: 0 constraints: diff --git a/src/app/tests/suites/certification/Test_TC_ZEOFREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_ZEOFREMON_2_1.yaml index 0ebbdecde5d11c..73fce963100c64 100644 --- a/src/app/tests/suites/certification/Test_TC_ZEOFREMON_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ZEOFREMON_2_1.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2023 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. @@ -20,7 +20,6 @@ PICS: config: nodeId: 0x12344321 cluster: "Zeolite Filter Monitoring" - # todo: is this correctly spelled? endpoint: 1 tests: From 1bb2806c2b911b81bc97d8f9bfef4791b3c762b8 Mon Sep 17 00:00:00 2001 From: Graf Tobias <4622393+tobiasgraf@users.noreply.github.com> Date: Fri, 26 May 2023 16:42:56 +0200 Subject: [PATCH 08/16] Add Replaceable Monitoring Ci-pics-values --- .../tests/suites/certification/ci-pics-values | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index 3cb6b999f9ea01..1e34960f822e62 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -2093,3 +2093,99 @@ TIMESYNC.S.C04.Rsp=1 TIMESYNC.S.C05.Rsp=1 TIMESYNC.S.C03.Tx=1 TIMESYNC.C=0 + +# HEPA Filter Monitoring Cluster +HEPAFREMON.S.F00=1 +HEPAFREMON.S.F01=1 +HEPAFREMON.S.A0000=1 +HEPAFREMON.S.A0001=1 +HEPAFREMON.S.A0002=1 +HEPAFREMON.S.A0003=1 + +# Activated Carbon Filter Monitoring Cluster +ACFREMON.S.F00=1 +ACFREMON.S.F01=1 +ACFREMON.S.A0000=1 +ACFREMON.S.A0001=1 +ACFREMON.S.A0002=1 +ACFREMON.S.A0003=1 + +# Ceramic Filter Monitoring Cluster +CFREMON.S.F00=1 +CFREMON.S.F01=1 +CFREMON.S.A0000=1 +CFREMON.S.A0001=1 +CFREMON.S.A0002=1 +CFREMON.S.A0003=1 + +# Electrostatic Filter Monitoring Cluster +ESFREMON.S.F00=1 +ESFREMON.S.F01=1 +ESFREMON.S.A0000=1 +ESFREMON.S.A0001=1 +ESFREMON.S.A0002=1 +ESFREMON.S.A0003=1 + +# Fuel Tank Monitoring Cluster +FTREMON.S.F00=1 +FTREMON.S.F01=1 +FTREMON.S.A0000=1 +FTREMON.S.A0001=1 +FTREMON.S.A0002=1 +FTREMON.S.A0003=1 + +# Ink Cartridge Monitoring Cluster +INKCREMON.S.F00=1 +INKCREMON.S.F01=1 +INKCREMON.S.A0000=1 +INKCREMON.S.A0001=1 +INKCREMON.S.A0002=1 +INKCREMON.S.A0003=1 + +# Ionizing Filter Monitoring Cluster +IONFREMON.S.F00=1 +IONFREMON.S.F01=1 +IONFREMON.S.A0000=1 +IONFREMON.S.A0001=1 +IONFREMON.S.A0002=1 +IONFREMON.S.A0003=1 + +# Ozone Filter Monitoring Cluster +OZFREMON.S.F00=1 +OZFREMON.S.F01=1 +OZFREMON.S.A0000=1 +OZFREMON.S.A0001=1 +OZFREMON.S.A0002=1 +OZFREMON.S.A0003=1 + +# Toner Cartridge Monitoring Cluster +TCREMON.S.F00=1 +TCREMON.S.F01=1 +TCREMON.S.A0000=1 +TCREMON.S.A0001=1 +TCREMON.S.A0002=1 +TCREMON.S.A0003=1 + +# UV Filter Monitoring Cluster +UVFREMON.S.F00=1 +UVFREMON.S.F01=1 +UVFREMON.S.A0000=1 +UVFREMON.S.A0001=1 +UVFREMON.S.A0002=1 +UVFREMON.S.A0003=1 + +# Water Tank Monitoring Cluster +WTREMON.S.F00=1 +WTREMON.S.F01=1 +WTREMON.S.A0000=1 +WTREMON.S.A0001=1 +WTREMON.S.A0002=1 +WTREMON.S.A0003=1 + +# Zeolite Filter Monitoring Cluster +ZEOFREMON.S.F00=1 +ZEOFREMON.S.F01=1 +ZEOFREMON.S.A0000=1 +ZEOFREMON.S.A0001=1 +ZEOFREMON.S.A0002=1 +ZEOFREMON.S.A0003=1 From 687f28125b7231b124ec6f2d442c240689b83648 Mon Sep 17 00:00:00 2001 From: Graf Tobias <4622393+tobiasgraf@users.noreply.github.com> Date: Fri, 26 May 2023 17:01:09 +0200 Subject: [PATCH 09/16] Update Generated Code --- .../chip-tool/zap-generated/test/Commands.h | 24 +++++++++---------- .../zap-generated/test/Commands.h | 24 +++++++++---------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 0347678e40f2c4..7c87f7b3484ff8 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -95866,7 +95866,7 @@ class Test_TC_ACFREMON_1_1Suite : public TestCommand } case 2: { LogStep(2, "Read the global attribute: FeatureMap"); - VerifyOrDo(!ShouldSkip(" !ACFREMON.S.F00 && !ACFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("!ACFREMON.S.F00 && !ACFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, ActivatedCarbonFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); } @@ -96206,7 +96206,7 @@ class Test_TC_CFREMON_1_1Suite : public TestCommand } case 2: { LogStep(2, "Read the global attribute: FeatureMap"); - VerifyOrDo(!ShouldSkip(" !CFREMON.S.F00 && !CFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("!CFREMON.S.F00 && !CFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CeramicFilterMonitoring::Id, CeramicFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); } @@ -96546,7 +96546,7 @@ class Test_TC_ESFREMON_1_1Suite : public TestCommand } case 2: { LogStep(2, "Read the global attribute: FeatureMap"); - VerifyOrDo(!ShouldSkip(" !ESFREMON.S.F00 && !ESFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("!ESFREMON.S.F00 && !ESFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ElectrostaticFilterMonitoring::Id, ElectrostaticFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); } @@ -96886,7 +96886,7 @@ class Test_TC_FTREMON_1_1Suite : public TestCommand } case 2: { LogStep(2, "Read the global attribute: FeatureMap"); - VerifyOrDo(!ShouldSkip(" !FTREMON.S.F00 && !FTREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("!FTREMON.S.F00 && !FTREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FuelTankMonitoring::Id, FuelTankMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); } @@ -97226,7 +97226,7 @@ class Test_TC_HEPAFREMON_1_1Suite : public TestCommand } case 2: { LogStep(2, "Read the global attribute: FeatureMap"); - VerifyOrDo(!ShouldSkip(" !HEPAFREMON.S.F00 && !HEPAFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("!HEPAFREMON.S.F00 && !HEPAFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, HepaFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); } @@ -97566,7 +97566,7 @@ class Test_TC_INKCREMON_1_1Suite : public TestCommand } case 2: { LogStep(2, "Read the global attribute: FeatureMap"); - VerifyOrDo(!ShouldSkip(" !INKCREMON.S.F00 && !INKCREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("!INKCREMON.S.F00 && !INKCREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), InkCartridgeMonitoring::Id, InkCartridgeMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); } @@ -97906,7 +97906,7 @@ class Test_TC_IONFREMON_1_1Suite : public TestCommand } case 2: { LogStep(2, "Read the global attribute: FeatureMap"); - VerifyOrDo(!ShouldSkip(" !IONFREMON.S.F00 && !IONFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("!IONFREMON.S.F00 && !IONFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IonizingFilterMonitoring::Id, IonizingFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); } @@ -98246,7 +98246,7 @@ class Test_TC_OZFREMON_1_1Suite : public TestCommand } case 2: { LogStep(2, "Read the global attribute: FeatureMap"); - VerifyOrDo(!ShouldSkip(" !OZFREMON.S.F00 && !OZFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("!OZFREMON.S.F00 && !OZFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneFilterMonitoring::Id, OzoneFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); } @@ -98586,7 +98586,7 @@ class Test_TC_TCREMON_1_1Suite : public TestCommand } case 2: { LogStep(2, "Read the global attribute: FeatureMap"); - VerifyOrDo(!ShouldSkip(" !TCREMON.S.F00 && !TCREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("!TCREMON.S.F00 && !TCREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TonerCartridgeMonitoring::Id, TonerCartridgeMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); } @@ -98926,7 +98926,7 @@ class Test_TC_UVFREMON_1_1Suite : public TestCommand } case 2: { LogStep(2, "Read the global attribute: FeatureMap"); - VerifyOrDo(!ShouldSkip(" !UVFREMON.S.F00 && !UVFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("!UVFREMON.S.F00 && !UVFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UvFilterMonitoring::Id, UvFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); } @@ -99266,7 +99266,7 @@ class Test_TC_WTREMON_1_1Suite : public TestCommand } case 2: { LogStep(2, "Read the global attribute: FeatureMap"); - VerifyOrDo(!ShouldSkip(" !WTREMON.S.F00 && !WTREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("!WTREMON.S.F00 && !WTREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WaterTankMonitoring::Id, WaterTankMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); } @@ -99606,7 +99606,7 @@ class Test_TC_ZEOFREMON_1_1Suite : public TestCommand } case 2: { LogStep(2, "Read the global attribute: FeatureMap"); - VerifyOrDo(!ShouldSkip(" !ZEOFREMON.S.F00 && !ZEOFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("!ZEOFREMON.S.F00 && !ZEOFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ZeoliteFilterMonitoring::Id, ZeoliteFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); } diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index 45ea9f122b6dbf..7547b0cee0b3be 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -145902,7 +145902,7 @@ class Test_TC_ACFREMON_1_1 : public TestCommandBridge { break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); - if (ShouldSkip(" !ACFREMON.S.F00 && !ACFREMON.S.F01")) { + if (ShouldSkip("!ACFREMON.S.F00 && !ACFREMON.S.F01")) { NextTest(); return; } @@ -146511,7 +146511,7 @@ class Test_TC_CFREMON_1_1 : public TestCommandBridge { break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); - if (ShouldSkip(" !CFREMON.S.F00 && !CFREMON.S.F01")) { + if (ShouldSkip("!CFREMON.S.F00 && !CFREMON.S.F01")) { NextTest(); return; } @@ -147120,7 +147120,7 @@ class Test_TC_ESFREMON_1_1 : public TestCommandBridge { break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); - if (ShouldSkip(" !ESFREMON.S.F00 && !ESFREMON.S.F01")) { + if (ShouldSkip("!ESFREMON.S.F00 && !ESFREMON.S.F01")) { NextTest(); return; } @@ -147729,7 +147729,7 @@ class Test_TC_FTREMON_1_1 : public TestCommandBridge { break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); - if (ShouldSkip(" !FTREMON.S.F00 && !FTREMON.S.F01")) { + if (ShouldSkip("!FTREMON.S.F00 && !FTREMON.S.F01")) { NextTest(); return; } @@ -148338,7 +148338,7 @@ class Test_TC_HEPAFREMON_1_1 : public TestCommandBridge { break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); - if (ShouldSkip(" !HEPAFREMON.S.F00 && !HEPAFREMON.S.F01")) { + if (ShouldSkip("!HEPAFREMON.S.F00 && !HEPAFREMON.S.F01")) { NextTest(); return; } @@ -148947,7 +148947,7 @@ class Test_TC_INKCREMON_1_1 : public TestCommandBridge { break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); - if (ShouldSkip(" !INKCREMON.S.F00 && !INKCREMON.S.F01")) { + if (ShouldSkip("!INKCREMON.S.F00 && !INKCREMON.S.F01")) { NextTest(); return; } @@ -149556,7 +149556,7 @@ class Test_TC_IONFREMON_1_1 : public TestCommandBridge { break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); - if (ShouldSkip(" !IONFREMON.S.F00 && !IONFREMON.S.F01")) { + if (ShouldSkip("!IONFREMON.S.F00 && !IONFREMON.S.F01")) { NextTest(); return; } @@ -150165,7 +150165,7 @@ class Test_TC_OZFREMON_1_1 : public TestCommandBridge { break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); - if (ShouldSkip(" !OZFREMON.S.F00 && !OZFREMON.S.F01")) { + if (ShouldSkip("!OZFREMON.S.F00 && !OZFREMON.S.F01")) { NextTest(); return; } @@ -150774,7 +150774,7 @@ class Test_TC_TCREMON_1_1 : public TestCommandBridge { break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); - if (ShouldSkip(" !TCREMON.S.F00 && !TCREMON.S.F01")) { + if (ShouldSkip("!TCREMON.S.F00 && !TCREMON.S.F01")) { NextTest(); return; } @@ -151383,7 +151383,7 @@ class Test_TC_UVFREMON_1_1 : public TestCommandBridge { break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); - if (ShouldSkip(" !UVFREMON.S.F00 && !UVFREMON.S.F01")) { + if (ShouldSkip("!UVFREMON.S.F00 && !UVFREMON.S.F01")) { NextTest(); return; } @@ -151992,7 +151992,7 @@ class Test_TC_WTREMON_1_1 : public TestCommandBridge { break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); - if (ShouldSkip(" !WTREMON.S.F00 && !WTREMON.S.F01")) { + if (ShouldSkip("!WTREMON.S.F00 && !WTREMON.S.F01")) { NextTest(); return; } @@ -152601,7 +152601,7 @@ class Test_TC_ZEOFREMON_1_1 : public TestCommandBridge { break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); - if (ShouldSkip(" !ZEOFREMON.S.F00 && !ZEOFREMON.S.F01")) { + if (ShouldSkip("!ZEOFREMON.S.F00 && !ZEOFREMON.S.F01")) { NextTest(); return; } From f8b5f38a4e05a3cf560919af0d650f205ae79b02 Mon Sep 17 00:00:00 2001 From: Graf Tobias <4622393+tobiasgraf@users.noreply.github.com> Date: Fri, 26 May 2023 17:10:22 +0200 Subject: [PATCH 10/16] Update Replaceable Monitoring Ci-pics-values --- .../tests/suites/certification/ci-pics-values | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index 1e34960f822e62..e35c4cad234691 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -2095,6 +2095,8 @@ TIMESYNC.S.C03.Tx=1 TIMESYNC.C=0 # HEPA Filter Monitoring Cluster +HEPAFREMON.S=1 +HEPAFREMON.C=0 HEPAFREMON.S.F00=1 HEPAFREMON.S.F01=1 HEPAFREMON.S.A0000=1 @@ -2103,6 +2105,8 @@ HEPAFREMON.S.A0002=1 HEPAFREMON.S.A0003=1 # Activated Carbon Filter Monitoring Cluster +ACFREMON.S=1 +ACFREMON.C=0 ACFREMON.S.F00=1 ACFREMON.S.F01=1 ACFREMON.S.A0000=1 @@ -2111,6 +2115,8 @@ ACFREMON.S.A0002=1 ACFREMON.S.A0003=1 # Ceramic Filter Monitoring Cluster +CFREMON.S=1 +CFREMON.C=0 CFREMON.S.F00=1 CFREMON.S.F01=1 CFREMON.S.A0000=1 @@ -2119,6 +2125,8 @@ CFREMON.S.A0002=1 CFREMON.S.A0003=1 # Electrostatic Filter Monitoring Cluster +ESFREMON.S=1 +ESFREMON.C=0 ESFREMON.S.F00=1 ESFREMON.S.F01=1 ESFREMON.S.A0000=1 @@ -2127,6 +2135,8 @@ ESFREMON.S.A0002=1 ESFREMON.S.A0003=1 # Fuel Tank Monitoring Cluster +FTREMON.S=1 +FTREMON.C=0 FTREMON.S.F00=1 FTREMON.S.F01=1 FTREMON.S.A0000=1 @@ -2135,6 +2145,8 @@ FTREMON.S.A0002=1 FTREMON.S.A0003=1 # Ink Cartridge Monitoring Cluster +INKCREMON.S=1 +INKCREMON.C=0 INKCREMON.S.F00=1 INKCREMON.S.F01=1 INKCREMON.S.A0000=1 @@ -2143,6 +2155,8 @@ INKCREMON.S.A0002=1 INKCREMON.S.A0003=1 # Ionizing Filter Monitoring Cluster +IONFREMON.S=1 +IONFREMON.C=0 IONFREMON.S.F00=1 IONFREMON.S.F01=1 IONFREMON.S.A0000=1 @@ -2151,6 +2165,8 @@ IONFREMON.S.A0002=1 IONFREMON.S.A0003=1 # Ozone Filter Monitoring Cluster +OZFREMON.S=1 +OZFREMON.C=0 OZFREMON.S.F00=1 OZFREMON.S.F01=1 OZFREMON.S.A0000=1 @@ -2159,6 +2175,8 @@ OZFREMON.S.A0002=1 OZFREMON.S.A0003=1 # Toner Cartridge Monitoring Cluster +TCREMON.S=1 +TCREMON.C=0 TCREMON.S.F00=1 TCREMON.S.F01=1 TCREMON.S.A0000=1 @@ -2167,6 +2185,8 @@ TCREMON.S.A0002=1 TCREMON.S.A0003=1 # UV Filter Monitoring Cluster +UVFREMON.S=1 +UVFREMON.C=0 UVFREMON.S.F00=1 UVFREMON.S.F01=1 UVFREMON.S.A0000=1 @@ -2175,6 +2195,8 @@ UVFREMON.S.A0002=1 UVFREMON.S.A0003=1 # Water Tank Monitoring Cluster +WTREMON.S=1 +WTREMON.C=0 WTREMON.S.F00=1 WTREMON.S.F01=1 WTREMON.S.A0000=1 @@ -2183,6 +2205,8 @@ WTREMON.S.A0002=1 WTREMON.S.A0003=1 # Zeolite Filter Monitoring Cluster +ZEOFREMON.S=1 +ZEOFREMON.C=0 ZEOFREMON.S.F00=1 ZEOFREMON.S.F01=1 ZEOFREMON.S.A0000=1 From 177db43380b8b6e521da250950ce7c9fb1fb2ffd Mon Sep 17 00:00:00 2001 From: Graf Tobias <4622393+tobiasgraf@users.noreply.github.com> Date: Fri, 26 May 2023 17:16:59 +0200 Subject: [PATCH 11/16] Apply restyler patch --- src/app/tests/suites/certification/PICS.yaml | 96 ++++++++++++++----- .../certification/Test_TC_ACFREMON_1_1.yaml | 11 ++- .../certification/Test_TC_CFREMON_1_1.yaml | 11 ++- .../certification/Test_TC_ESFREMON_1_1.yaml | 11 ++- .../certification/Test_TC_FTREMON_1_1.yaml | 11 ++- .../certification/Test_TC_HEPAFREMON_1_1.yaml | 12 ++- .../certification/Test_TC_INKCREMON_1_1.yaml | 12 ++- .../certification/Test_TC_IONFREMON_1_1.yaml | 12 ++- .../certification/Test_TC_OZFREMON_1_1.yaml | 11 ++- .../certification/Test_TC_TCREMON_1_1.yaml | 11 ++- .../certification/Test_TC_UVFREMON_1_1.yaml | 11 ++- .../certification/Test_TC_WTREMON_1_1.yaml | 11 ++- .../certification/Test_TC_ZEOFREMON_1_1.yaml | 12 ++- 13 files changed, 172 insertions(+), 60 deletions(-) diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index 4e5183ad78b947..da48a40c0e0177 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -3752,10 +3752,14 @@ PICS: id: G.C.C05.Tx # HEPA Filter Monitoring Cluster Test Plan - - label: "Does the device implement the HEPA Filter Monitoring cluster as a server?" + - label: + "Does the device implement the HEPA Filter Monitoring cluster as a + server?" id: HEPAFREMON.S - - label: "Does the device implement the HEPA Filter Monitoring cluster as a client?" + - label: + "Does the device implement the HEPA Filter Monitoring cluster as a + client?" id: HEPAFREMON.C # @@ -3783,10 +3787,14 @@ PICS: id: HEPAFREMON.S.F01 # Activated Carbon Filter Monitoring Cluster Test Plan - - label: "Does the device implement the Activated Carbon Filter Monitoring cluster as a server?" + - label: + "Does the device implement the Activated Carbon Filter Monitoring + cluster as a server?" id: ACFREMON.S - - label: "Does the device implement the Activated Carbon Filter Monitoring cluster as a client?" + - label: + "Does the device implement the Activated Carbon Filter Monitoring + cluster as a client?" id: ACFREMON.C # @@ -3814,10 +3822,14 @@ PICS: id: ACFREMON.S.F01 # Ceramic Filter Monitoring Cluster Test Plan - - label: "Does the device implement the Ceramic Filter Monitoring cluster as a server?" + - label: + "Does the device implement the Ceramic Filter Monitoring cluster as a + server?" id: CFREMON.S - - label: "Does the device implement the Ceramic Filter Monitoring cluster as a client?" + - label: + "Does the device implement the Ceramic Filter Monitoring cluster as a + client?" id: CFREMON.C # @@ -3845,10 +3857,14 @@ PICS: id: CFREMON.S.F01 # Electrostatic Filter Monitoring Cluster Test Plan - - label: "Does the device implement the Electrostatic Filter Monitoring cluster as a server?" + - label: + "Does the device implement the Electrostatic Filter Monitoring cluster + as a server?" id: ESFREMON.S - - label: "Does the device implement the Electrostatic Filter Monitoring cluster as a client?" + - label: + "Does the device implement the Electrostatic Filter Monitoring cluster + as a client?" id: ESFREMON.C # @@ -3876,10 +3892,14 @@ PICS: id: ESFREMON.S.F01 # Fuel Tank Monitoring Cluster Test Plan - - label: "Does the device implement the Fuel Tank Monitoring cluster as a server?" + - label: + "Does the device implement the Fuel Tank Monitoring cluster as a + server?" id: FTREMON.S - - label: "Does the device implement the Fuel Tank Monitoring cluster as a client?" + - label: + "Does the device implement the Fuel Tank Monitoring cluster as a + client?" id: FTREMON.C # @@ -3907,10 +3927,14 @@ PICS: id: FTREMON.S.F01 # Ink Cartridge Monitoring Cluster Test Plan - - label: "Does the device implement the Ink Cartridge Monitoring cluster as a server?" + - label: + "Does the device implement the Ink Cartridge Monitoring cluster as a + server?" id: INKCREMON.S - - label: "Does the device implement the Ink Cartridge Monitoring cluster as a client?" + - label: + "Does the device implement the Ink Cartridge Monitoring cluster as a + client?" id: INKCREMON.C # @@ -3938,10 +3962,14 @@ PICS: id: INKCREMON.S.F01 # Ionizing Filter Monitoring Cluster Test Plan - - label: "Does the device implement the Ionizing Filter Monitoring cluster as a server?" + - label: + "Does the device implement the Ionizing Filter Monitoring cluster as a + server?" id: IONFREMON.S - - label: "Does the device implement the Ionizing Filter Monitoring cluster as a client?" + - label: + "Does the device implement the Ionizing Filter Monitoring cluster as a + client?" id: IONFREMON.C # @@ -3969,10 +3997,14 @@ PICS: id: IONFREMON.S.F01 # Ozone Filter Monitoring Cluster Test Plan - - label: "Does the device implement the Ozone Filter Monitoring cluster as a server?" + - label: + "Does the device implement the Ozone Filter Monitoring cluster as a + server?" id: OZFREMON.S - - label: "Does the device implement the Ozone Filter Monitoring cluster as a client?" + - label: + "Does the device implement the Ozone Filter Monitoring cluster as a + client?" id: OZFREMON.C # @@ -4000,10 +4032,14 @@ PICS: id: OZFREMON.S.F01 # Toner Cartridge Monitoring Cluster Test Plan - - label: "Does the device implement the Toner Cartridge Monitoring cluster as a server?" + - label: + "Does the device implement the Toner Cartridge Monitoring cluster as a + server?" id: TCREMON.S - - label: "Does the device implement the Toner Cartridge Monitoring cluster as a client?" + - label: + "Does the device implement the Toner Cartridge Monitoring cluster as a + client?" id: TCREMON.C # @@ -4031,10 +4067,14 @@ PICS: id: TCREMON.S.F01 # UV Filter Monitoring Cluster Test Plan - - label: "Does the device implement the UV Filter Monitoring cluster as a server?" + - label: + "Does the device implement the UV Filter Monitoring cluster as a + server?" id: UVFREMON.S - - label: "Does the device implement the UV Filter Monitoring cluster as a client?" + - label: + "Does the device implement the UV Filter Monitoring cluster as a + client?" id: UVFREMON.C # @@ -4062,10 +4102,14 @@ PICS: id: UVFREMON.S.F01 # Water Tank Monitoring Cluster Test Plan - - label: "Does the device implement the Water Tank Monitoring cluster as a server?" + - label: + "Does the device implement the Water Tank Monitoring cluster as a + server?" id: WTREMON.S - - label: "Does the device implement the Water Tank Monitoring cluster as a client?" + - label: + "Does the device implement the Water Tank Monitoring cluster as a + client?" id: WTREMON.C # @@ -4093,10 +4137,14 @@ PICS: id: WTREMON.S.F01 # Zeolite Filter Monitoring Cluster Test Plan - - label: "Does the device implement the Zeolite Filter Monitoring cluster as a server?" + - label: + "Does the device implement the Zeolite Filter Monitoring cluster as a + server?" id: ZEOFREMON.S - - label: "Does the device implement the Zeolite Filter Monitoring cluster as a client?" + - label: + "Does the device implement the Zeolite Filter Monitoring cluster as a + client?" id: ZEOFREMON.C # diff --git a/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml index ed7e3f796e9693..bb9a8c013a10b4 100644 --- a/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml @@ -48,7 +48,9 @@ tests: constraints: type: bitmap32 - - label: "Given ACFREMON.S.F00(Condition) ensure featuremap has the correct bit set" + - label: + "Given ACFREMON.S.F00(Condition) ensure featuremap has the correct bit + set" command: "readAttribute" attribute: "FeatureMap" PICS: ACFREMON.S.F00 @@ -57,7 +59,9 @@ tests: type: bitmap32 hasMasksSet: [0x1] - - label: "Given ACFREMON.S.F01(Warning) ensure featuremap has the correct bit set" + - label: + "Given ACFREMON.S.F01(Warning) ensure featuremap has the correct bit + set" command: "readAttribute" attribute: "FeatureMap" PICS: ACFREMON.S.F01 @@ -74,7 +78,8 @@ tests: type: list contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] - - label: "Read the feature dependent(ACFREMON.S.F00) attribute in AttributeList" + - label: + "Read the feature dependent(ACFREMON.S.F00) attribute in AttributeList" PICS: ACFREMON.S.F00 command: "readAttribute" attribute: "AttributeList" diff --git a/src/app/tests/suites/certification/Test_TC_CFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_CFREMON_1_1.yaml index 5de308eae7326c..8d18a5af8dc5dd 100644 --- a/src/app/tests/suites/certification/Test_TC_CFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CFREMON_1_1.yaml @@ -48,7 +48,9 @@ tests: constraints: type: bitmap32 - - label: "Given CFREMON.S.F00(Condition) ensure featuremap has the correct bit set" + - label: + "Given CFREMON.S.F00(Condition) ensure featuremap has the correct bit + set" command: "readAttribute" attribute: "FeatureMap" PICS: CFREMON.S.F00 @@ -57,7 +59,9 @@ tests: type: bitmap32 hasMasksSet: [0x1] - - label: "Given CFREMON.S.F01(Warning) ensure featuremap has the correct bit set" + - label: + "Given CFREMON.S.F01(Warning) ensure featuremap has the correct bit + set" command: "readAttribute" attribute: "FeatureMap" PICS: CFREMON.S.F01 @@ -74,7 +78,8 @@ tests: type: list contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] - - label: "Read the feature dependent(CFREMON.S.F00) attribute in AttributeList" + - label: + "Read the feature dependent(CFREMON.S.F00) attribute in AttributeList" PICS: CFREMON.S.F00 command: "readAttribute" attribute: "AttributeList" diff --git a/src/app/tests/suites/certification/Test_TC_ESFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_ESFREMON_1_1.yaml index c3c6af8cbb91a4..196c9d0c6523e6 100644 --- a/src/app/tests/suites/certification/Test_TC_ESFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ESFREMON_1_1.yaml @@ -48,7 +48,9 @@ tests: constraints: type: bitmap32 - - label: "Given ESFREMON.S.F00(Condition) ensure featuremap has the correct bit set" + - label: + "Given ESFREMON.S.F00(Condition) ensure featuremap has the correct bit + set" command: "readAttribute" attribute: "FeatureMap" PICS: ESFREMON.S.F00 @@ -57,7 +59,9 @@ tests: type: bitmap32 hasMasksSet: [0x1] - - label: "Given ESFREMON.S.F01(Warning) ensure featuremap has the correct bit set" + - label: + "Given ESFREMON.S.F01(Warning) ensure featuremap has the correct bit + set" command: "readAttribute" attribute: "FeatureMap" PICS: ESFREMON.S.F01 @@ -74,7 +78,8 @@ tests: type: list contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] - - label: "Read the feature dependent(ESFREMON.S.F00) attribute in AttributeList" + - label: + "Read the feature dependent(ESFREMON.S.F00) attribute in AttributeList" PICS: ESFREMON.S.F00 command: "readAttribute" attribute: "AttributeList" diff --git a/src/app/tests/suites/certification/Test_TC_FTREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_FTREMON_1_1.yaml index 47b9c896c735db..5bb3fb421e7964 100644 --- a/src/app/tests/suites/certification/Test_TC_FTREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_FTREMON_1_1.yaml @@ -48,7 +48,9 @@ tests: constraints: type: bitmap32 - - label: "Given FTREMON.S.F00(Condition) ensure featuremap has the correct bit set" + - label: + "Given FTREMON.S.F00(Condition) ensure featuremap has the correct bit + set" command: "readAttribute" attribute: "FeatureMap" PICS: FTREMON.S.F00 @@ -57,7 +59,9 @@ tests: type: bitmap32 hasMasksSet: [0x1] - - label: "Given FTREMON.S.F01(Warning) ensure featuremap has the correct bit set" + - label: + "Given FTREMON.S.F01(Warning) ensure featuremap has the correct bit + set" command: "readAttribute" attribute: "FeatureMap" PICS: FTREMON.S.F01 @@ -74,7 +78,8 @@ tests: type: list contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] - - label: "Read the feature dependent(FTREMON.S.F00) attribute in AttributeList" + - label: + "Read the feature dependent(FTREMON.S.F00) attribute in AttributeList" PICS: FTREMON.S.F00 command: "readAttribute" attribute: "AttributeList" diff --git a/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml index 6eeff123cfde65..a21fe054100888 100644 --- a/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml @@ -48,7 +48,9 @@ tests: constraints: type: bitmap32 - - label: "Given HEPAFREMON.S.F00(Condition) ensure featuremap has the correct bit set" + - label: + "Given HEPAFREMON.S.F00(Condition) ensure featuremap has the correct + bit set" command: "readAttribute" attribute: "FeatureMap" PICS: HEPAFREMON.S.F00 @@ -57,7 +59,9 @@ tests: type: bitmap32 hasMasksSet: [0x1] - - label: "Given HEPAFREMON.S.F01(Warning) ensure featuremap has the correct bit set" + - label: + "Given HEPAFREMON.S.F01(Warning) ensure featuremap has the correct bit + set" command: "readAttribute" attribute: "FeatureMap" PICS: HEPAFREMON.S.F01 @@ -74,7 +78,9 @@ tests: type: list contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] - - label: "Read the feature dependent(HEPAFREMON.S.F00) attribute in AttributeList" + - label: + "Read the feature dependent(HEPAFREMON.S.F00) attribute in + AttributeList" PICS: HEPAFREMON.S.F00 command: "readAttribute" attribute: "AttributeList" diff --git a/src/app/tests/suites/certification/Test_TC_INKCREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_INKCREMON_1_1.yaml index 04c49ee78c7cb3..53362e731c6e66 100644 --- a/src/app/tests/suites/certification/Test_TC_INKCREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_INKCREMON_1_1.yaml @@ -48,7 +48,9 @@ tests: constraints: type: bitmap32 - - label: "Given INKCREMON.S.F00(Condition) ensure featuremap has the correct bit set" + - label: + "Given INKCREMON.S.F00(Condition) ensure featuremap has the correct + bit set" command: "readAttribute" attribute: "FeatureMap" PICS: INKCREMON.S.F00 @@ -57,7 +59,9 @@ tests: type: bitmap32 hasMasksSet: [0x1] - - label: "Given INKCREMON.S.F01(Warning) ensure featuremap has the correct bit set" + - label: + "Given INKCREMON.S.F01(Warning) ensure featuremap has the correct bit + set" command: "readAttribute" attribute: "FeatureMap" PICS: INKCREMON.S.F01 @@ -74,7 +78,9 @@ tests: type: list contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] - - label: "Read the feature dependent(INKCREMON.S.F00) attribute in AttributeList" + - label: + "Read the feature dependent(INKCREMON.S.F00) attribute in + AttributeList" PICS: INKCREMON.S.F00 command: "readAttribute" attribute: "AttributeList" diff --git a/src/app/tests/suites/certification/Test_TC_IONFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_IONFREMON_1_1.yaml index cdbe335dc70d85..d23278b7fba51e 100644 --- a/src/app/tests/suites/certification/Test_TC_IONFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_IONFREMON_1_1.yaml @@ -48,7 +48,9 @@ tests: constraints: type: bitmap32 - - label: "Given IONFREMON.S.F00(Condition) ensure featuremap has the correct bit set" + - label: + "Given IONFREMON.S.F00(Condition) ensure featuremap has the correct + bit set" command: "readAttribute" attribute: "FeatureMap" PICS: IONFREMON.S.F00 @@ -57,7 +59,9 @@ tests: type: bitmap32 hasMasksSet: [0x1] - - label: "Given IONFREMON.S.F01(Warning) ensure featuremap has the correct bit set" + - label: + "Given IONFREMON.S.F01(Warning) ensure featuremap has the correct bit + set" command: "readAttribute" attribute: "FeatureMap" PICS: IONFREMON.S.F01 @@ -74,7 +78,9 @@ tests: type: list contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] - - label: "Read the feature dependent(IONFREMON.S.F00) attribute in AttributeList" + - label: + "Read the feature dependent(IONFREMON.S.F00) attribute in + AttributeList" PICS: IONFREMON.S.F00 command: "readAttribute" attribute: "AttributeList" diff --git a/src/app/tests/suites/certification/Test_TC_OZFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_OZFREMON_1_1.yaml index 8c8b30bec13d6b..446e9d8b6bf3a4 100644 --- a/src/app/tests/suites/certification/Test_TC_OZFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_OZFREMON_1_1.yaml @@ -48,7 +48,9 @@ tests: constraints: type: bitmap32 - - label: "Given OZFREMON.S.F00(Condition) ensure featuremap has the correct bit set" + - label: + "Given OZFREMON.S.F00(Condition) ensure featuremap has the correct bit + set" command: "readAttribute" attribute: "FeatureMap" PICS: OZFREMON.S.F00 @@ -57,7 +59,9 @@ tests: type: bitmap32 hasMasksSet: [0x1] - - label: "Given OZFREMON.S.F01(Warning) ensure featuremap has the correct bit set" + - label: + "Given OZFREMON.S.F01(Warning) ensure featuremap has the correct bit + set" command: "readAttribute" attribute: "FeatureMap" PICS: OZFREMON.S.F01 @@ -74,7 +78,8 @@ tests: type: list contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] - - label: "Read the feature dependent(OZFREMON.S.F00) attribute in AttributeList" + - label: + "Read the feature dependent(OZFREMON.S.F00) attribute in AttributeList" PICS: OZFREMON.S.F00 command: "readAttribute" attribute: "AttributeList" diff --git a/src/app/tests/suites/certification/Test_TC_TCREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_TCREMON_1_1.yaml index 65d0293f647b81..4e09312ab3d5dc 100644 --- a/src/app/tests/suites/certification/Test_TC_TCREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCREMON_1_1.yaml @@ -48,7 +48,9 @@ tests: constraints: type: bitmap32 - - label: "Given TCREMON.S.F00(Condition) ensure featuremap has the correct bit set" + - label: + "Given TCREMON.S.F00(Condition) ensure featuremap has the correct bit + set" command: "readAttribute" attribute: "FeatureMap" PICS: TCREMON.S.F00 @@ -57,7 +59,9 @@ tests: type: bitmap32 hasMasksSet: [0x1] - - label: "Given TCREMON.S.F01(Warning) ensure featuremap has the correct bit set" + - label: + "Given TCREMON.S.F01(Warning) ensure featuremap has the correct bit + set" command: "readAttribute" attribute: "FeatureMap" PICS: TCREMON.S.F01 @@ -74,7 +78,8 @@ tests: type: list contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] - - label: "Read the feature dependent(TCREMON.S.F00) attribute in AttributeList" + - label: + "Read the feature dependent(TCREMON.S.F00) attribute in AttributeList" PICS: TCREMON.S.F00 command: "readAttribute" attribute: "AttributeList" diff --git a/src/app/tests/suites/certification/Test_TC_UVFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_UVFREMON_1_1.yaml index c764cead8248d2..a98ba2c658a20f 100644 --- a/src/app/tests/suites/certification/Test_TC_UVFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_UVFREMON_1_1.yaml @@ -48,7 +48,9 @@ tests: constraints: type: bitmap32 - - label: "Given UVFREMON.S.F00(Condition) ensure featuremap has the correct bit set" + - label: + "Given UVFREMON.S.F00(Condition) ensure featuremap has the correct bit + set" command: "readAttribute" attribute: "FeatureMap" PICS: UVFREMON.S.F00 @@ -57,7 +59,9 @@ tests: type: bitmap32 hasMasksSet: [0x1] - - label: "Given UVFREMON.S.F01(Warning) ensure featuremap has the correct bit set" + - label: + "Given UVFREMON.S.F01(Warning) ensure featuremap has the correct bit + set" command: "readAttribute" attribute: "FeatureMap" PICS: UVFREMON.S.F01 @@ -74,7 +78,8 @@ tests: type: list contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] - - label: "Read the feature dependent(UVFREMON.S.F00) attribute in AttributeList" + - label: + "Read the feature dependent(UVFREMON.S.F00) attribute in AttributeList" PICS: UVFREMON.S.F00 command: "readAttribute" attribute: "AttributeList" diff --git a/src/app/tests/suites/certification/Test_TC_WTREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_WTREMON_1_1.yaml index 5bb80f63044a4d..deacce4fd3e3be 100644 --- a/src/app/tests/suites/certification/Test_TC_WTREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_WTREMON_1_1.yaml @@ -48,7 +48,9 @@ tests: constraints: type: bitmap32 - - label: "Given WTREMON.S.F00(Condition) ensure featuremap has the correct bit set" + - label: + "Given WTREMON.S.F00(Condition) ensure featuremap has the correct bit + set" command: "readAttribute" attribute: "FeatureMap" PICS: WTREMON.S.F00 @@ -57,7 +59,9 @@ tests: type: bitmap32 hasMasksSet: [0x1] - - label: "Given WTREMON.S.F01(Warning) ensure featuremap has the correct bit set" + - label: + "Given WTREMON.S.F01(Warning) ensure featuremap has the correct bit + set" command: "readAttribute" attribute: "FeatureMap" PICS: WTREMON.S.F01 @@ -74,7 +78,8 @@ tests: type: list contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] - - label: "Read the feature dependent(WTREMON.S.F00) attribute in AttributeList" + - label: + "Read the feature dependent(WTREMON.S.F00) attribute in AttributeList" PICS: WTREMON.S.F00 command: "readAttribute" attribute: "AttributeList" diff --git a/src/app/tests/suites/certification/Test_TC_ZEOFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_ZEOFREMON_1_1.yaml index 6e74849ca4af85..d6e46efd026da4 100644 --- a/src/app/tests/suites/certification/Test_TC_ZEOFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ZEOFREMON_1_1.yaml @@ -48,7 +48,9 @@ tests: constraints: type: bitmap32 - - label: "Given ZEOFREMON.S.F00(Condition) ensure featuremap has the correct bit set" + - label: + "Given ZEOFREMON.S.F00(Condition) ensure featuremap has the correct + bit set" command: "readAttribute" attribute: "FeatureMap" PICS: ZEOFREMON.S.F00 @@ -57,7 +59,9 @@ tests: type: bitmap32 hasMasksSet: [0x1] - - label: "Given ZEOFREMON.S.F01(Warning) ensure featuremap has the correct bit set" + - label: + "Given ZEOFREMON.S.F01(Warning) ensure featuremap has the correct bit + set" command: "readAttribute" attribute: "FeatureMap" PICS: ZEOFREMON.S.F01 @@ -74,7 +78,9 @@ tests: type: list contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] - - label: "Read the feature dependent(ZEOFREMON.S.F00) attribute in AttributeList" + - label: + "Read the feature dependent(ZEOFREMON.S.F00) attribute in + AttributeList" PICS: ZEOFREMON.S.F00 command: "readAttribute" attribute: "AttributeList" From 75d8da8a7aeb0c7f440880a516ca30160e9ef4b4 Mon Sep 17 00:00:00 2001 From: Graf Tobias <4622393+tobiasgraf@users.noreply.github.com> Date: Tue, 30 May 2023 15:43:28 +0200 Subject: [PATCH 12/16] Add 2 more Tests - test that checks that attribute 3 is present if the right PICS is set. - test that checks for command 0 if the right PICS is set. --- src/app/tests/suites/certification/PICS.yaml | 168 ++++++++++-------- .../certification/Test_TC_ACFREMON_1_1.yaml | 25 ++- .../certification/Test_TC_CFREMON_1_1.yaml | 25 ++- .../certification/Test_TC_ESFREMON_1_1.yaml | 25 ++- .../certification/Test_TC_FTREMON_1_1.yaml | 25 ++- .../certification/Test_TC_HEPAFREMON_1_1.yaml | 18 ++ .../certification/Test_TC_INKCREMON_1_1.yaml | 18 ++ .../certification/Test_TC_IONFREMON_1_1.yaml | 18 ++ .../certification/Test_TC_OZFREMON_1_1.yaml | 25 ++- .../certification/Test_TC_TCREMON_1_1.yaml | 25 ++- .../certification/Test_TC_UVFREMON_1_1.yaml | 25 ++- .../certification/Test_TC_WTREMON_1_1.yaml | 25 ++- .../certification/Test_TC_ZEOFREMON_1_1.yaml | 18 ++ 13 files changed, 344 insertions(+), 96 deletions(-) diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index da48a40c0e0177..0bec1f764f770b 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -3752,14 +3752,10 @@ PICS: id: G.C.C05.Tx # HEPA Filter Monitoring Cluster Test Plan - - label: - "Does the device implement the HEPA Filter Monitoring cluster as a - server?" + - label: "Does the device implement the HEPA Filter Monitoring cluster as a server?" id: HEPAFREMON.S - - label: - "Does the device implement the HEPA Filter Monitoring cluster as a - client?" + - label: "Does the device implement the HEPA Filter Monitoring cluster as a client?" id: HEPAFREMON.C # @@ -3786,15 +3782,17 @@ PICS: - label: "Does the device support the Warning feature?" id: HEPAFREMON.S.F01 + # + # server / commandsReceived + # + - label: "Does the device implement receiving the ResetCondition command?" + id: HEPAFREMON.S.C00.Rsp + # Activated Carbon Filter Monitoring Cluster Test Plan - - label: - "Does the device implement the Activated Carbon Filter Monitoring - cluster as a server?" + - label: "Does the device implement the Activated Carbon Filter Monitoring cluster as a server?" id: ACFREMON.S - - label: - "Does the device implement the Activated Carbon Filter Monitoring - cluster as a client?" + - label: "Does the device implement the Activated Carbon Filter Monitoring cluster as a client?" id: ACFREMON.C # @@ -3821,15 +3819,17 @@ PICS: - label: "Does the device support the Warning feature?" id: ACFREMON.S.F01 + # + # server / commandsReceived + # + - label: "Does the device implement receiving the ResetCondition command?" + id: ACFREMON.S.C00.Rsp + # Ceramic Filter Monitoring Cluster Test Plan - - label: - "Does the device implement the Ceramic Filter Monitoring cluster as a - server?" + - label: "Does the device implement the Ceramic Filter Monitoring cluster as a server?" id: CFREMON.S - - label: - "Does the device implement the Ceramic Filter Monitoring cluster as a - client?" + - label: "Does the device implement the Ceramic Filter Monitoring cluster as a client?" id: CFREMON.C # @@ -3856,15 +3856,17 @@ PICS: - label: "Does the device support the Warning feature?" id: CFREMON.S.F01 + # + # server / commandsReceived + # + - label: "Does the device implement receiving the ResetCondition command?" + id: CFREMON.S.C00.Rsp + # Electrostatic Filter Monitoring Cluster Test Plan - - label: - "Does the device implement the Electrostatic Filter Monitoring cluster - as a server?" + - label: "Does the device implement the Electrostatic Filter Monitoring cluster as a server?" id: ESFREMON.S - - label: - "Does the device implement the Electrostatic Filter Monitoring cluster - as a client?" + - label: "Does the device implement the Electrostatic Filter Monitoring cluster as a client?" id: ESFREMON.C # @@ -3891,15 +3893,17 @@ PICS: - label: "Does the device support the Warning feature?" id: ESFREMON.S.F01 + # + # server / commandsReceived + # + - label: "Does the device implement receiving the ResetCondition command?" + id: ESFREMON.S.C00.Rsp + # Fuel Tank Monitoring Cluster Test Plan - - label: - "Does the device implement the Fuel Tank Monitoring cluster as a - server?" + - label: "Does the device implement the Fuel Tank Monitoring cluster as a server?" id: FTREMON.S - - label: - "Does the device implement the Fuel Tank Monitoring cluster as a - client?" + - label: "Does the device implement the Fuel Tank Monitoring cluster as a client?" id: FTREMON.C # @@ -3926,15 +3930,17 @@ PICS: - label: "Does the device support the Warning feature?" id: FTREMON.S.F01 + # + # server / commandsReceived + # + - label: "Does the device implement receiving the ResetCondition command?" + id: FTREMON.S.C00.Rsp + # Ink Cartridge Monitoring Cluster Test Plan - - label: - "Does the device implement the Ink Cartridge Monitoring cluster as a - server?" + - label: "Does the device implement the Ink Cartridge Monitoring cluster as a server?" id: INKCREMON.S - - label: - "Does the device implement the Ink Cartridge Monitoring cluster as a - client?" + - label: "Does the device implement the Ink Cartridge Monitoring cluster as a client?" id: INKCREMON.C # @@ -3961,15 +3967,17 @@ PICS: - label: "Does the device support the Warning feature?" id: INKCREMON.S.F01 + # + # server / commandsReceived + # + - label: "Does the device implement receiving the ResetCondition command?" + id: INKCREMON.S.C00.Rsp + # Ionizing Filter Monitoring Cluster Test Plan - - label: - "Does the device implement the Ionizing Filter Monitoring cluster as a - server?" + - label: "Does the device implement the Ionizing Filter Monitoring cluster as a server?" id: IONFREMON.S - - label: - "Does the device implement the Ionizing Filter Monitoring cluster as a - client?" + - label: "Does the device implement the Ionizing Filter Monitoring cluster as a client?" id: IONFREMON.C # @@ -3996,15 +4004,17 @@ PICS: - label: "Does the device support the Warning feature?" id: IONFREMON.S.F01 + # + # server / commandsReceived + # + - label: "Does the device implement receiving the ResetCondition command?" + id: IONFREMON.S.C00.Rsp + # Ozone Filter Monitoring Cluster Test Plan - - label: - "Does the device implement the Ozone Filter Monitoring cluster as a - server?" + - label: "Does the device implement the Ozone Filter Monitoring cluster as a server?" id: OZFREMON.S - - label: - "Does the device implement the Ozone Filter Monitoring cluster as a - client?" + - label: "Does the device implement the Ozone Filter Monitoring cluster as a client?" id: OZFREMON.C # @@ -4031,15 +4041,17 @@ PICS: - label: "Does the device support the Warning feature?" id: OZFREMON.S.F01 + # + # server / commandsReceived + # + - label: "Does the device implement receiving the ResetCondition command?" + id: OZFREMON.S.C00.Rsp + # Toner Cartridge Monitoring Cluster Test Plan - - label: - "Does the device implement the Toner Cartridge Monitoring cluster as a - server?" + - label: "Does the device implement the Toner Cartridge Monitoring cluster as a server?" id: TCREMON.S - - label: - "Does the device implement the Toner Cartridge Monitoring cluster as a - client?" + - label: "Does the device implement the Toner Cartridge Monitoring cluster as a client?" id: TCREMON.C # @@ -4066,15 +4078,17 @@ PICS: - label: "Does the device support the Warning feature?" id: TCREMON.S.F01 + # + # server / commandsReceived + # + - label: "Does the device implement receiving the ResetCondition command?" + id: TCREMON.S.C00.Rsp + # UV Filter Monitoring Cluster Test Plan - - label: - "Does the device implement the UV Filter Monitoring cluster as a - server?" + - label: "Does the device implement the UV Filter Monitoring cluster as a server?" id: UVFREMON.S - - label: - "Does the device implement the UV Filter Monitoring cluster as a - client?" + - label: "Does the device implement the UV Filter Monitoring cluster as a client?" id: UVFREMON.C # @@ -4101,15 +4115,17 @@ PICS: - label: "Does the device support the Warning feature?" id: UVFREMON.S.F01 + # + # server / commandsReceived + # + - label: "Does the device implement receiving the ResetCondition command?" + id: UVFREMON.S.C00.Rsp + # Water Tank Monitoring Cluster Test Plan - - label: - "Does the device implement the Water Tank Monitoring cluster as a - server?" + - label: "Does the device implement the Water Tank Monitoring cluster as a server?" id: WTREMON.S - - label: - "Does the device implement the Water Tank Monitoring cluster as a - client?" + - label: "Does the device implement the Water Tank Monitoring cluster as a client?" id: WTREMON.C # @@ -4136,15 +4152,17 @@ PICS: - label: "Does the device support the Warning feature?" id: WTREMON.S.F01 + # + # server / commandsReceived + # + - label: "Does the device implement receiving the ResetCondition command?" + id: WTREMON.S.C00.Rsp + # Zeolite Filter Monitoring Cluster Test Plan - - label: - "Does the device implement the Zeolite Filter Monitoring cluster as a - server?" + - label: "Does the device implement the Zeolite Filter Monitoring cluster as a server?" id: ZEOFREMON.S - - label: - "Does the device implement the Zeolite Filter Monitoring cluster as a - client?" + - label: "Does the device implement the Zeolite Filter Monitoring cluster as a client?" id: ZEOFREMON.C # @@ -4171,6 +4189,12 @@ PICS: - label: "Does the device support the Warning feature?" id: ZEOFREMON.S.F01 + # + # server / commandsReceived + # + - label: "Does the device implement receiving the ResetCondition command?" + id: ZEOFREMON.S.C00.Rsp + # Identify Cluster Test Plan - label: "Does the device implement the Identify cluster as a server?" id: I.S diff --git a/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml index bb9a8c013a10b4..55c20e1a33bc53 100644 --- a/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml @@ -49,8 +49,8 @@ tests: type: bitmap32 - label: - "Given ACFREMON.S.F00(Condition) ensure featuremap has the correct bit - set" + "Given ACFREMON.S.F00(Condition) ensure featuremap has the correct + bit set" command: "readAttribute" attribute: "FeatureMap" PICS: ACFREMON.S.F00 @@ -79,7 +79,8 @@ tests: contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] - label: - "Read the feature dependent(ACFREMON.S.F00) attribute in AttributeList" + "Read the feature dependent(ACFREMON.S.F00) attribute in + AttributeList" PICS: ACFREMON.S.F00 command: "readAttribute" attribute: "AttributeList" @@ -88,6 +89,15 @@ tests: type: list contains: [0, 1] + - label: "Read the optional attribute InPlaceIndicator (ACFREMON.S.A0002) in AttributeList" + PICS: ACFREMON.S.A0002 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [3] + - label: "Read the global attribute: AcceptedCommandList" command: "readAttribute" attribute: "AcceptedCommandList" @@ -96,6 +106,15 @@ tests: type: list contains: [] + - label: "Read the optional command (ResetCondition) in AcceptedCommandList" + PICS: ACFREMON.S.C00.Rsp + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [0] + - label: "Read the global attribute: GeneratedCommandList" command: "readAttribute" attribute: "GeneratedCommandList" diff --git a/src/app/tests/suites/certification/Test_TC_CFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_CFREMON_1_1.yaml index 8d18a5af8dc5dd..84c865f0eaaef5 100644 --- a/src/app/tests/suites/certification/Test_TC_CFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CFREMON_1_1.yaml @@ -49,8 +49,8 @@ tests: type: bitmap32 - label: - "Given CFREMON.S.F00(Condition) ensure featuremap has the correct bit - set" + "Given CFREMON.S.F00(Condition) ensure featuremap has the correct + bit set" command: "readAttribute" attribute: "FeatureMap" PICS: CFREMON.S.F00 @@ -79,7 +79,8 @@ tests: contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] - label: - "Read the feature dependent(CFREMON.S.F00) attribute in AttributeList" + "Read the feature dependent(CFREMON.S.F00) attribute in + AttributeList" PICS: CFREMON.S.F00 command: "readAttribute" attribute: "AttributeList" @@ -88,6 +89,15 @@ tests: type: list contains: [0, 1] + - label: "Read the optional attribute InPlaceIndicator (CFREMON.S.A0002) in AttributeList" + PICS: CFREMON.S.A0002 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [3] + - label: "Read the global attribute: AcceptedCommandList" command: "readAttribute" attribute: "AcceptedCommandList" @@ -96,6 +106,15 @@ tests: type: list contains: [] + - label: "Read the optional command (ResetCondition) in AcceptedCommandList" + PICS: CFREMON.S.C00.Rsp + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [0] + - label: "Read the global attribute: GeneratedCommandList" command: "readAttribute" attribute: "GeneratedCommandList" diff --git a/src/app/tests/suites/certification/Test_TC_ESFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_ESFREMON_1_1.yaml index 196c9d0c6523e6..de88271298ad08 100644 --- a/src/app/tests/suites/certification/Test_TC_ESFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ESFREMON_1_1.yaml @@ -49,8 +49,8 @@ tests: type: bitmap32 - label: - "Given ESFREMON.S.F00(Condition) ensure featuremap has the correct bit - set" + "Given ESFREMON.S.F00(Condition) ensure featuremap has the correct + bit set" command: "readAttribute" attribute: "FeatureMap" PICS: ESFREMON.S.F00 @@ -79,7 +79,8 @@ tests: contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] - label: - "Read the feature dependent(ESFREMON.S.F00) attribute in AttributeList" + "Read the feature dependent(ESFREMON.S.F00) attribute in + AttributeList" PICS: ESFREMON.S.F00 command: "readAttribute" attribute: "AttributeList" @@ -88,6 +89,15 @@ tests: type: list contains: [0, 1] + - label: "Read the optional attribute InPlaceIndicator (ESFREMON.S.A0002) in AttributeList" + PICS: ESFREMON.S.A0002 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [3] + - label: "Read the global attribute: AcceptedCommandList" command: "readAttribute" attribute: "AcceptedCommandList" @@ -96,6 +106,15 @@ tests: type: list contains: [] + - label: "Read the optional command (ResetCondition) in AcceptedCommandList" + PICS: ESFREMON.S.C00.Rsp + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [0] + - label: "Read the global attribute: GeneratedCommandList" command: "readAttribute" attribute: "GeneratedCommandList" diff --git a/src/app/tests/suites/certification/Test_TC_FTREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_FTREMON_1_1.yaml index 5bb3fb421e7964..bd9ac632a5e062 100644 --- a/src/app/tests/suites/certification/Test_TC_FTREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_FTREMON_1_1.yaml @@ -49,8 +49,8 @@ tests: type: bitmap32 - label: - "Given FTREMON.S.F00(Condition) ensure featuremap has the correct bit - set" + "Given FTREMON.S.F00(Condition) ensure featuremap has the correct + bit set" command: "readAttribute" attribute: "FeatureMap" PICS: FTREMON.S.F00 @@ -79,7 +79,8 @@ tests: contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] - label: - "Read the feature dependent(FTREMON.S.F00) attribute in AttributeList" + "Read the feature dependent(FTREMON.S.F00) attribute in + AttributeList" PICS: FTREMON.S.F00 command: "readAttribute" attribute: "AttributeList" @@ -88,6 +89,15 @@ tests: type: list contains: [0, 1] + - label: "Read the optional attribute InPlaceIndicator (FTREMON.S.A0002) in AttributeList" + PICS: FTREMON.S.A0002 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [3] + - label: "Read the global attribute: AcceptedCommandList" command: "readAttribute" attribute: "AcceptedCommandList" @@ -96,6 +106,15 @@ tests: type: list contains: [] + - label: "Read the optional command (ResetCondition) in AcceptedCommandList" + PICS: FTREMON.S.C00.Rsp + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [0] + - label: "Read the global attribute: GeneratedCommandList" command: "readAttribute" attribute: "GeneratedCommandList" diff --git a/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml index a21fe054100888..2f60c05d452331 100644 --- a/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml @@ -89,6 +89,15 @@ tests: type: list contains: [0, 1] + - label: "Read the optional attribute InPlaceIndicator (HEPAFREMON.S.A0002) in AttributeList" + PICS: HEPAFREMON.S.A0002 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [3] + - label: "Read the global attribute: AcceptedCommandList" command: "readAttribute" attribute: "AcceptedCommandList" @@ -97,6 +106,15 @@ tests: type: list contains: [] + - label: "Read the optional command (ResetCondition) in AcceptedCommandList" + PICS: HEPAFREMON.S.C00.Rsp + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [0] + - label: "Read the global attribute: GeneratedCommandList" command: "readAttribute" attribute: "GeneratedCommandList" diff --git a/src/app/tests/suites/certification/Test_TC_INKCREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_INKCREMON_1_1.yaml index 53362e731c6e66..41dc8073162b4c 100644 --- a/src/app/tests/suites/certification/Test_TC_INKCREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_INKCREMON_1_1.yaml @@ -89,6 +89,15 @@ tests: type: list contains: [0, 1] + - label: "Read the optional attribute InPlaceIndicator (INKCREMON.S.A0002) in AttributeList" + PICS: INKCREMON.S.A0002 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [3] + - label: "Read the global attribute: AcceptedCommandList" command: "readAttribute" attribute: "AcceptedCommandList" @@ -97,6 +106,15 @@ tests: type: list contains: [] + - label: "Read the optional command (ResetCondition) in AcceptedCommandList" + PICS: INKCREMON.S.C00.Rsp + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [0] + - label: "Read the global attribute: GeneratedCommandList" command: "readAttribute" attribute: "GeneratedCommandList" diff --git a/src/app/tests/suites/certification/Test_TC_IONFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_IONFREMON_1_1.yaml index d23278b7fba51e..96ed378f62a52c 100644 --- a/src/app/tests/suites/certification/Test_TC_IONFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_IONFREMON_1_1.yaml @@ -89,6 +89,15 @@ tests: type: list contains: [0, 1] + - label: "Read the optional attribute InPlaceIndicator (IONFREMON.S.A0002) in AttributeList" + PICS: IONFREMON.S.A0002 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [3] + - label: "Read the global attribute: AcceptedCommandList" command: "readAttribute" attribute: "AcceptedCommandList" @@ -97,6 +106,15 @@ tests: type: list contains: [] + - label: "Read the optional command (ResetCondition) in AcceptedCommandList" + PICS: IONFREMON.S.C00.Rsp + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [0] + - label: "Read the global attribute: GeneratedCommandList" command: "readAttribute" attribute: "GeneratedCommandList" diff --git a/src/app/tests/suites/certification/Test_TC_OZFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_OZFREMON_1_1.yaml index 446e9d8b6bf3a4..29dce02ae572fd 100644 --- a/src/app/tests/suites/certification/Test_TC_OZFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_OZFREMON_1_1.yaml @@ -49,8 +49,8 @@ tests: type: bitmap32 - label: - "Given OZFREMON.S.F00(Condition) ensure featuremap has the correct bit - set" + "Given OZFREMON.S.F00(Condition) ensure featuremap has the correct + bit set" command: "readAttribute" attribute: "FeatureMap" PICS: OZFREMON.S.F00 @@ -79,7 +79,8 @@ tests: contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] - label: - "Read the feature dependent(OZFREMON.S.F00) attribute in AttributeList" + "Read the feature dependent(OZFREMON.S.F00) attribute in + AttributeList" PICS: OZFREMON.S.F00 command: "readAttribute" attribute: "AttributeList" @@ -88,6 +89,15 @@ tests: type: list contains: [0, 1] + - label: "Read the optional attribute InPlaceIndicator (OZFREMON.S.A0002) in AttributeList" + PICS: OZFREMON.S.A0002 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [3] + - label: "Read the global attribute: AcceptedCommandList" command: "readAttribute" attribute: "AcceptedCommandList" @@ -96,6 +106,15 @@ tests: type: list contains: [] + - label: "Read the optional command (ResetCondition) in AcceptedCommandList" + PICS: OZFREMON.S.C00.Rsp + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [0] + - label: "Read the global attribute: GeneratedCommandList" command: "readAttribute" attribute: "GeneratedCommandList" diff --git a/src/app/tests/suites/certification/Test_TC_TCREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_TCREMON_1_1.yaml index 4e09312ab3d5dc..d38888f89abe60 100644 --- a/src/app/tests/suites/certification/Test_TC_TCREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCREMON_1_1.yaml @@ -49,8 +49,8 @@ tests: type: bitmap32 - label: - "Given TCREMON.S.F00(Condition) ensure featuremap has the correct bit - set" + "Given TCREMON.S.F00(Condition) ensure featuremap has the correct + bit set" command: "readAttribute" attribute: "FeatureMap" PICS: TCREMON.S.F00 @@ -79,7 +79,8 @@ tests: contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] - label: - "Read the feature dependent(TCREMON.S.F00) attribute in AttributeList" + "Read the feature dependent(TCREMON.S.F00) attribute in + AttributeList" PICS: TCREMON.S.F00 command: "readAttribute" attribute: "AttributeList" @@ -88,6 +89,15 @@ tests: type: list contains: [0, 1] + - label: "Read the optional attribute InPlaceIndicator (TCREMON.S.A0002) in AttributeList" + PICS: TCREMON.S.A0002 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [3] + - label: "Read the global attribute: AcceptedCommandList" command: "readAttribute" attribute: "AcceptedCommandList" @@ -96,6 +106,15 @@ tests: type: list contains: [] + - label: "Read the optional command (ResetCondition) in AcceptedCommandList" + PICS: TCREMON.S.C00.Rsp + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [0] + - label: "Read the global attribute: GeneratedCommandList" command: "readAttribute" attribute: "GeneratedCommandList" diff --git a/src/app/tests/suites/certification/Test_TC_UVFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_UVFREMON_1_1.yaml index a98ba2c658a20f..c7c73ba1f380bb 100644 --- a/src/app/tests/suites/certification/Test_TC_UVFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_UVFREMON_1_1.yaml @@ -49,8 +49,8 @@ tests: type: bitmap32 - label: - "Given UVFREMON.S.F00(Condition) ensure featuremap has the correct bit - set" + "Given UVFREMON.S.F00(Condition) ensure featuremap has the correct + bit set" command: "readAttribute" attribute: "FeatureMap" PICS: UVFREMON.S.F00 @@ -79,7 +79,8 @@ tests: contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] - label: - "Read the feature dependent(UVFREMON.S.F00) attribute in AttributeList" + "Read the feature dependent(UVFREMON.S.F00) attribute in + AttributeList" PICS: UVFREMON.S.F00 command: "readAttribute" attribute: "AttributeList" @@ -88,6 +89,15 @@ tests: type: list contains: [0, 1] + - label: "Read the optional attribute InPlaceIndicator (UVFREMON.S.A0002) in AttributeList" + PICS: UVFREMON.S.A0002 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [3] + - label: "Read the global attribute: AcceptedCommandList" command: "readAttribute" attribute: "AcceptedCommandList" @@ -96,6 +106,15 @@ tests: type: list contains: [] + - label: "Read the optional command (ResetCondition) in AcceptedCommandList" + PICS: UVFREMON.S.C00.Rsp + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [0] + - label: "Read the global attribute: GeneratedCommandList" command: "readAttribute" attribute: "GeneratedCommandList" diff --git a/src/app/tests/suites/certification/Test_TC_WTREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_WTREMON_1_1.yaml index deacce4fd3e3be..06478b44c32a50 100644 --- a/src/app/tests/suites/certification/Test_TC_WTREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_WTREMON_1_1.yaml @@ -49,8 +49,8 @@ tests: type: bitmap32 - label: - "Given WTREMON.S.F00(Condition) ensure featuremap has the correct bit - set" + "Given WTREMON.S.F00(Condition) ensure featuremap has the correct + bit set" command: "readAttribute" attribute: "FeatureMap" PICS: WTREMON.S.F00 @@ -79,7 +79,8 @@ tests: contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] - label: - "Read the feature dependent(WTREMON.S.F00) attribute in AttributeList" + "Read the feature dependent(WTREMON.S.F00) attribute in + AttributeList" PICS: WTREMON.S.F00 command: "readAttribute" attribute: "AttributeList" @@ -88,6 +89,15 @@ tests: type: list contains: [0, 1] + - label: "Read the optional attribute InPlaceIndicator (WTREMON.S.A0002) in AttributeList" + PICS: WTREMON.S.A0002 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [3] + - label: "Read the global attribute: AcceptedCommandList" command: "readAttribute" attribute: "AcceptedCommandList" @@ -96,6 +106,15 @@ tests: type: list contains: [] + - label: "Read the optional command (ResetCondition) in AcceptedCommandList" + PICS: WTREMON.S.C00.Rsp + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [0] + - label: "Read the global attribute: GeneratedCommandList" command: "readAttribute" attribute: "GeneratedCommandList" diff --git a/src/app/tests/suites/certification/Test_TC_ZEOFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_ZEOFREMON_1_1.yaml index d6e46efd026da4..44f71aaf064b95 100644 --- a/src/app/tests/suites/certification/Test_TC_ZEOFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ZEOFREMON_1_1.yaml @@ -89,6 +89,15 @@ tests: type: list contains: [0, 1] + - label: "Read the optional attribute InPlaceIndicator (ZEOFREMON.S.A0002) in AttributeList" + PICS: ZEOFREMON.S.A0002 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [3] + - label: "Read the global attribute: AcceptedCommandList" command: "readAttribute" attribute: "AcceptedCommandList" @@ -97,6 +106,15 @@ tests: type: list contains: [] + - label: "Read the optional command (ResetCondition) in AcceptedCommandList" + PICS: ZEOFREMON.S.C00.Rsp + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [0] + - label: "Read the global attribute: GeneratedCommandList" command: "readAttribute" attribute: "GeneratedCommandList" From 46b8c57ae07c29c054e65c79029d761b03c3f621 Mon Sep 17 00:00:00 2001 From: Graf Tobias <4622393+tobiasgraf@users.noreply.github.com> Date: Tue, 30 May 2023 15:43:44 +0200 Subject: [PATCH 13/16] Update Generated Code --- .../chip-tool/zap-generated/test/Commands.h | 552 ++++++-- .../zap-generated/test/Commands.h | 1112 ++++++++++++++--- 2 files changed, 1426 insertions(+), 238 deletions(-) diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 7c87f7b3484ff8..84aa92ca064138 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -95707,7 +95707,7 @@ class Test_TC_ACFREMON_1_1Suite : public TestCommand { public: Test_TC_ACFREMON_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_ACFREMON_1_1", 10, credsIssuerConfig) + TestCommand("Test_TC_ACFREMON_1_1", 12, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -95808,12 +95808,30 @@ class Test_TC_ACFREMON_1_1Suite : public TestCommand case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); } break; case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -95825,7 +95843,7 @@ class Test_TC_ACFREMON_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "list", "list")); } break; - case 9: + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -95894,17 +95912,29 @@ class Test_TC_ACFREMON_1_1Suite : public TestCommand ActivatedCarbonFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); } case 7: { - LogStep(7, "Read the global attribute: AcceptedCommandList"); + LogStep(7, "Read the optional attribute InPlaceIndicator (ACFREMON.S.A0002) in AttributeList"); + VerifyOrDo(!ShouldSkip("ACFREMON.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, - ActivatedCarbonFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + ActivatedCarbonFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); } case 8: { - LogStep(8, "Read the global attribute: GeneratedCommandList"); + LogStep(8, "Read the global attribute: AcceptedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, - ActivatedCarbonFilterMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + ActivatedCarbonFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); } case 9: { - LogStep(9, "TH reads EventList attribute from DUT"); + LogStep(9, "Read the optional command (ResetCondition) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("ACFREMON.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "TH reads EventList attribute from DUT"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, ActivatedCarbonFilterMonitoring::Attributes::EventList::Id, true, chip::NullOptional); } @@ -96047,7 +96077,7 @@ class Test_TC_CFREMON_1_1Suite : public TestCommand { public: Test_TC_CFREMON_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_CFREMON_1_1", 10, credsIssuerConfig) + TestCommand("Test_TC_CFREMON_1_1", 12, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -96148,12 +96178,30 @@ class Test_TC_CFREMON_1_1Suite : public TestCommand case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); } break; case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -96165,7 +96213,7 @@ class Test_TC_CFREMON_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "list", "list")); } break; - case 9: + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -96234,17 +96282,29 @@ class Test_TC_CFREMON_1_1Suite : public TestCommand CeramicFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); } case 7: { - LogStep(7, "Read the global attribute: AcceptedCommandList"); + LogStep(7, "Read the optional attribute InPlaceIndicator (CFREMON.S.A0002) in AttributeList"); + VerifyOrDo(!ShouldSkip("CFREMON.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CeramicFilterMonitoring::Id, - CeramicFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + CeramicFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); } case 8: { - LogStep(8, "Read the global attribute: GeneratedCommandList"); + LogStep(8, "Read the global attribute: AcceptedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CeramicFilterMonitoring::Id, - CeramicFilterMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + CeramicFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); } case 9: { - LogStep(9, "TH reads EventList attribute from DUT"); + LogStep(9, "Read the optional command (ResetCondition) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("CFREMON.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CeramicFilterMonitoring::Id, + CeramicFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CeramicFilterMonitoring::Id, + CeramicFilterMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "TH reads EventList attribute from DUT"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CeramicFilterMonitoring::Id, CeramicFilterMonitoring::Attributes::EventList::Id, true, chip::NullOptional); } @@ -96387,7 +96447,7 @@ class Test_TC_ESFREMON_1_1Suite : public TestCommand { public: Test_TC_ESFREMON_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_ESFREMON_1_1", 10, credsIssuerConfig) + TestCommand("Test_TC_ESFREMON_1_1", 12, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -96488,12 +96548,30 @@ class Test_TC_ESFREMON_1_1Suite : public TestCommand case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); } break; case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -96505,7 +96583,7 @@ class Test_TC_ESFREMON_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "list", "list")); } break; - case 9: + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -96574,17 +96652,29 @@ class Test_TC_ESFREMON_1_1Suite : public TestCommand ElectrostaticFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); } case 7: { - LogStep(7, "Read the global attribute: AcceptedCommandList"); + LogStep(7, "Read the optional attribute InPlaceIndicator (ESFREMON.S.A0002) in AttributeList"); + VerifyOrDo(!ShouldSkip("ESFREMON.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ElectrostaticFilterMonitoring::Id, - ElectrostaticFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + ElectrostaticFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); } case 8: { - LogStep(8, "Read the global attribute: GeneratedCommandList"); + LogStep(8, "Read the global attribute: AcceptedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ElectrostaticFilterMonitoring::Id, - ElectrostaticFilterMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + ElectrostaticFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); } case 9: { - LogStep(9, "TH reads EventList attribute from DUT"); + LogStep(9, "Read the optional command (ResetCondition) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("ESFREMON.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ElectrostaticFilterMonitoring::Id, + ElectrostaticFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ElectrostaticFilterMonitoring::Id, + ElectrostaticFilterMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "TH reads EventList attribute from DUT"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ElectrostaticFilterMonitoring::Id, ElectrostaticFilterMonitoring::Attributes::EventList::Id, true, chip::NullOptional); } @@ -96727,7 +96817,7 @@ class Test_TC_FTREMON_1_1Suite : public TestCommand { public: Test_TC_FTREMON_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_FTREMON_1_1", 10, credsIssuerConfig) + TestCommand("Test_TC_FTREMON_1_1", 12, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -96828,12 +96918,30 @@ class Test_TC_FTREMON_1_1Suite : public TestCommand case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); } break; case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -96845,7 +96953,7 @@ class Test_TC_FTREMON_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "list", "list")); } break; - case 9: + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -96914,17 +97022,29 @@ class Test_TC_FTREMON_1_1Suite : public TestCommand FuelTankMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); } case 7: { - LogStep(7, "Read the global attribute: AcceptedCommandList"); + LogStep(7, "Read the optional attribute InPlaceIndicator (FTREMON.S.A0002) in AttributeList"); + VerifyOrDo(!ShouldSkip("FTREMON.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FuelTankMonitoring::Id, - FuelTankMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + FuelTankMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); } case 8: { - LogStep(8, "Read the global attribute: GeneratedCommandList"); + LogStep(8, "Read the global attribute: AcceptedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FuelTankMonitoring::Id, - FuelTankMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + FuelTankMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); } case 9: { - LogStep(9, "TH reads EventList attribute from DUT"); + LogStep(9, "Read the optional command (ResetCondition) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("FTREMON.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FuelTankMonitoring::Id, + FuelTankMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FuelTankMonitoring::Id, + FuelTankMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "TH reads EventList attribute from DUT"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FuelTankMonitoring::Id, FuelTankMonitoring::Attributes::EventList::Id, true, chip::NullOptional); } @@ -97067,7 +97187,7 @@ class Test_TC_HEPAFREMON_1_1Suite : public TestCommand { public: Test_TC_HEPAFREMON_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_HEPAFREMON_1_1", 10, credsIssuerConfig) + TestCommand("Test_TC_HEPAFREMON_1_1", 12, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -97168,12 +97288,30 @@ class Test_TC_HEPAFREMON_1_1Suite : public TestCommand case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); } break; case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -97185,7 +97323,7 @@ class Test_TC_HEPAFREMON_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "list", "list")); } break; - case 9: + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -97254,17 +97392,29 @@ class Test_TC_HEPAFREMON_1_1Suite : public TestCommand HepaFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); } case 7: { - LogStep(7, "Read the global attribute: AcceptedCommandList"); + LogStep(7, "Read the optional attribute InPlaceIndicator (HEPAFREMON.S.A0002) in AttributeList"); + VerifyOrDo(!ShouldSkip("HEPAFREMON.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, - HepaFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + HepaFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); } case 8: { - LogStep(8, "Read the global attribute: GeneratedCommandList"); + LogStep(8, "Read the global attribute: AcceptedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, - HepaFilterMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + HepaFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); } case 9: { - LogStep(9, "TH reads EventList attribute from DUT"); + LogStep(9, "Read the optional command (ResetCondition) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("HEPAFREMON.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "TH reads EventList attribute from DUT"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, HepaFilterMonitoring::Attributes::EventList::Id, true, chip::NullOptional); } @@ -97407,7 +97557,7 @@ class Test_TC_INKCREMON_1_1Suite : public TestCommand { public: Test_TC_INKCREMON_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_INKCREMON_1_1", 10, credsIssuerConfig) + TestCommand("Test_TC_INKCREMON_1_1", 12, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -97508,12 +97658,30 @@ class Test_TC_INKCREMON_1_1Suite : public TestCommand case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); } break; case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -97525,7 +97693,7 @@ class Test_TC_INKCREMON_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "list", "list")); } break; - case 9: + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -97594,17 +97762,29 @@ class Test_TC_INKCREMON_1_1Suite : public TestCommand InkCartridgeMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); } case 7: { - LogStep(7, "Read the global attribute: AcceptedCommandList"); + LogStep(7, "Read the optional attribute InPlaceIndicator (INKCREMON.S.A0002) in AttributeList"); + VerifyOrDo(!ShouldSkip("INKCREMON.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), InkCartridgeMonitoring::Id, - InkCartridgeMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + InkCartridgeMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); } case 8: { - LogStep(8, "Read the global attribute: GeneratedCommandList"); + LogStep(8, "Read the global attribute: AcceptedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), InkCartridgeMonitoring::Id, - InkCartridgeMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + InkCartridgeMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); } case 9: { - LogStep(9, "TH reads EventList attribute from DUT"); + LogStep(9, "Read the optional command (ResetCondition) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("INKCREMON.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), InkCartridgeMonitoring::Id, + InkCartridgeMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), InkCartridgeMonitoring::Id, + InkCartridgeMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "TH reads EventList attribute from DUT"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), InkCartridgeMonitoring::Id, InkCartridgeMonitoring::Attributes::EventList::Id, true, chip::NullOptional); } @@ -97747,7 +97927,7 @@ class Test_TC_IONFREMON_1_1Suite : public TestCommand { public: Test_TC_IONFREMON_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_IONFREMON_1_1", 10, credsIssuerConfig) + TestCommand("Test_TC_IONFREMON_1_1", 12, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -97848,12 +98028,30 @@ class Test_TC_IONFREMON_1_1Suite : public TestCommand case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); } break; case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -97865,7 +98063,7 @@ class Test_TC_IONFREMON_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "list", "list")); } break; - case 9: + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -97934,17 +98132,29 @@ class Test_TC_IONFREMON_1_1Suite : public TestCommand IonizingFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); } case 7: { - LogStep(7, "Read the global attribute: AcceptedCommandList"); + LogStep(7, "Read the optional attribute InPlaceIndicator (IONFREMON.S.A0002) in AttributeList"); + VerifyOrDo(!ShouldSkip("IONFREMON.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IonizingFilterMonitoring::Id, - IonizingFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + IonizingFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); } case 8: { - LogStep(8, "Read the global attribute: GeneratedCommandList"); + LogStep(8, "Read the global attribute: AcceptedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IonizingFilterMonitoring::Id, - IonizingFilterMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + IonizingFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); } case 9: { - LogStep(9, "TH reads EventList attribute from DUT"); + LogStep(9, "Read the optional command (ResetCondition) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("IONFREMON.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IonizingFilterMonitoring::Id, + IonizingFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IonizingFilterMonitoring::Id, + IonizingFilterMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "TH reads EventList attribute from DUT"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), IonizingFilterMonitoring::Id, IonizingFilterMonitoring::Attributes::EventList::Id, true, chip::NullOptional); } @@ -98087,7 +98297,7 @@ class Test_TC_OZFREMON_1_1Suite : public TestCommand { public: Test_TC_OZFREMON_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_OZFREMON_1_1", 10, credsIssuerConfig) + TestCommand("Test_TC_OZFREMON_1_1", 12, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -98188,12 +98398,30 @@ class Test_TC_OZFREMON_1_1Suite : public TestCommand case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); } break; case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -98205,7 +98433,7 @@ class Test_TC_OZFREMON_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "list", "list")); } break; - case 9: + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -98274,17 +98502,29 @@ class Test_TC_OZFREMON_1_1Suite : public TestCommand OzoneFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); } case 7: { - LogStep(7, "Read the global attribute: AcceptedCommandList"); + LogStep(7, "Read the optional attribute InPlaceIndicator (OZFREMON.S.A0002) in AttributeList"); + VerifyOrDo(!ShouldSkip("OZFREMON.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneFilterMonitoring::Id, - OzoneFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + OzoneFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); } case 8: { - LogStep(8, "Read the global attribute: GeneratedCommandList"); + LogStep(8, "Read the global attribute: AcceptedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneFilterMonitoring::Id, - OzoneFilterMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + OzoneFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); } case 9: { - LogStep(9, "TH reads EventList attribute from DUT"); + LogStep(9, "Read the optional command (ResetCondition) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("OZFREMON.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneFilterMonitoring::Id, + OzoneFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneFilterMonitoring::Id, + OzoneFilterMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "TH reads EventList attribute from DUT"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneFilterMonitoring::Id, OzoneFilterMonitoring::Attributes::EventList::Id, true, chip::NullOptional); } @@ -98427,7 +98667,7 @@ class Test_TC_TCREMON_1_1Suite : public TestCommand { public: Test_TC_TCREMON_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_TCREMON_1_1", 10, credsIssuerConfig) + TestCommand("Test_TC_TCREMON_1_1", 12, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -98528,12 +98768,30 @@ class Test_TC_TCREMON_1_1Suite : public TestCommand case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); } break; case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -98545,7 +98803,7 @@ class Test_TC_TCREMON_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "list", "list")); } break; - case 9: + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -98614,17 +98872,29 @@ class Test_TC_TCREMON_1_1Suite : public TestCommand TonerCartridgeMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); } case 7: { - LogStep(7, "Read the global attribute: AcceptedCommandList"); + LogStep(7, "Read the optional attribute InPlaceIndicator (TCREMON.S.A0002) in AttributeList"); + VerifyOrDo(!ShouldSkip("TCREMON.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TonerCartridgeMonitoring::Id, - TonerCartridgeMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + TonerCartridgeMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); } case 8: { - LogStep(8, "Read the global attribute: GeneratedCommandList"); + LogStep(8, "Read the global attribute: AcceptedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TonerCartridgeMonitoring::Id, - TonerCartridgeMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + TonerCartridgeMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); } case 9: { - LogStep(9, "TH reads EventList attribute from DUT"); + LogStep(9, "Read the optional command (ResetCondition) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("TCREMON.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TonerCartridgeMonitoring::Id, + TonerCartridgeMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TonerCartridgeMonitoring::Id, + TonerCartridgeMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "TH reads EventList attribute from DUT"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TonerCartridgeMonitoring::Id, TonerCartridgeMonitoring::Attributes::EventList::Id, true, chip::NullOptional); } @@ -98767,7 +99037,7 @@ class Test_TC_UVFREMON_1_1Suite : public TestCommand { public: Test_TC_UVFREMON_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_UVFREMON_1_1", 10, credsIssuerConfig) + TestCommand("Test_TC_UVFREMON_1_1", 12, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -98868,12 +99138,30 @@ class Test_TC_UVFREMON_1_1Suite : public TestCommand case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); } break; case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -98885,7 +99173,7 @@ class Test_TC_UVFREMON_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "list", "list")); } break; - case 9: + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -98954,17 +99242,29 @@ class Test_TC_UVFREMON_1_1Suite : public TestCommand UvFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); } case 7: { - LogStep(7, "Read the global attribute: AcceptedCommandList"); + LogStep(7, "Read the optional attribute InPlaceIndicator (UVFREMON.S.A0002) in AttributeList"); + VerifyOrDo(!ShouldSkip("UVFREMON.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UvFilterMonitoring::Id, - UvFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + UvFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); } case 8: { - LogStep(8, "Read the global attribute: GeneratedCommandList"); + LogStep(8, "Read the global attribute: AcceptedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UvFilterMonitoring::Id, - UvFilterMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + UvFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); } case 9: { - LogStep(9, "TH reads EventList attribute from DUT"); + LogStep(9, "Read the optional command (ResetCondition) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("UVFREMON.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UvFilterMonitoring::Id, + UvFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UvFilterMonitoring::Id, + UvFilterMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "TH reads EventList attribute from DUT"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UvFilterMonitoring::Id, UvFilterMonitoring::Attributes::EventList::Id, true, chip::NullOptional); } @@ -99107,7 +99407,7 @@ class Test_TC_WTREMON_1_1Suite : public TestCommand { public: Test_TC_WTREMON_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_WTREMON_1_1", 10, credsIssuerConfig) + TestCommand("Test_TC_WTREMON_1_1", 12, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -99208,12 +99508,30 @@ class Test_TC_WTREMON_1_1Suite : public TestCommand case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); } break; case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -99225,7 +99543,7 @@ class Test_TC_WTREMON_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "list", "list")); } break; - case 9: + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -99294,17 +99612,29 @@ class Test_TC_WTREMON_1_1Suite : public TestCommand WaterTankMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); } case 7: { - LogStep(7, "Read the global attribute: AcceptedCommandList"); + LogStep(7, "Read the optional attribute InPlaceIndicator (WTREMON.S.A0002) in AttributeList"); + VerifyOrDo(!ShouldSkip("WTREMON.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WaterTankMonitoring::Id, - WaterTankMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + WaterTankMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); } case 8: { - LogStep(8, "Read the global attribute: GeneratedCommandList"); + LogStep(8, "Read the global attribute: AcceptedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WaterTankMonitoring::Id, - WaterTankMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + WaterTankMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); } case 9: { - LogStep(9, "TH reads EventList attribute from DUT"); + LogStep(9, "Read the optional command (ResetCondition) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("WTREMON.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WaterTankMonitoring::Id, + WaterTankMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WaterTankMonitoring::Id, + WaterTankMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "TH reads EventList attribute from DUT"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WaterTankMonitoring::Id, WaterTankMonitoring::Attributes::EventList::Id, true, chip::NullOptional); } @@ -99447,7 +99777,7 @@ class Test_TC_ZEOFREMON_1_1Suite : public TestCommand { public: Test_TC_ZEOFREMON_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_ZEOFREMON_1_1", 10, credsIssuerConfig) + TestCommand("Test_TC_ZEOFREMON_1_1", 12, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -99548,12 +99878,30 @@ class Test_TC_ZEOFREMON_1_1Suite : public TestCommand case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); } break; case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -99565,7 +99913,7 @@ class Test_TC_ZEOFREMON_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "list", "list")); } break; - case 9: + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -99634,17 +99982,29 @@ class Test_TC_ZEOFREMON_1_1Suite : public TestCommand ZeoliteFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); } case 7: { - LogStep(7, "Read the global attribute: AcceptedCommandList"); + LogStep(7, "Read the optional attribute InPlaceIndicator (ZEOFREMON.S.A0002) in AttributeList"); + VerifyOrDo(!ShouldSkip("ZEOFREMON.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ZeoliteFilterMonitoring::Id, - ZeoliteFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + ZeoliteFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); } case 8: { - LogStep(8, "Read the global attribute: GeneratedCommandList"); + LogStep(8, "Read the global attribute: AcceptedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ZeoliteFilterMonitoring::Id, - ZeoliteFilterMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + ZeoliteFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); } case 9: { - LogStep(9, "TH reads EventList attribute from DUT"); + LogStep(9, "Read the optional command (ResetCondition) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("ZEOFREMON.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ZeoliteFilterMonitoring::Id, + ZeoliteFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ZeoliteFilterMonitoring::Id, + ZeoliteFilterMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "TH reads EventList attribute from DUT"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ZeoliteFilterMonitoring::Id, ZeoliteFilterMonitoring::Attributes::EventList::Id, true, chip::NullOptional); } diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index 7547b0cee0b3be..20b3bc6829c045 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -145940,16 +145940,33 @@ class Test_TC_ACFREMON_1_1 : public TestCommandBridge { err = TestReadTheFeatureDependentACFREMONSF00AttributeInAttributeList_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + ChipLogProgress(chipTool, + " ***** Test Step 7 : Read the optional attribute InPlaceIndicator (ACFREMON.S.A0002) in AttributeList\n"); + if (ShouldSkip("ACFREMON.S.A0002")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeInPlaceIndicatorAcfremonsa0002InAttributeList_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads EventList attribute from DUT\n"); - err = TestThReadsEventListAttributeFromDut_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Read the optional command (ResetCondition) in AcceptedCommandList\n"); + if (ShouldSkip("ACFREMON.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestReadTheOptionalCommandResetConditionInAcceptedCommandList_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : TH reads EventList attribute from DUT\n"); + err = TestThReadsEventListAttributeFromDut_11(); break; } @@ -145992,6 +146009,12 @@ class Test_TC_ACFREMON_1_1 : public TestCommandBridge { case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -146005,7 +146028,7 @@ class Test_TC_ACFREMON_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + const uint16_t mTestCount = 12; chip::Optional mNodeId; chip::Optional mCluster; @@ -146167,7 +146190,30 @@ class Test_TC_ACFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() + CHIP_ERROR TestReadTheOptionalAttributeInPlaceIndicatorAcfremonsa0002InAttributeList_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterActivatedCarbonFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute InPlaceIndicator (ACFREMON.S.A0002) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_8() { MTRBaseDevice * device = GetDevice("alpha"); @@ -146188,7 +146234,30 @@ class Test_TC_ACFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + CHIP_ERROR TestReadTheOptionalCommandResetConditionInAcceptedCommandList_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterActivatedCarbonFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional command (ResetCondition) in AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_10() { MTRBaseDevice * device = GetDevice("alpha"); @@ -146214,7 +146283,7 @@ class Test_TC_ACFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsEventListAttributeFromDut_9() + CHIP_ERROR TestThReadsEventListAttributeFromDut_11() { MTRBaseDevice * device = GetDevice("alpha"); @@ -146549,16 +146618,33 @@ class Test_TC_CFREMON_1_1 : public TestCommandBridge { err = TestReadTheFeatureDependentCFREMONSF00AttributeInAttributeList_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + ChipLogProgress( + chipTool, " ***** Test Step 7 : Read the optional attribute InPlaceIndicator (CFREMON.S.A0002) in AttributeList\n"); + if (ShouldSkip("CFREMON.S.A0002")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeInPlaceIndicatorCfremonsa0002InAttributeList_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads EventList attribute from DUT\n"); - err = TestThReadsEventListAttributeFromDut_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Read the optional command (ResetCondition) in AcceptedCommandList\n"); + if (ShouldSkip("CFREMON.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestReadTheOptionalCommandResetConditionInAcceptedCommandList_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : TH reads EventList attribute from DUT\n"); + err = TestThReadsEventListAttributeFromDut_11(); break; } @@ -146601,6 +146687,12 @@ class Test_TC_CFREMON_1_1 : public TestCommandBridge { case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -146614,7 +146706,7 @@ class Test_TC_CFREMON_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + const uint16_t mTestCount = 12; chip::Optional mNodeId; chip::Optional mCluster; @@ -146776,7 +146868,30 @@ class Test_TC_CFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() + CHIP_ERROR TestReadTheOptionalAttributeInPlaceIndicatorCfremonsa0002InAttributeList_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCeramicFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute InPlaceIndicator (CFREMON.S.A0002) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_8() { MTRBaseDevice * device = GetDevice("alpha"); @@ -146797,7 +146912,30 @@ class Test_TC_CFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + CHIP_ERROR TestReadTheOptionalCommandResetConditionInAcceptedCommandList_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCeramicFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional command (ResetCondition) in AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_10() { MTRBaseDevice * device = GetDevice("alpha"); @@ -146823,7 +146961,7 @@ class Test_TC_CFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsEventListAttributeFromDut_9() + CHIP_ERROR TestThReadsEventListAttributeFromDut_11() { MTRBaseDevice * device = GetDevice("alpha"); @@ -147158,16 +147296,33 @@ class Test_TC_ESFREMON_1_1 : public TestCommandBridge { err = TestReadTheFeatureDependentESFREMONSF00AttributeInAttributeList_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + ChipLogProgress(chipTool, + " ***** Test Step 7 : Read the optional attribute InPlaceIndicator (ESFREMON.S.A0002) in AttributeList\n"); + if (ShouldSkip("ESFREMON.S.A0002")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeInPlaceIndicatorEsfremonsa0002InAttributeList_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads EventList attribute from DUT\n"); - err = TestThReadsEventListAttributeFromDut_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Read the optional command (ResetCondition) in AcceptedCommandList\n"); + if (ShouldSkip("ESFREMON.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestReadTheOptionalCommandResetConditionInAcceptedCommandList_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : TH reads EventList attribute from DUT\n"); + err = TestThReadsEventListAttributeFromDut_11(); break; } @@ -147210,6 +147365,12 @@ class Test_TC_ESFREMON_1_1 : public TestCommandBridge { case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -147223,7 +147384,7 @@ class Test_TC_ESFREMON_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + const uint16_t mTestCount = 12; chip::Optional mNodeId; chip::Optional mCluster; @@ -147385,7 +147546,30 @@ class Test_TC_ESFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() + CHIP_ERROR TestReadTheOptionalAttributeInPlaceIndicatorEsfremonsa0002InAttributeList_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterElectrostaticFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute InPlaceIndicator (ESFREMON.S.A0002) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_8() { MTRBaseDevice * device = GetDevice("alpha"); @@ -147406,7 +147590,30 @@ class Test_TC_ESFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + CHIP_ERROR TestReadTheOptionalCommandResetConditionInAcceptedCommandList_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterElectrostaticFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional command (ResetCondition) in AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_10() { MTRBaseDevice * device = GetDevice("alpha"); @@ -147432,7 +147639,7 @@ class Test_TC_ESFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsEventListAttributeFromDut_9() + CHIP_ERROR TestThReadsEventListAttributeFromDut_11() { MTRBaseDevice * device = GetDevice("alpha"); @@ -147767,16 +147974,33 @@ class Test_TC_FTREMON_1_1 : public TestCommandBridge { err = TestReadTheFeatureDependentFTREMONSF00AttributeInAttributeList_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + ChipLogProgress( + chipTool, " ***** Test Step 7 : Read the optional attribute InPlaceIndicator (FTREMON.S.A0002) in AttributeList\n"); + if (ShouldSkip("FTREMON.S.A0002")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeInPlaceIndicatorFtremonsa0002InAttributeList_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads EventList attribute from DUT\n"); - err = TestThReadsEventListAttributeFromDut_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Read the optional command (ResetCondition) in AcceptedCommandList\n"); + if (ShouldSkip("FTREMON.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestReadTheOptionalCommandResetConditionInAcceptedCommandList_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : TH reads EventList attribute from DUT\n"); + err = TestThReadsEventListAttributeFromDut_11(); break; } @@ -147819,6 +148043,12 @@ class Test_TC_FTREMON_1_1 : public TestCommandBridge { case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -147832,7 +148062,7 @@ class Test_TC_FTREMON_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + const uint16_t mTestCount = 12; chip::Optional mNodeId; chip::Optional mCluster; @@ -147994,7 +148224,7 @@ class Test_TC_FTREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() + CHIP_ERROR TestReadTheOptionalAttributeInPlaceIndicatorFtremonsa0002InAttributeList_7() { MTRBaseDevice * device = GetDevice("alpha"); @@ -148003,19 +148233,65 @@ class Test_TC_FTREMON_1_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute InPlaceIndicator (FTREMON.S.A0002) in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - NextTest(); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFuelTankMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalCommandResetConditionInAcceptedCommandList_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFuelTankMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional command (ResetCondition) in AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_10() { MTRBaseDevice * device = GetDevice("alpha"); @@ -148041,7 +148317,7 @@ class Test_TC_FTREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsEventListAttributeFromDut_9() + CHIP_ERROR TestThReadsEventListAttributeFromDut_11() { MTRBaseDevice * device = GetDevice("alpha"); @@ -148376,16 +148652,33 @@ class Test_TC_HEPAFREMON_1_1 : public TestCommandBridge { err = TestReadTheFeatureDependentHEPAFREMONSF00AttributeInAttributeList_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + ChipLogProgress(chipTool, + " ***** Test Step 7 : Read the optional attribute InPlaceIndicator (HEPAFREMON.S.A0002) in AttributeList\n"); + if (ShouldSkip("HEPAFREMON.S.A0002")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeInPlaceIndicatorHepafremonsa0002InAttributeList_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads EventList attribute from DUT\n"); - err = TestThReadsEventListAttributeFromDut_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Read the optional command (ResetCondition) in AcceptedCommandList\n"); + if (ShouldSkip("HEPAFREMON.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestReadTheOptionalCommandResetConditionInAcceptedCommandList_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : TH reads EventList attribute from DUT\n"); + err = TestThReadsEventListAttributeFromDut_11(); break; } @@ -148428,6 +148721,12 @@ class Test_TC_HEPAFREMON_1_1 : public TestCommandBridge { case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -148441,7 +148740,7 @@ class Test_TC_HEPAFREMON_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + const uint16_t mTestCount = 12; chip::Optional mNodeId; chip::Optional mCluster; @@ -148603,7 +148902,30 @@ class Test_TC_HEPAFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() + CHIP_ERROR TestReadTheOptionalAttributeInPlaceIndicatorHepafremonsa0002InAttributeList_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterHEPAFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute InPlaceIndicator (HEPAFREMON.S.A0002) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_8() { MTRBaseDevice * device = GetDevice("alpha"); @@ -148624,7 +148946,30 @@ class Test_TC_HEPAFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + CHIP_ERROR TestReadTheOptionalCommandResetConditionInAcceptedCommandList_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterHEPAFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional command (ResetCondition) in AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_10() { MTRBaseDevice * device = GetDevice("alpha"); @@ -148650,7 +148995,7 @@ class Test_TC_HEPAFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsEventListAttributeFromDut_9() + CHIP_ERROR TestThReadsEventListAttributeFromDut_11() { MTRBaseDevice * device = GetDevice("alpha"); @@ -148985,16 +149330,33 @@ class Test_TC_INKCREMON_1_1 : public TestCommandBridge { err = TestReadTheFeatureDependentINKCREMONSF00AttributeInAttributeList_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + ChipLogProgress(chipTool, + " ***** Test Step 7 : Read the optional attribute InPlaceIndicator (INKCREMON.S.A0002) in AttributeList\n"); + if (ShouldSkip("INKCREMON.S.A0002")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeInPlaceIndicatorInkcremonsa0002InAttributeList_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads EventList attribute from DUT\n"); - err = TestThReadsEventListAttributeFromDut_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Read the optional command (ResetCondition) in AcceptedCommandList\n"); + if (ShouldSkip("INKCREMON.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestReadTheOptionalCommandResetConditionInAcceptedCommandList_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : TH reads EventList attribute from DUT\n"); + err = TestThReadsEventListAttributeFromDut_11(); break; } @@ -149037,6 +149399,12 @@ class Test_TC_INKCREMON_1_1 : public TestCommandBridge { case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -149050,7 +149418,7 @@ class Test_TC_INKCREMON_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + const uint16_t mTestCount = 12; chip::Optional mNodeId; chip::Optional mCluster; @@ -149212,7 +149580,30 @@ class Test_TC_INKCREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() + CHIP_ERROR TestReadTheOptionalAttributeInPlaceIndicatorInkcremonsa0002InAttributeList_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterInkCartridgeMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute InPlaceIndicator (INKCREMON.S.A0002) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_8() { MTRBaseDevice * device = GetDevice("alpha"); @@ -149233,7 +149624,30 @@ class Test_TC_INKCREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + CHIP_ERROR TestReadTheOptionalCommandResetConditionInAcceptedCommandList_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterInkCartridgeMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional command (ResetCondition) in AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_10() { MTRBaseDevice * device = GetDevice("alpha"); @@ -149259,7 +149673,7 @@ class Test_TC_INKCREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsEventListAttributeFromDut_9() + CHIP_ERROR TestThReadsEventListAttributeFromDut_11() { MTRBaseDevice * device = GetDevice("alpha"); @@ -149594,16 +150008,33 @@ class Test_TC_IONFREMON_1_1 : public TestCommandBridge { err = TestReadTheFeatureDependentIONFREMONSF00AttributeInAttributeList_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + ChipLogProgress(chipTool, + " ***** Test Step 7 : Read the optional attribute InPlaceIndicator (IONFREMON.S.A0002) in AttributeList\n"); + if (ShouldSkip("IONFREMON.S.A0002")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeInPlaceIndicatorIonfremonsa0002InAttributeList_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads EventList attribute from DUT\n"); - err = TestThReadsEventListAttributeFromDut_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Read the optional command (ResetCondition) in AcceptedCommandList\n"); + if (ShouldSkip("IONFREMON.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestReadTheOptionalCommandResetConditionInAcceptedCommandList_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : TH reads EventList attribute from DUT\n"); + err = TestThReadsEventListAttributeFromDut_11(); break; } @@ -149646,6 +150077,12 @@ class Test_TC_IONFREMON_1_1 : public TestCommandBridge { case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -149659,7 +150096,7 @@ class Test_TC_IONFREMON_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + const uint16_t mTestCount = 12; chip::Optional mNodeId; chip::Optional mCluster; @@ -149821,7 +150258,30 @@ class Test_TC_IONFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() + CHIP_ERROR TestReadTheOptionalAttributeInPlaceIndicatorIonfremonsa0002InAttributeList_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterIonizingFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute InPlaceIndicator (IONFREMON.S.A0002) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_8() { MTRBaseDevice * device = GetDevice("alpha"); @@ -149842,7 +150302,30 @@ class Test_TC_IONFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + CHIP_ERROR TestReadTheOptionalCommandResetConditionInAcceptedCommandList_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterIonizingFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional command (ResetCondition) in AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_10() { MTRBaseDevice * device = GetDevice("alpha"); @@ -149868,7 +150351,7 @@ class Test_TC_IONFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsEventListAttributeFromDut_9() + CHIP_ERROR TestThReadsEventListAttributeFromDut_11() { MTRBaseDevice * device = GetDevice("alpha"); @@ -150203,16 +150686,33 @@ class Test_TC_OZFREMON_1_1 : public TestCommandBridge { err = TestReadTheFeatureDependentOZFREMONSF00AttributeInAttributeList_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + ChipLogProgress(chipTool, + " ***** Test Step 7 : Read the optional attribute InPlaceIndicator (OZFREMON.S.A0002) in AttributeList\n"); + if (ShouldSkip("OZFREMON.S.A0002")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeInPlaceIndicatorOzfremonsa0002InAttributeList_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads EventList attribute from DUT\n"); - err = TestThReadsEventListAttributeFromDut_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Read the optional command (ResetCondition) in AcceptedCommandList\n"); + if (ShouldSkip("OZFREMON.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestReadTheOptionalCommandResetConditionInAcceptedCommandList_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : TH reads EventList attribute from DUT\n"); + err = TestThReadsEventListAttributeFromDut_11(); break; } @@ -150255,6 +150755,12 @@ class Test_TC_OZFREMON_1_1 : public TestCommandBridge { case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -150268,7 +150774,7 @@ class Test_TC_OZFREMON_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + const uint16_t mTestCount = 12; chip::Optional mNodeId; chip::Optional mCluster; @@ -150430,7 +150936,30 @@ class Test_TC_OZFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() + CHIP_ERROR TestReadTheOptionalAttributeInPlaceIndicatorOzfremonsa0002InAttributeList_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute InPlaceIndicator (OZFREMON.S.A0002) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_8() { MTRBaseDevice * device = GetDevice("alpha"); @@ -150451,7 +150980,30 @@ class Test_TC_OZFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + CHIP_ERROR TestReadTheOptionalCommandResetConditionInAcceptedCommandList_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional command (ResetCondition) in AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_10() { MTRBaseDevice * device = GetDevice("alpha"); @@ -150477,7 +151029,7 @@ class Test_TC_OZFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsEventListAttributeFromDut_9() + CHIP_ERROR TestThReadsEventListAttributeFromDut_11() { MTRBaseDevice * device = GetDevice("alpha"); @@ -150812,16 +151364,33 @@ class Test_TC_TCREMON_1_1 : public TestCommandBridge { err = TestReadTheFeatureDependentTCREMONSF00AttributeInAttributeList_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + ChipLogProgress( + chipTool, " ***** Test Step 7 : Read the optional attribute InPlaceIndicator (TCREMON.S.A0002) in AttributeList\n"); + if (ShouldSkip("TCREMON.S.A0002")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeInPlaceIndicatorTcremonsa0002InAttributeList_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads EventList attribute from DUT\n"); - err = TestThReadsEventListAttributeFromDut_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Read the optional command (ResetCondition) in AcceptedCommandList\n"); + if (ShouldSkip("TCREMON.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestReadTheOptionalCommandResetConditionInAcceptedCommandList_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : TH reads EventList attribute from DUT\n"); + err = TestThReadsEventListAttributeFromDut_11(); break; } @@ -150864,6 +151433,12 @@ class Test_TC_TCREMON_1_1 : public TestCommandBridge { case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -150877,7 +151452,7 @@ class Test_TC_TCREMON_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + const uint16_t mTestCount = 12; chip::Optional mNodeId; chip::Optional mCluster; @@ -150979,14 +151554,67 @@ class Test_TC_TCREMON_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTonerCartridgeMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheFeatureDependentTCREMONSF00AttributeInAttributeList_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTonerCartridgeMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the feature dependent(TCREMON.S.F00) attribute in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_5() + CHIP_ERROR TestReadTheOptionalAttributeInPlaceIndicatorTcremonsa0002InAttributeList_7() { MTRBaseDevice * device = GetDevice("alpha"); @@ -150996,18 +151624,12 @@ class Test_TC_TCREMON_1_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); + NSLog(@"Read the optional attribute InPlaceIndicator (TCREMON.S.A0002) in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); NextTest(); }]; @@ -151015,7 +151637,7 @@ class Test_TC_TCREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheFeatureDependentTCREMONSF00AttributeInAttributeList_6() + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_8() { MTRBaseDevice * device = GetDevice("alpha"); @@ -151024,22 +151646,19 @@ class Test_TC_TCREMON_1_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the feature dependent(TCREMON.S.F00) attribute in AttributeList Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); - + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() + CHIP_ERROR TestReadTheOptionalCommandResetConditionInAcceptedCommandList_9() { MTRBaseDevice * device = GetDevice("alpha"); @@ -151049,18 +151668,20 @@ class Test_TC_TCREMON_1_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + NSLog(@"Read the optional command (ResetCondition) in AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_10() { MTRBaseDevice * device = GetDevice("alpha"); @@ -151086,7 +151707,7 @@ class Test_TC_TCREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsEventListAttributeFromDut_9() + CHIP_ERROR TestThReadsEventListAttributeFromDut_11() { MTRBaseDevice * device = GetDevice("alpha"); @@ -151421,16 +152042,33 @@ class Test_TC_UVFREMON_1_1 : public TestCommandBridge { err = TestReadTheFeatureDependentUVFREMONSF00AttributeInAttributeList_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + ChipLogProgress(chipTool, + " ***** Test Step 7 : Read the optional attribute InPlaceIndicator (UVFREMON.S.A0002) in AttributeList\n"); + if (ShouldSkip("UVFREMON.S.A0002")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeInPlaceIndicatorUvfremonsa0002InAttributeList_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads EventList attribute from DUT\n"); - err = TestThReadsEventListAttributeFromDut_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Read the optional command (ResetCondition) in AcceptedCommandList\n"); + if (ShouldSkip("UVFREMON.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestReadTheOptionalCommandResetConditionInAcceptedCommandList_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : TH reads EventList attribute from DUT\n"); + err = TestThReadsEventListAttributeFromDut_11(); break; } @@ -151473,6 +152111,12 @@ class Test_TC_UVFREMON_1_1 : public TestCommandBridge { case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -151486,7 +152130,7 @@ class Test_TC_UVFREMON_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + const uint16_t mTestCount = 12; chip::Optional mNodeId; chip::Optional mCluster; @@ -151648,7 +152292,30 @@ class Test_TC_UVFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() + CHIP_ERROR TestReadTheOptionalAttributeInPlaceIndicatorUvfremonsa0002InAttributeList_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUVFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute InPlaceIndicator (UVFREMON.S.A0002) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_8() { MTRBaseDevice * device = GetDevice("alpha"); @@ -151669,7 +152336,30 @@ class Test_TC_UVFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + CHIP_ERROR TestReadTheOptionalCommandResetConditionInAcceptedCommandList_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUVFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional command (ResetCondition) in AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_10() { MTRBaseDevice * device = GetDevice("alpha"); @@ -151695,7 +152385,7 @@ class Test_TC_UVFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsEventListAttributeFromDut_9() + CHIP_ERROR TestThReadsEventListAttributeFromDut_11() { MTRBaseDevice * device = GetDevice("alpha"); @@ -152030,16 +152720,33 @@ class Test_TC_WTREMON_1_1 : public TestCommandBridge { err = TestReadTheFeatureDependentWTREMONSF00AttributeInAttributeList_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + ChipLogProgress( + chipTool, " ***** Test Step 7 : Read the optional attribute InPlaceIndicator (WTREMON.S.A0002) in AttributeList\n"); + if (ShouldSkip("WTREMON.S.A0002")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeInPlaceIndicatorWtremonsa0002InAttributeList_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads EventList attribute from DUT\n"); - err = TestThReadsEventListAttributeFromDut_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Read the optional command (ResetCondition) in AcceptedCommandList\n"); + if (ShouldSkip("WTREMON.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestReadTheOptionalCommandResetConditionInAcceptedCommandList_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : TH reads EventList attribute from DUT\n"); + err = TestThReadsEventListAttributeFromDut_11(); break; } @@ -152082,6 +152789,12 @@ class Test_TC_WTREMON_1_1 : public TestCommandBridge { case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -152095,7 +152808,7 @@ class Test_TC_WTREMON_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + const uint16_t mTestCount = 12; chip::Optional mNodeId; chip::Optional mCluster; @@ -152257,7 +152970,30 @@ class Test_TC_WTREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() + CHIP_ERROR TestReadTheOptionalAttributeInPlaceIndicatorWtremonsa0002InAttributeList_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterWaterTankMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute InPlaceIndicator (WTREMON.S.A0002) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_8() { MTRBaseDevice * device = GetDevice("alpha"); @@ -152278,7 +153014,30 @@ class Test_TC_WTREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + CHIP_ERROR TestReadTheOptionalCommandResetConditionInAcceptedCommandList_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterWaterTankMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional command (ResetCondition) in AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_10() { MTRBaseDevice * device = GetDevice("alpha"); @@ -152304,7 +153063,7 @@ class Test_TC_WTREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsEventListAttributeFromDut_9() + CHIP_ERROR TestThReadsEventListAttributeFromDut_11() { MTRBaseDevice * device = GetDevice("alpha"); @@ -152639,16 +153398,33 @@ class Test_TC_ZEOFREMON_1_1 : public TestCommandBridge { err = TestReadTheFeatureDependentZEOFREMONSF00AttributeInAttributeList_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_7(); + ChipLogProgress(chipTool, + " ***** Test Step 7 : Read the optional attribute InPlaceIndicator (ZEOFREMON.S.A0002) in AttributeList\n"); + if (ShouldSkip("ZEOFREMON.S.A0002")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeInPlaceIndicatorZeofremonsa0002InAttributeList_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads EventList attribute from DUT\n"); - err = TestThReadsEventListAttributeFromDut_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Read the optional command (ResetCondition) in AcceptedCommandList\n"); + if (ShouldSkip("ZEOFREMON.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestReadTheOptionalCommandResetConditionInAcceptedCommandList_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : TH reads EventList attribute from DUT\n"); + err = TestThReadsEventListAttributeFromDut_11(); break; } @@ -152691,6 +153467,12 @@ class Test_TC_ZEOFREMON_1_1 : public TestCommandBridge { case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -152704,7 +153486,7 @@ class Test_TC_ZEOFREMON_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + const uint16_t mTestCount = 12; chip::Optional mNodeId; chip::Optional mCluster; @@ -152866,7 +153648,30 @@ class Test_TC_ZEOFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_7() + CHIP_ERROR TestReadTheOptionalAttributeInPlaceIndicatorZeofremonsa0002InAttributeList_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterZeoliteFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute InPlaceIndicator (ZEOFREMON.S.A0002) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_8() { MTRBaseDevice * device = GetDevice("alpha"); @@ -152887,7 +153692,30 @@ class Test_TC_ZEOFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_8() + CHIP_ERROR TestReadTheOptionalCommandResetConditionInAcceptedCommandList_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterZeoliteFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional command (ResetCondition) in AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_10() { MTRBaseDevice * device = GetDevice("alpha"); @@ -152913,7 +153741,7 @@ class Test_TC_ZEOFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsEventListAttributeFromDut_9() + CHIP_ERROR TestThReadsEventListAttributeFromDut_11() { MTRBaseDevice * device = GetDevice("alpha"); From 1cc8acbcaca3270c260c85fb023c2aaa837fca22 Mon Sep 17 00:00:00 2001 From: Graf Tobias <4622393+tobiasgraf@users.noreply.github.com> Date: Tue, 30 May 2023 15:46:38 +0200 Subject: [PATCH 14/16] Apply restyled patch --- src/app/tests/suites/certification/PICS.yaml | 96 ++++++++++++++----- .../certification/Test_TC_ACFREMON_1_1.yaml | 11 ++- .../certification/Test_TC_CFREMON_1_1.yaml | 11 ++- .../certification/Test_TC_ESFREMON_1_1.yaml | 11 ++- .../certification/Test_TC_FTREMON_1_1.yaml | 11 ++- .../certification/Test_TC_HEPAFREMON_1_1.yaml | 4 +- .../certification/Test_TC_INKCREMON_1_1.yaml | 4 +- .../certification/Test_TC_IONFREMON_1_1.yaml | 4 +- .../certification/Test_TC_OZFREMON_1_1.yaml | 11 ++- .../certification/Test_TC_TCREMON_1_1.yaml | 11 ++- .../certification/Test_TC_UVFREMON_1_1.yaml | 11 ++- .../certification/Test_TC_WTREMON_1_1.yaml | 11 ++- .../certification/Test_TC_ZEOFREMON_1_1.yaml | 4 +- 13 files changed, 132 insertions(+), 68 deletions(-) diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index 0bec1f764f770b..70b78c8a7661cb 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -3752,10 +3752,14 @@ PICS: id: G.C.C05.Tx # HEPA Filter Monitoring Cluster Test Plan - - label: "Does the device implement the HEPA Filter Monitoring cluster as a server?" + - label: + "Does the device implement the HEPA Filter Monitoring cluster as a + server?" id: HEPAFREMON.S - - label: "Does the device implement the HEPA Filter Monitoring cluster as a client?" + - label: + "Does the device implement the HEPA Filter Monitoring cluster as a + client?" id: HEPAFREMON.C # @@ -3789,10 +3793,14 @@ PICS: id: HEPAFREMON.S.C00.Rsp # Activated Carbon Filter Monitoring Cluster Test Plan - - label: "Does the device implement the Activated Carbon Filter Monitoring cluster as a server?" + - label: + "Does the device implement the Activated Carbon Filter Monitoring + cluster as a server?" id: ACFREMON.S - - label: "Does the device implement the Activated Carbon Filter Monitoring cluster as a client?" + - label: + "Does the device implement the Activated Carbon Filter Monitoring + cluster as a client?" id: ACFREMON.C # @@ -3826,10 +3834,14 @@ PICS: id: ACFREMON.S.C00.Rsp # Ceramic Filter Monitoring Cluster Test Plan - - label: "Does the device implement the Ceramic Filter Monitoring cluster as a server?" + - label: + "Does the device implement the Ceramic Filter Monitoring cluster as a + server?" id: CFREMON.S - - label: "Does the device implement the Ceramic Filter Monitoring cluster as a client?" + - label: + "Does the device implement the Ceramic Filter Monitoring cluster as a + client?" id: CFREMON.C # @@ -3863,10 +3875,14 @@ PICS: id: CFREMON.S.C00.Rsp # Electrostatic Filter Monitoring Cluster Test Plan - - label: "Does the device implement the Electrostatic Filter Monitoring cluster as a server?" + - label: + "Does the device implement the Electrostatic Filter Monitoring cluster + as a server?" id: ESFREMON.S - - label: "Does the device implement the Electrostatic Filter Monitoring cluster as a client?" + - label: + "Does the device implement the Electrostatic Filter Monitoring cluster + as a client?" id: ESFREMON.C # @@ -3900,10 +3916,14 @@ PICS: id: ESFREMON.S.C00.Rsp # Fuel Tank Monitoring Cluster Test Plan - - label: "Does the device implement the Fuel Tank Monitoring cluster as a server?" + - label: + "Does the device implement the Fuel Tank Monitoring cluster as a + server?" id: FTREMON.S - - label: "Does the device implement the Fuel Tank Monitoring cluster as a client?" + - label: + "Does the device implement the Fuel Tank Monitoring cluster as a + client?" id: FTREMON.C # @@ -3937,10 +3957,14 @@ PICS: id: FTREMON.S.C00.Rsp # Ink Cartridge Monitoring Cluster Test Plan - - label: "Does the device implement the Ink Cartridge Monitoring cluster as a server?" + - label: + "Does the device implement the Ink Cartridge Monitoring cluster as a + server?" id: INKCREMON.S - - label: "Does the device implement the Ink Cartridge Monitoring cluster as a client?" + - label: + "Does the device implement the Ink Cartridge Monitoring cluster as a + client?" id: INKCREMON.C # @@ -3974,10 +3998,14 @@ PICS: id: INKCREMON.S.C00.Rsp # Ionizing Filter Monitoring Cluster Test Plan - - label: "Does the device implement the Ionizing Filter Monitoring cluster as a server?" + - label: + "Does the device implement the Ionizing Filter Monitoring cluster as a + server?" id: IONFREMON.S - - label: "Does the device implement the Ionizing Filter Monitoring cluster as a client?" + - label: + "Does the device implement the Ionizing Filter Monitoring cluster as a + client?" id: IONFREMON.C # @@ -4011,10 +4039,14 @@ PICS: id: IONFREMON.S.C00.Rsp # Ozone Filter Monitoring Cluster Test Plan - - label: "Does the device implement the Ozone Filter Monitoring cluster as a server?" + - label: + "Does the device implement the Ozone Filter Monitoring cluster as a + server?" id: OZFREMON.S - - label: "Does the device implement the Ozone Filter Monitoring cluster as a client?" + - label: + "Does the device implement the Ozone Filter Monitoring cluster as a + client?" id: OZFREMON.C # @@ -4048,10 +4080,14 @@ PICS: id: OZFREMON.S.C00.Rsp # Toner Cartridge Monitoring Cluster Test Plan - - label: "Does the device implement the Toner Cartridge Monitoring cluster as a server?" + - label: + "Does the device implement the Toner Cartridge Monitoring cluster as a + server?" id: TCREMON.S - - label: "Does the device implement the Toner Cartridge Monitoring cluster as a client?" + - label: + "Does the device implement the Toner Cartridge Monitoring cluster as a + client?" id: TCREMON.C # @@ -4085,10 +4121,14 @@ PICS: id: TCREMON.S.C00.Rsp # UV Filter Monitoring Cluster Test Plan - - label: "Does the device implement the UV Filter Monitoring cluster as a server?" + - label: + "Does the device implement the UV Filter Monitoring cluster as a + server?" id: UVFREMON.S - - label: "Does the device implement the UV Filter Monitoring cluster as a client?" + - label: + "Does the device implement the UV Filter Monitoring cluster as a + client?" id: UVFREMON.C # @@ -4122,10 +4162,14 @@ PICS: id: UVFREMON.S.C00.Rsp # Water Tank Monitoring Cluster Test Plan - - label: "Does the device implement the Water Tank Monitoring cluster as a server?" + - label: + "Does the device implement the Water Tank Monitoring cluster as a + server?" id: WTREMON.S - - label: "Does the device implement the Water Tank Monitoring cluster as a client?" + - label: + "Does the device implement the Water Tank Monitoring cluster as a + client?" id: WTREMON.C # @@ -4159,10 +4203,14 @@ PICS: id: WTREMON.S.C00.Rsp # Zeolite Filter Monitoring Cluster Test Plan - - label: "Does the device implement the Zeolite Filter Monitoring cluster as a server?" + - label: + "Does the device implement the Zeolite Filter Monitoring cluster as a + server?" id: ZEOFREMON.S - - label: "Does the device implement the Zeolite Filter Monitoring cluster as a client?" + - label: + "Does the device implement the Zeolite Filter Monitoring cluster as a + client?" id: ZEOFREMON.C # diff --git a/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml index 55c20e1a33bc53..1e6d2f87c4074a 100644 --- a/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml @@ -49,8 +49,8 @@ tests: type: bitmap32 - label: - "Given ACFREMON.S.F00(Condition) ensure featuremap has the correct - bit set" + "Given ACFREMON.S.F00(Condition) ensure featuremap has the correct bit + set" command: "readAttribute" attribute: "FeatureMap" PICS: ACFREMON.S.F00 @@ -79,8 +79,7 @@ tests: contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] - label: - "Read the feature dependent(ACFREMON.S.F00) attribute in - AttributeList" + "Read the feature dependent(ACFREMON.S.F00) attribute in AttributeList" PICS: ACFREMON.S.F00 command: "readAttribute" attribute: "AttributeList" @@ -89,7 +88,9 @@ tests: type: list contains: [0, 1] - - label: "Read the optional attribute InPlaceIndicator (ACFREMON.S.A0002) in AttributeList" + - label: + "Read the optional attribute InPlaceIndicator (ACFREMON.S.A0002) in + AttributeList" PICS: ACFREMON.S.A0002 command: "readAttribute" attribute: "AttributeList" diff --git a/src/app/tests/suites/certification/Test_TC_CFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_CFREMON_1_1.yaml index 84c865f0eaaef5..aa148d15104ae3 100644 --- a/src/app/tests/suites/certification/Test_TC_CFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CFREMON_1_1.yaml @@ -49,8 +49,8 @@ tests: type: bitmap32 - label: - "Given CFREMON.S.F00(Condition) ensure featuremap has the correct - bit set" + "Given CFREMON.S.F00(Condition) ensure featuremap has the correct bit + set" command: "readAttribute" attribute: "FeatureMap" PICS: CFREMON.S.F00 @@ -79,8 +79,7 @@ tests: contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] - label: - "Read the feature dependent(CFREMON.S.F00) attribute in - AttributeList" + "Read the feature dependent(CFREMON.S.F00) attribute in AttributeList" PICS: CFREMON.S.F00 command: "readAttribute" attribute: "AttributeList" @@ -89,7 +88,9 @@ tests: type: list contains: [0, 1] - - label: "Read the optional attribute InPlaceIndicator (CFREMON.S.A0002) in AttributeList" + - label: + "Read the optional attribute InPlaceIndicator (CFREMON.S.A0002) in + AttributeList" PICS: CFREMON.S.A0002 command: "readAttribute" attribute: "AttributeList" diff --git a/src/app/tests/suites/certification/Test_TC_ESFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_ESFREMON_1_1.yaml index de88271298ad08..72375e898f6122 100644 --- a/src/app/tests/suites/certification/Test_TC_ESFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ESFREMON_1_1.yaml @@ -49,8 +49,8 @@ tests: type: bitmap32 - label: - "Given ESFREMON.S.F00(Condition) ensure featuremap has the correct - bit set" + "Given ESFREMON.S.F00(Condition) ensure featuremap has the correct bit + set" command: "readAttribute" attribute: "FeatureMap" PICS: ESFREMON.S.F00 @@ -79,8 +79,7 @@ tests: contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] - label: - "Read the feature dependent(ESFREMON.S.F00) attribute in - AttributeList" + "Read the feature dependent(ESFREMON.S.F00) attribute in AttributeList" PICS: ESFREMON.S.F00 command: "readAttribute" attribute: "AttributeList" @@ -89,7 +88,9 @@ tests: type: list contains: [0, 1] - - label: "Read the optional attribute InPlaceIndicator (ESFREMON.S.A0002) in AttributeList" + - label: + "Read the optional attribute InPlaceIndicator (ESFREMON.S.A0002) in + AttributeList" PICS: ESFREMON.S.A0002 command: "readAttribute" attribute: "AttributeList" diff --git a/src/app/tests/suites/certification/Test_TC_FTREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_FTREMON_1_1.yaml index bd9ac632a5e062..00449d882cd1aa 100644 --- a/src/app/tests/suites/certification/Test_TC_FTREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_FTREMON_1_1.yaml @@ -49,8 +49,8 @@ tests: type: bitmap32 - label: - "Given FTREMON.S.F00(Condition) ensure featuremap has the correct - bit set" + "Given FTREMON.S.F00(Condition) ensure featuremap has the correct bit + set" command: "readAttribute" attribute: "FeatureMap" PICS: FTREMON.S.F00 @@ -79,8 +79,7 @@ tests: contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] - label: - "Read the feature dependent(FTREMON.S.F00) attribute in - AttributeList" + "Read the feature dependent(FTREMON.S.F00) attribute in AttributeList" PICS: FTREMON.S.F00 command: "readAttribute" attribute: "AttributeList" @@ -89,7 +88,9 @@ tests: type: list contains: [0, 1] - - label: "Read the optional attribute InPlaceIndicator (FTREMON.S.A0002) in AttributeList" + - label: + "Read the optional attribute InPlaceIndicator (FTREMON.S.A0002) in + AttributeList" PICS: FTREMON.S.A0002 command: "readAttribute" attribute: "AttributeList" diff --git a/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml index 2f60c05d452331..d783404ad34534 100644 --- a/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml @@ -89,7 +89,9 @@ tests: type: list contains: [0, 1] - - label: "Read the optional attribute InPlaceIndicator (HEPAFREMON.S.A0002) in AttributeList" + - label: + "Read the optional attribute InPlaceIndicator (HEPAFREMON.S.A0002) in + AttributeList" PICS: HEPAFREMON.S.A0002 command: "readAttribute" attribute: "AttributeList" diff --git a/src/app/tests/suites/certification/Test_TC_INKCREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_INKCREMON_1_1.yaml index 41dc8073162b4c..303dbfd9538671 100644 --- a/src/app/tests/suites/certification/Test_TC_INKCREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_INKCREMON_1_1.yaml @@ -89,7 +89,9 @@ tests: type: list contains: [0, 1] - - label: "Read the optional attribute InPlaceIndicator (INKCREMON.S.A0002) in AttributeList" + - label: + "Read the optional attribute InPlaceIndicator (INKCREMON.S.A0002) in + AttributeList" PICS: INKCREMON.S.A0002 command: "readAttribute" attribute: "AttributeList" diff --git a/src/app/tests/suites/certification/Test_TC_IONFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_IONFREMON_1_1.yaml index 96ed378f62a52c..7e085c8766e2e3 100644 --- a/src/app/tests/suites/certification/Test_TC_IONFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_IONFREMON_1_1.yaml @@ -89,7 +89,9 @@ tests: type: list contains: [0, 1] - - label: "Read the optional attribute InPlaceIndicator (IONFREMON.S.A0002) in AttributeList" + - label: + "Read the optional attribute InPlaceIndicator (IONFREMON.S.A0002) in + AttributeList" PICS: IONFREMON.S.A0002 command: "readAttribute" attribute: "AttributeList" diff --git a/src/app/tests/suites/certification/Test_TC_OZFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_OZFREMON_1_1.yaml index 29dce02ae572fd..6c780be2faa5a0 100644 --- a/src/app/tests/suites/certification/Test_TC_OZFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_OZFREMON_1_1.yaml @@ -49,8 +49,8 @@ tests: type: bitmap32 - label: - "Given OZFREMON.S.F00(Condition) ensure featuremap has the correct - bit set" + "Given OZFREMON.S.F00(Condition) ensure featuremap has the correct bit + set" command: "readAttribute" attribute: "FeatureMap" PICS: OZFREMON.S.F00 @@ -79,8 +79,7 @@ tests: contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] - label: - "Read the feature dependent(OZFREMON.S.F00) attribute in - AttributeList" + "Read the feature dependent(OZFREMON.S.F00) attribute in AttributeList" PICS: OZFREMON.S.F00 command: "readAttribute" attribute: "AttributeList" @@ -89,7 +88,9 @@ tests: type: list contains: [0, 1] - - label: "Read the optional attribute InPlaceIndicator (OZFREMON.S.A0002) in AttributeList" + - label: + "Read the optional attribute InPlaceIndicator (OZFREMON.S.A0002) in + AttributeList" PICS: OZFREMON.S.A0002 command: "readAttribute" attribute: "AttributeList" diff --git a/src/app/tests/suites/certification/Test_TC_TCREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_TCREMON_1_1.yaml index d38888f89abe60..68fc52252a7030 100644 --- a/src/app/tests/suites/certification/Test_TC_TCREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCREMON_1_1.yaml @@ -49,8 +49,8 @@ tests: type: bitmap32 - label: - "Given TCREMON.S.F00(Condition) ensure featuremap has the correct - bit set" + "Given TCREMON.S.F00(Condition) ensure featuremap has the correct bit + set" command: "readAttribute" attribute: "FeatureMap" PICS: TCREMON.S.F00 @@ -79,8 +79,7 @@ tests: contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] - label: - "Read the feature dependent(TCREMON.S.F00) attribute in - AttributeList" + "Read the feature dependent(TCREMON.S.F00) attribute in AttributeList" PICS: TCREMON.S.F00 command: "readAttribute" attribute: "AttributeList" @@ -89,7 +88,9 @@ tests: type: list contains: [0, 1] - - label: "Read the optional attribute InPlaceIndicator (TCREMON.S.A0002) in AttributeList" + - label: + "Read the optional attribute InPlaceIndicator (TCREMON.S.A0002) in + AttributeList" PICS: TCREMON.S.A0002 command: "readAttribute" attribute: "AttributeList" diff --git a/src/app/tests/suites/certification/Test_TC_UVFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_UVFREMON_1_1.yaml index c7c73ba1f380bb..fcafe4738d74cd 100644 --- a/src/app/tests/suites/certification/Test_TC_UVFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_UVFREMON_1_1.yaml @@ -49,8 +49,8 @@ tests: type: bitmap32 - label: - "Given UVFREMON.S.F00(Condition) ensure featuremap has the correct - bit set" + "Given UVFREMON.S.F00(Condition) ensure featuremap has the correct bit + set" command: "readAttribute" attribute: "FeatureMap" PICS: UVFREMON.S.F00 @@ -79,8 +79,7 @@ tests: contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] - label: - "Read the feature dependent(UVFREMON.S.F00) attribute in - AttributeList" + "Read the feature dependent(UVFREMON.S.F00) attribute in AttributeList" PICS: UVFREMON.S.F00 command: "readAttribute" attribute: "AttributeList" @@ -89,7 +88,9 @@ tests: type: list contains: [0, 1] - - label: "Read the optional attribute InPlaceIndicator (UVFREMON.S.A0002) in AttributeList" + - label: + "Read the optional attribute InPlaceIndicator (UVFREMON.S.A0002) in + AttributeList" PICS: UVFREMON.S.A0002 command: "readAttribute" attribute: "AttributeList" diff --git a/src/app/tests/suites/certification/Test_TC_WTREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_WTREMON_1_1.yaml index 06478b44c32a50..94cb40c07d2505 100644 --- a/src/app/tests/suites/certification/Test_TC_WTREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_WTREMON_1_1.yaml @@ -49,8 +49,8 @@ tests: type: bitmap32 - label: - "Given WTREMON.S.F00(Condition) ensure featuremap has the correct - bit set" + "Given WTREMON.S.F00(Condition) ensure featuremap has the correct bit + set" command: "readAttribute" attribute: "FeatureMap" PICS: WTREMON.S.F00 @@ -79,8 +79,7 @@ tests: contains: [2, 65528, 65529, 65530, 65531, 65532, 65533] - label: - "Read the feature dependent(WTREMON.S.F00) attribute in - AttributeList" + "Read the feature dependent(WTREMON.S.F00) attribute in AttributeList" PICS: WTREMON.S.F00 command: "readAttribute" attribute: "AttributeList" @@ -89,7 +88,9 @@ tests: type: list contains: [0, 1] - - label: "Read the optional attribute InPlaceIndicator (WTREMON.S.A0002) in AttributeList" + - label: + "Read the optional attribute InPlaceIndicator (WTREMON.S.A0002) in + AttributeList" PICS: WTREMON.S.A0002 command: "readAttribute" attribute: "AttributeList" diff --git a/src/app/tests/suites/certification/Test_TC_ZEOFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_ZEOFREMON_1_1.yaml index 44f71aaf064b95..306f0094ca4537 100644 --- a/src/app/tests/suites/certification/Test_TC_ZEOFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ZEOFREMON_1_1.yaml @@ -89,7 +89,9 @@ tests: type: list contains: [0, 1] - - label: "Read the optional attribute InPlaceIndicator (ZEOFREMON.S.A0002) in AttributeList" + - label: + "Read the optional attribute InPlaceIndicator (ZEOFREMON.S.A0002) in + AttributeList" PICS: ZEOFREMON.S.A0002 command: "readAttribute" attribute: "AttributeList" From 0288d1ecaa8f100ba1915012fa460a4052dc1115 Mon Sep 17 00:00:00 2001 From: Graf Tobias <4622393+tobiasgraf@users.noreply.github.com> Date: Wed, 31 May 2023 10:01:18 +0200 Subject: [PATCH 15/16] Add missing PICS to ci-pics-values --- src/app/tests/suites/certification/ci-pics-values | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index e35c4cad234691..92630793bdb7b8 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -2103,6 +2103,7 @@ HEPAFREMON.S.A0000=1 HEPAFREMON.S.A0001=1 HEPAFREMON.S.A0002=1 HEPAFREMON.S.A0003=1 +HEPAFREMON.S.C00.Rsp=0 # Activated Carbon Filter Monitoring Cluster ACFREMON.S=1 @@ -2113,6 +2114,7 @@ ACFREMON.S.A0000=1 ACFREMON.S.A0001=1 ACFREMON.S.A0002=1 ACFREMON.S.A0003=1 +ACFREMON.S.C00.Rsp=0 # Ceramic Filter Monitoring Cluster CFREMON.S=1 @@ -2123,6 +2125,7 @@ CFREMON.S.A0000=1 CFREMON.S.A0001=1 CFREMON.S.A0002=1 CFREMON.S.A0003=1 +CFREMON.S.C00.Rsp=0 # Electrostatic Filter Monitoring Cluster ESFREMON.S=1 @@ -2133,6 +2136,7 @@ ESFREMON.S.A0000=1 ESFREMON.S.A0001=1 ESFREMON.S.A0002=1 ESFREMON.S.A0003=1 +ESFREMON.S.C00.Rsp=0 # Fuel Tank Monitoring Cluster FTREMON.S=1 @@ -2143,6 +2147,7 @@ FTREMON.S.A0000=1 FTREMON.S.A0001=1 FTREMON.S.A0002=1 FTREMON.S.A0003=1 +FTREMON.S.C00.Rsp=0 # Ink Cartridge Monitoring Cluster INKCREMON.S=1 @@ -2153,6 +2158,7 @@ INKCREMON.S.A0000=1 INKCREMON.S.A0001=1 INKCREMON.S.A0002=1 INKCREMON.S.A0003=1 +INKCREMON.S.C00.Rsp=0 # Ionizing Filter Monitoring Cluster IONFREMON.S=1 @@ -2163,6 +2169,7 @@ IONFREMON.S.A0000=1 IONFREMON.S.A0001=1 IONFREMON.S.A0002=1 IONFREMON.S.A0003=1 +IONFREMON.S.C00.Rsp=0 # Ozone Filter Monitoring Cluster OZFREMON.S=1 @@ -2173,6 +2180,7 @@ OZFREMON.S.A0000=1 OZFREMON.S.A0001=1 OZFREMON.S.A0002=1 OZFREMON.S.A0003=1 +OZFREMON.S.C00.Rsp=0 # Toner Cartridge Monitoring Cluster TCREMON.S=1 @@ -2183,6 +2191,7 @@ TCREMON.S.A0000=1 TCREMON.S.A0001=1 TCREMON.S.A0002=1 TCREMON.S.A0003=1 +TCREMON.S.C00.Rsp=0 # UV Filter Monitoring Cluster UVFREMON.S=1 @@ -2193,6 +2202,7 @@ UVFREMON.S.A0000=1 UVFREMON.S.A0001=1 UVFREMON.S.A0002=1 UVFREMON.S.A0003=1 +UVFREMON.S.C00.Rsp=0 # Water Tank Monitoring Cluster WTREMON.S=1 @@ -2203,6 +2213,7 @@ WTREMON.S.A0000=1 WTREMON.S.A0001=1 WTREMON.S.A0002=1 WTREMON.S.A0003=1 +WTREMON.S.C00.Rsp=0 # Zeolite Filter Monitoring Cluster ZEOFREMON.S=1 @@ -2213,3 +2224,4 @@ ZEOFREMON.S.A0000=1 ZEOFREMON.S.A0001=1 ZEOFREMON.S.A0002=1 ZEOFREMON.S.A0003=1 +ZEOFREMON.S.C00.Rsp=0 From 6a2c2d1bb73c7eeca1a6d40e56a7d2ea1869ffb4 Mon Sep 17 00:00:00 2001 From: Tobiasgraf <4622393+tobiasgraf@users.noreply.github.com> Date: Mon, 5 Jun 2023 23:40:30 +0200 Subject: [PATCH 16/16] Update ciTests.json Fix Naming confusion Replaceable vs Resource Monitoring --- src/app/tests/suites/ciTests.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/tests/suites/ciTests.json b/src/app/tests/suites/ciTests.json index 3735a1cc7e9d42..f2613bd4df1fb2 100644 --- a/src/app/tests/suites/ciTests.json +++ b/src/app/tests/suites/ciTests.json @@ -351,6 +351,6 @@ "Subscriptions", "DoorLock", "Groups", - "ResourceMonitoring" + "ReplaceableMonitoring" ] }