Skip to content

Commit

Permalink
Smoke/CO: Add YAML tests
Browse files Browse the repository at this point in the history
* Regen zap
  • Loading branch information
hare-siterwell committed Jun 7, 2023
1 parent 2520f47 commit 3343760
Show file tree
Hide file tree
Showing 15 changed files with 14,206 additions and 956 deletions.
131 changes: 131 additions & 0 deletions src/app/tests/suites/certification/PICS.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5701,6 +5701,137 @@ PICS:
- label: "Read all supported mandatory attribute"
id: S.C.AM-READ

# Smoke CO Alarm Cluster Test Plan
- label: "Does the device implement the SMCO cluster as a server?"
id: SMCO.S

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

#
# server / features
#
- label: "Does the device support this specific cluster feature?"
id: SMCO.S.F00

- label: "Does the device support this specific cluster feature?"
id: SMCO.S.F01

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

- label: "Does the device implement the SmokeState attribute?"
id: SMCO.S.A0001

- label: "Does the device implement the COState attribute?"
id: SMCO.S.A0002

- label: "Does the device implement the BatteryAlert attribute?"
id: SMCO.S.A0003

- label: "Does the device implement the DeviceMuted attribute?"
id: SMCO.S.A0004

- label: "Does the device implement the TestInProgress attribute?"
id: SMCO.S.A0005

- label: "Does the device implement the HardwareFaultAlert attribute?"
id: SMCO.S.A0006

- label: "Does the device implement the EndOfServiceAlert attribute?"
id: SMCO.S.A0007

- label: "Does the device implement the InterconnectSmokeAlar attribute?"
id: SMCO.S.A0008

- label: "Does the device implement the InterconnectCOAlarm attribute?"
id: SMCO.S.A0009

- label: "Does the device implement the ContaminationState attribute?"
id: SMCO.S.A00010

- label: "Does the device implement the SensitivityLevel attribute?"
id: SMCO.S.A00011

- label: "Does the device implement the ExpiryDate attribute?"
id: SMCO.S.A00012

- label: "Does the device implement the ClusterRevision attribute?"
id: SMCO.S.Afffd

- label: "Does the device implement the FeatureMap attribute?"
id: SMCO.S.Afffc

- label: "Does the device implement the AttributeList attribute?"
id: SMCO.S.Afffb

- label: "Does the device implement the EventList attribute?"
id: SMCO.S.Afffa

- label: "Does the device implement the AcceptedCommandList attribute?"
id: SMCO.S.Afff9

- label: "Does the device implement the GeneratedCommandList attribute?"
id: SMCO.S.Afff8

#
# server / Events
#
- label: "Does the device implement the SmokeAlarm event?"
id: SMCO.S.E0000

- label: "Does the device implement the COAlarm event?"
id: SMCO.S.E0001

- label: "Does the device implement the LowBattery event?"
id: SMCO.S.E0002

- label: "Does the device implement the HardwareFault event?"
id: SMCO.S.E0003

- label: "Does the device implement the EndOfService event?"
id: SMCO.S.E0004

- label: "Does the device implement the SelfTestComplete event?"
id: SMCO.S.E0005

- label: "Does the device implement the AlarmMuted event?"
id: SMCO.S.E0006

- label: "Does the device implement the MuteEnded event?"
id: SMCO.S.E0007

- label: "Does the device implement the InterconnectSmokeAlarm event?"
id: SMCO.S.E0008

- label: "Does the device implement the InterconnectCOAlarm event?"
id: SMCO.S.E0009

- label: "Does the device implement the AllClear event?"
id: SMCO.S.E00010

#
# server / manually
#
- label:
"Can the TestInProgress attribute changed by physical control at the
device?"
id: SMCO.M.ManuallyControlledTest

- label:
"Can the DeviceMuted attribute changed by physical control at the
device?"
id: SMCO.M.ManuallyControlledMute

#
# server / commandsReceived
#
- label: "Does the device implement receiving the SelfTestRequest command?"
id: SMCO.S.C00.Rsp

# Software Diagnostics Cluster Test Plan
- label:
"Does the device implement the Software Diagnostics cluster as a
Expand Down
96 changes: 96 additions & 0 deletions src/app/tests/suites/certification/Test_TC_SMCO_1_1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# 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: 4.1.1. [TC-SMCO-1.1] Global Attributes with DUT as Server

PICS:
- SMCO.S

config:
nodeId: 0x12344321
cluster: "Smoke CO Alarm"
endpoint: 1

tests:
- label: "Commission DUT to TH"
cluster: "DelayCommands"
command: "WaitForCommissionee"
arguments:
values:
- name: "nodeId"
value: nodeId

- label: "TH reads the ClusterRevision attribute from the DUT"
PICS: SMCO.S.Afffd
command: "readAttribute"
attribute: "ClusterRevision"
response:
value: 1
constraints:
type: int16u

