Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Test Script for Air Quality Cluster #26879

Merged
35 changes: 35 additions & 0 deletions src/app/tests/suites/certification/PICS.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7706,3 +7706,38 @@ PICS:
#
- label: "Does the DUT(server) support the SetTimeZoneResponse command?"
id: TIMESYNC.S.C03.Tx

#####################################################################################
# Air Quality Cluster Test Plan
- label: "Does the device implement the Air Quality cluster as a server?"
id: AIRQUAL.S

- label: "Does the device implement the Air Quality cluster as a client?"
id: AIRQUAL.C

#
# server / attributes
#
- label: "Does the device implement the AirQuality attribute?"
id: AIRQUAL.S.A0000

#
# server / features
#
- label: "Does the device support the Fair feature?"
id: AIRQUAL.S.F00

- label: "Does the device support the Moderate feature?"
id: AIRQUAL.S.F01

- label: "Does the device support the VeryPoor feature?"
id: AIRQUAL.S.F02

- label: "Does the device support the ExtremelyPoor feature?"
id: AIRQUAL.S.F03

#
# server / manual
#
- label: "Changes air quality significantly"
id: AIRQUAL.M.AirQualityChange
125 changes: 125 additions & 0 deletions src/app/tests/suites/certification/Test_TC_AIRQUAL_1_1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# 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.
# 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-AIRQUAL-1.1] Global Attributes with DUT as Server

PICS:
- AIRQUAL.S

config:
nodeId: 0x12344321
cluster: "Air Quality"
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:
"!AIRQUAL.S.F00 && !AIRQUAL.S.F01 && !AIRQUAL.S.F02 && !AIRQUAL.S.F03"
response:
value: 0
constraints:
type: bitmap32

- label:
"Given AIRQUAL.S.F00(Fair) ensure featuremap has the correct bit set"
command: "readAttribute"
attribute: "FeatureMap"
PICS: AIRQUAL.S.F00
response:
constraints:
type: bitmap32
hasMasksSet: [0x1]

- label:
"Given AIRQUAL.S.F01(Moderate) ensure featuremap has the correct bit
set"
command: "readAttribute"
attribute: "FeatureMap"
PICS: AIRQUAL.S.F01
response:
constraints:
type: bitmap32
hasMasksSet: [0x2]

- label:
"Given AIRQUAL.S.F02(VeryPoor) ensure featuremap has the correct bit
set"
command: "readAttribute"
attribute: "FeatureMap"
PICS: AIRQUAL.S.F02
response:
constraints:
type: bitmap32
hasMasksSet: [0x4]

- label:
"Given AIRQUAL.S.F03(ExtremelyPoor) ensure featuremap has the correct
bit set"
command: "readAttribute"
attribute: "FeatureMap"
PICS: AIRQUAL.S.F03
response:
constraints:
type: bitmap32
hasMasksSet: [0x8]

- label: "Read the global attribute: AttributeList"
command: "readAttribute"
attribute: "AttributeList"
response:
constraints:
type: list
contains: [0, 65528, 65529, 65530, 65531, 65532, 65533]

- 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
42 changes: 42 additions & 0 deletions src/app/tests/suites/certification/Test_TC_AIRQUAL_2_1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# 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.
# 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-AIRQUAL-2.1] Attributes with server as DUT

PICS:
- AIRQUAL.S

config:
nodeId: 0x12344321
cluster: "Air Quality"
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 AirQuality attribute."
PICS: AIRQUAL.S.A0000
command: "readAttribute"
attribute: "AirQuality"
response:
constraints:
type: enum8
minValue: 0
maxValue: 6
11 changes: 11 additions & 0 deletions src/app/tests/suites/certification/ci-pics-values
Original file line number Diff line number Diff line change
Expand Up @@ -2095,3 +2095,14 @@ TIMESYNC.S.C04.Rsp=1
TIMESYNC.S.C05.Rsp=1
TIMESYNC.S.C03.Tx=1
TIMESYNC.C=0

# Air Quality
AIRQUAL.C=0
AIRQUAL.S=1
AIRQUAL.S.F00=1
AIRQUAL.S.F01=1
AIRQUAL.S.F02=1
AIRQUAL.S.F03=1
AIRQUAL.S.A0000=1
PICS_USER_PROMPT=0
AIRQUAL.M.AirQualityChange=0
2 changes: 2 additions & 0 deletions src/app/tests/suites/ciTests.json
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,11 @@
"Test_TC_G_2_1"
],
"Scenes": ["Test_TC_S_1_1"],
"AirQuality": ["Test_TC_AIRQUAL_1_1", "Test_TC_AIRQUAL_2_1"],
"collection": [
"AccessControl",
"AccessControlEnforcement",
"AirQuality",
"BooleanState",
"BridgedDeviceBasicInformation",
"Actions",
Expand Down
Loading