Skip to content

Commit

Permalink
Test added Mar 30 (project-chip#16825)
Browse files Browse the repository at this point in the history
* New tests added
TC-DL-1.3
TC-PSCFG-1.1

* PSCFG-1.1

* Added auto generated files

* Added LC-1.2

* Auto generated files after rebase

Co-authored-by: manjunath-grl <[email protected]>
  • Loading branch information
2 people authored and chencheung committed Apr 6, 2022
1 parent fb89b1b commit a155e8f
Show file tree
Hide file tree
Showing 9 changed files with 1,828 additions and 145 deletions.
15 changes: 15 additions & 0 deletions examples/chip-tool-darwin/templates/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ function getTests()
'Test_TC_DM_3_1',
];

const DoorLock = [
'Test_TC_DL_1_3',
];

const ElectricalMeasurement = [
'Test_TC_EMR_1_1',
];
Expand Down Expand Up @@ -194,6 +198,10 @@ function getTests()
'Test_TC_PCC_2_4',
];

const PowerSourceConfiguration = [
'Test_TC_PSCFG_1_1',
];

const RelativeHumidityMeasurement = [
'Test_TC_RH_1_1',
'Test_TC_RH_2_1',
Expand Down Expand Up @@ -228,6 +236,10 @@ function getTests()
'Test_TC_DIAG_TH_NW_1_2',
];

const UserLabel = [
'Test_TC_LC_1_2',
];

const WiFiNetworkDiagnostics = [
'Test_TC_WIFIDIAG_1_1',
'Test_TC_WIFIDIAG_3_1',
Expand Down Expand Up @@ -285,6 +297,7 @@ function getTests()
ColorControl, //
DeviceDiscovery, //
DeviceManagement, //
DoorLock, //
ElectricalMeasurement, //
EthernetNetworkDiagnostics, //
FlowMeasurement, //
Expand All @@ -299,12 +312,14 @@ function getTests()
PowerSource, //
PressureMeasurement, //
PumpConfigurationControl, //
PowerSourceConfiguration, //
RelativeHumidityMeasurement, //
Switch, //
TemperatureMeasurement, //
Thermostat, //
ThermostatUserConfiguration, //
ThreadNetworkDiagnostics, //
UserLabel, //
WiFiNetworkDiagnostics, //
WindowCovering, //
Others, //
Expand Down
12 changes: 11 additions & 1 deletion examples/chip-tool/templates/tests/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ function getManualTests()
];

const PowerSourceConfiguration = [
'Test_TC_PSCFG_1_1',
'Test_TC_PSCFG_2_1',
'Test_TC_PSCFG_3_1',
];
Expand Down Expand Up @@ -380,6 +379,10 @@ function getTests()
'Test_TC_LVL_6_1',
];

const UserLabel = [
'Test_TC_LC_1_2',
];

const MediaControl = [
'Test_TC_MC_1_1',
'Test_TC_MC_1_2',
Expand Down Expand Up @@ -452,6 +455,10 @@ function getTests()
'Test_TC_PCC_2_4',
];

const PowerSourceConfiguration = [
'Test_TC_PSCFG_1_1',
];

const RelativeHumidityMeasurement = [
'Test_TC_RH_1_1',
'Test_TC_RH_2_1',
Expand Down Expand Up @@ -563,6 +570,7 @@ function getTests()
'DL_UsersAndCredentials',
'DL_LockUnlock',
'DL_Schedules',
'Test_TC_DL_1_3',
];