- label: "TH reads from the DUT the FeatureMap attribute"
PICS: SMCO.S.Afffc && SMCO.S.F00
command: "readAttribute"
attribute: "FeatureMap"
response:
constraints:
type: bitmap32
hasMasksSet: [0x1]

- label: "TH reads from the DUT the FeatureMap attribute"
PICS: SMCO.S.Afffc && SMCO.S.F01
command: "readAttribute"
attribute: "FeatureMap"
response:
constraints:
type: bitmap32
hasMasksSet: [0x2]

# TODO: Date type encoding not defined
- label: "TH reads from the DUT the AttributeList attribute"
PICS: SMCO.S.Afffb
command: "readAttribute"
attribute: "AttributeList"
response:
constraints:
type: list
contains: [0, 1, 2, 3, 5, 6, 7, 4, 8, 9, 10, 11]

- label: "TH reads from the DUT the EventList attribute"
PICS: SMCO.S.Afffa
command: "readAttribute"
attribute: "EventList"
response:
constraints:
type: list
contains: [0, 1, 2, 3, 4, 5, 10, 6, 7, 8, 9]

- label: "TH reads from the DUT the AcceptedCommandList attribute"
PICS: SMCO.S.Afff9
command: "readAttribute"
attribute: "AcceptedCommandList"
response:
constraints:
type: list
contains: [0]

- label: "TH reads from the DUT the GeneratedCommandList attribute"
PICS: SMCO.S.Afff8
command: "readAttribute"
attribute: "GeneratedCommandList"
response:
value: []
constraints:
type: list
146 changes: 146 additions & 0 deletions src/app/tests/suites/certification/Test_TC_SMCO_2_1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
# 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: 4.2.1. [TC-SMCO-2.1] Attributes with DUT as Server

PICS:
- SMCO.S

config:
nodeId: 0x12344321
cluster: "Smoke CO Alarm"
endpoint: 1

tests:
- label: "Commission DUT to TH"
cluster: "DelayCommands"
command: "WaitForCommissionee"
arguments:
values:
- name: "nodeId"
value: nodeId

- label: "TH reads from the DUT the ExpressedState attribute"
PICS: SMCO.S.A0000
command: "readAttribute"
attribute: "ExpressedState"
response:
constraints:
type: enum8
minValue: 0
maxValue: 8

- label: "TH reads from the DUT the SmokeState attribute"
PICS: SMCO.S.A0001
command: "readAttribute"
attribute: "SmokeState"
response:
constraints:
type: enum8
minValue: 0
maxValue: 2

- label: "TH reads from the DUT the COState attribute"
PICS: SMCO.S.A0002
command: "readAttribute"
attribute: "COState"
response:
constraints:
type: enum8
minValue: 0
maxValue: 2

- label: "TH reads from the DUT the BatteryAlert attribute"
PICS: SMCO.S.A0003
command: "readAttribute"
attribute: "BatteryAlert"
response:
constraints:
type: enum8
minValue: 0
maxValue: 2

- label: "TH reads from the DUT the TestInProgress attribute"
PICS: SMCO.S.A0005
command: "readAttribute"
attribute: "TestInProgress"
response:
constraints:
type: boolean

- label: "TH reads from the DUT the HardwareFaultAlert attribute"
PICS: SMCO.S.A0006
command: "readAttribute"
attribute: "HardwareFaultAlert"
response:
constraints:
type: boolean

- label: "TH reads from the DUT the EndOfServiceAlert attribute"
PICS: SMCO.S.A0007
command: "readAttribute"
attribute: "EndOfServiceAlert"
response:
constraints:
type: enum8
minValue: 0
maxValue: 1

- label: "TH reads from the DUT the InterconnectSmokeAlarm attribute"
PICS: SMCO.S.A0008
command: "readAttribute"
attribute: "InterconnectSmokeAlarm"
response:
constraints:
type: enum8
minValue: 0
maxValue: 2

- label: "TH reads from the DUT the InterconnectCOAlarm attribute"
PICS: SMCO.S.A0009
command: "readAttribute"
attribute: "InterconnectCOAlarm"
response:
constraints:
type: enum8
minValue: 0
maxValue: 2

- label: "TH reads from the DUT the ContaminationState attribute"
PICS: SMCO.S.A00010
command: "readAttribute"
attribute: "ContaminationState"
response:
constraints:
type: enum8
minValue: 0
maxValue: 3

- label: "TH reads from the DUT the SensitivityLevel attribute"
PICS: SMCO.S.A00011
command: "readAttribute"
attribute: "SensitivityLevel"
response:
constraints:
type: enum8
minValue: 0
maxValue: 2
# TODO: Date type encoding not defined
# - label: "TH reads from the DUT the ExpiryDate attribute"
# PICS: SMCO.S.A00012
# command: "readAttribute"
# attribute: "ExpiryDate"
# response:
# constraints:
# type: Date
Loading

0 comments on commit 3343760

Please sign in to comment.