Skip to content

Commit

Permalink
[YAML] Add TestMultiAdmin.yaml (#15106)
Browse files Browse the repository at this point in the history
* Add TestMultiAdmin

* Update generated code
  • Loading branch information
vivien-apple authored and pull[bot] committed Feb 6, 2024
1 parent e39d92f commit 3145025
Show file tree
Hide file tree
Showing 3 changed files with 509 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/chip-tool/templates/tests/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,10 @@ function getTests()
'TestBinding',
];

const MultiAdmin = [
'TestMultiAdmin',
];

const SoftwareDiagnostics = [
'Test_TC_SWDIAG_1_1',
'Test_TC_SWDIAG_2_1',
Expand Down Expand Up @@ -531,6 +535,7 @@ function getTests()
WindowCovering, //
TV, //
Others, //
MultiAdmin, //
SoftwareDiagnostics, //
Subscriptions, //
DoorLock, //
Expand Down
141 changes: 141 additions & 0 deletions src/app/tests/suites/TestMultiAdmin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# Copyright (c) 2022 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: Test Multi Admin

config:
nodeId: 0x12344321
nodeId2:
type: NODE_ID
defaultValue: 0xCAFE
nodeId3:
type: NODE_ID
defaultValue: 0xC00FEE
endpoint: 0
discriminator:
type: INT16U
defaultValue: 3840
payload:
type: CHAR_STRING
defaultValue: "MT:-24J0AFN00KA0648G00" # This value needs to be generated automatically

tests:
- label: "Reboot target device"
cluster: "SystemCommands"
command: "Reboot"
arguments:
values:
- name: "discriminator"
value: discriminator

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

- label: "Open Commissioning Window from alpha"
cluster: "AdministratorCommissioning"
command: "OpenBasicCommissioningWindow"
timedInteractionTimeoutMs: 10000
arguments:
values:
- name: "CommissioningTimeout"
value: 120

- label: "Commission from beta"
identity: "beta"
cluster: "CommissionerCommands"
command: "PairWithQRCode"
arguments:
values:
- name: "nodeId"
value: nodeId2
- name: "payload"
value: payload

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

- label: "Open Commissioning Window from beta"
identity: "beta"
cluster: "AdministratorCommissioning"
command: "OpenBasicCommissioningWindow"
timedInteractionTimeoutMs: 10000
arguments:
values:
- name: "CommissioningTimeout"
value: 120

- label: "Commission from gamma"
identity: "gamma"
cluster: "CommissionerCommands"
command: "PairWithQRCode"
arguments:
values:
- name: "nodeId"
value: nodeId3
- name: "payload"
value: payload

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

- label: "read the mandatory attribute: NodeLabel from alpha"
identity: "alpha"
cluster: "Basic"
command: "readAttribute"
attribute: "NodeLabel"
response:
value: ""
saveAs: readFromAlpha

- label: "write the mandatory attribute NodeLabel from beta"
identity: "beta"
cluster: "Basic"
command: "writeAttribute"
attribute: "NodeLabel"
arguments:
value: "written from beta"

- label: "read the mandatory attribute: NodeLabel from gamma"
identity: "gamma"
cluster: "Basic"
command: "readAttribute"
attribute: "NodeLabel"
response:
constraints:
notValue: readFromAlpha

- label: "write the mandatory attribute NodeLabel back to default"
identity: "alpha"
cluster: "Basic"
command: "writeAttribute"
attribute: "NodeLabel"
arguments:
value: readFromAlpha
Loading

0 comments on commit 3145025

Please sign in to comment.