const Groups = [
Expand Down Expand Up @@ -593,13 +601,15 @@ function getTests()
PowerSource, //
PressureMeasurement, //
PumpConfigurationControl, //
PowerSourceConfiguration, //
RelativeHumidityMeasurement, //
SecureChannel, //
Switch, //
TemperatureMeasurement, //
Thermostat, //
ThermostatUserConfiguration, //
ThreadNetworkDiagnostics, //
UserLabel, //
WiFiNetworkDiagnostics, //
WindowCovering, //
TV, //
Expand Down
105 changes: 105 additions & 0 deletions src/app/tests/suites/certification/Test_TC_DL_1_3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# 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: 106.3. [TC-DL-1.3] Verification for Unlock Door command [DUT-Server]

config:
nodeId: 0x12344321
cluster: "Door Lock"
endpoint: 1

tests:
- label: "Wait for the commissioned device to be retrieved"
cluster: "DelayCommands"
command: "WaitForCommissionee"
arguments:
values:
- name: "nodeId"
value: nodeId

- label: "Create new PIN credential and lock/unlock user"
command: "SetCredential"
timedInteractionTimeoutMs: 10000
arguments:
values:
- name: "operationType"
value: 0
- name: "credential"
value: { CredentialType: 1, CredentialIndex: 1 }
- name: "credentialData"
value: "123456"
- name: "userIndex"
value: null
- name: "userStatus"
value: null
- name: "userType"
value: null
response:
values:
- name: "status"
value: 0
- name: "userIndex"
value: 1
- name: "nextCredentialIndex"
value: 2

- label: "Precondition: Door is in locked state"
command: "LockDoor"
timedInteractionTimeoutMs: 10000
arguments:
values:
- name: "PINCode"
value: "123456"

- label: "TH writes AutoRelockTime attribute value as 10 seconds on the DUT"
command: "writeAttribute"
attribute: "AutoRelockTime"
arguments:
value: 10

- label: "TH sends the unlock Door command to the DUT with valid PINCode"
command: "UnlockDoor"
timedInteractionTimeoutMs: 10000
arguments:
values:
- name: "PINCode"
value: "123456"

- label: "TH reads AutoRelockTime attribute from DUT"
command: "readAttribute"
attribute: "AutoRelockTime"
response:
value: 10

- label: "Wait 10000ms"
cluster: "DelayCommands"
command: "WaitForMs"
arguments:
values:
- name: "ms"
value: 10000

- label: "TH reads LockState attriute"
command: "readAttribute"
attribute: "LockState"
response:
value: 1

- label: "Clean the created credential"
command: "ClearCredential"
timedInteractionTimeoutMs: 10000
arguments:
values:
- name: "credential"
value: { CredentialType: 1, CredentialIndex: 1 }
39 changes: 39 additions & 0 deletions src/app/tests/suites/certification/Test_TC_LC_1_2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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:
94.4. [TC-LC-1.4]User Label cluster constraint_error verification [DUT -
Commissionee]

config:
nodeId: 0x12344321
cluster: "User Label"
endpoint: 1

tests:
- label: "Wait for the commissioned device to be retrieved"
cluster: "DelayCommands"
command: "WaitForCommissionee"
arguments:
values:
- name: "nodeId"
value: nodeId

- label: "TH1 reads LabelList attribute from the DUT"
command: "readAttribute"
attribute: "label list"
response:
constraints:
- type: list
- minLength: 3
99 changes: 32 additions & 67 deletions src/app/tests/suites/certification/Test_TC_PSCFG_1_1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,85 +16,50 @@ name: 63.1.1. [TC-PSCFG-1.1] Global attributes with server as DUT

config:
nodeId: 0x12344321
cluster: "Basic"
cluster: "Power Source Configuration"
endpoint: 0

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

- label: "TH reads the ClusterRevision attribute from the DUT"
verification: |
./chip-tool powersourceconfiguration read cluster-revision 1234 0
The response should look like this:
[1641813555.191189][38097:38102] CHIP:DMG: ReportDataMessage =
[1641813555.191325][38097:38102] CHIP:DMG: {
[1641813555.191381][38097:38102] CHIP:DMG: AttributeReportIBs =
[1641813555.191456][38097:38102] CHIP:DMG: [
[1641813555.191627][38097:38102] CHIP:DMG: AttributeReportIB =
[1641813555.191842][38097:38102] CHIP:DMG: {
[1641813555.191910][38097:38102] CHIP:DMG: AttributeDataIB =
[1641813555.191979][38097:38102] CHIP:DMG: {
[1641813555.192062][38097:38102] CHIP:DMG: DataVersion = 0x0,
[1641813555.192134][38097:38102] CHIP:DMG: AttributePathIB =
[1641813555.192212][38097:38102] CHIP:DMG: {
[1641813555.192302][38097:38102] CHIP:DMG: Endpoint = 0x0,
[1641813555.192386][38097:38102] CHIP:DMG: Cluster = 0x2e,
[1641813555.192471][38097:38102] CHIP:DMG: Attribute = 0x0000_FFFD,
[1641813555.192545][38097:38102] CHIP:DMG: }
[1641813555.192625][38097:38102] CHIP:DMG:
[1641813555.192697][38097:38102] CHIP:DMG: Data = 1,
[1641813555.192775][38097:38102] CHIP:DMG: },
[1641813555.192849][38097:38102] CHIP:DMG:
[1641813555.192913][38097:38102] CHIP:DMG: },
[1641813555.192984][38097:38102] CHIP:DMG:
[1641813555.193044][38097:38102] CHIP:DMG: ],
[1641813555.193115][38097:38102] CHIP:DMG:
[1641813555.193173][38097:38102] CHIP:DMG: SuppressResponse = true,
[1641813555.193227][38097:38102] CHIP:DMG: }
[1641813555.193482][38097:38102] CHIP:TOO: PowerSourceConfiguration.ClusterRevision response: 1
disabled: true
command: "readAttribute"
attribute: "ClusterRevision"
response:
value: 1

- label: "TH reads the AttributeList attribute from the DUT"
verification: |
./chip-tool powersourceconfiguration read attribute-list 1234 0
The response should look like this:
[CHIP:DMG: SuppressResponse = true,
[CHIP:DMG: }
[CHIP:TOO: GeneralCommissioning.AttributeList response: 5 entries
[CHIP:TOO: [1]: 0
[CHIP:TOO: [2]: 65529
[CHIP:TOO: [3]: 65530
[CHIP:TOO: [4]: 65531
[CHIP:TOO: [5]: 65533
disabled: true
command: "readAttribute"
attribute: "AttributeList"
response:
constraints:
type: list

- label: "TH reads the AcceptedCommandList attribute from the DUT"
verification: |
./chip-tool powersourceconfiguration read client-generated-command-list 1234 0
[...]
[1646048092.858800][36301:36306] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_002E Attribute 0x0000_FFF9DataVersion: 502821112
[1646048092.858890][36301:36306] CHIP:TOO: AcceptedCommandList: 0 entries
disabled: true
command: "readAttribute"
attribute: "AcceptedCommandList"
response:
constraints:
type: list

- label: "TH reads the GeneratedCommandList attribute from the DUT"
verification: |
./chip-tool powersourceconfiguration read server-generated-command-list 1234 0
[...]
[1646048186.753316][36310:36315] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_002E Attribute 0x0000_FFF8DataVersion: 502821112
[1646048186.753391][36310:36315] CHIP:TOO: GeneratedCommandList: 0 entries
disabled: true
command: "readAttribute"
attribute: "GeneratedCommandList"
response:
constraints:
type: list

#issue #11053 disabled steps below Global attributes missing from YAML framework
- label: "TH reads the EventList attribute from the DUT"
verification: |
Not supported in SDK yet
disabled: true
command: "readAttribute"
attribute: "EventList"
response:
constraints:
type: list
Loading

0 comments on commit a155e8f

Please sign in to comment.