blob: eb611f27db24b9d190d88ad2a5053ce7cf6b0098 [file] [log] [blame]
# 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: ICD Management Cluster Tests
config:
nodeId: 0x12344321
cluster: "ICD Management"
endpoint: 0
tests:
- label: "Read the commissioner node ID"
cluster: "CommissionerCommands"
command: "GetCommissionerNodeId"
response:
values:
- name: "nodeId"
saveAs: commissionerNodeId
- label: "Wait for the commissioned device to be retrieved"
cluster: "DelayCommands"
command: "WaitForCommissionee"
arguments:
values:
- name: "nodeId"
value: nodeId
- label: "Read Feature Map"
command: "readAttribute"
attribute: "FeatureMap"
response:
value: 0x07
- label: "Read IdleModeDuration"
command: "readAttribute"
attribute: "IdleModeDuration"
response:
value: 3600
- label: "Read ActiveModeDuration"
command: "readAttribute"
attribute: "ActiveModeDuration"
response:
value: 10000
- label: "Read ActiveModeThreshold"
command: "readAttribute"
attribute: "ActiveModeThreshold"
response:
value: 1000
- label: "Read ICDCounter"
command: "readAttribute"
attribute: "ICDCounter"
response:
constraints:
type: int32u
minValue: 0x0
maxValue: 0xFFFFFFFF
- label: "Read UserActiveModeTriggerHint"
command: "readAttribute"
attribute: "UserActiveModeTriggerHint"
response:
constraints:
type: bitmap32
value: 0x110D
- label: "Read UserActiveModeTriggerInstruction"
command: "readAttribute"
attribute: "UserActiveModeTriggerInstruction"
response:
constraints:
type: char_string
minLength: 1
maxLength: 128
- label: "Read ClientsSupportedPerFabric"
command: "readAttribute"
attribute: "ClientsSupportedPerFabric"
response:
value: 2
- label: "Unregister 1.0"
command: "UnregisterClient"
arguments:
values:
- name: "CheckInNodeID"
value: 101
response:
error: NOT_FOUND
- label: "Unregister 2.0"
command: "UnregisterClient"
arguments:
values:
- name: "CheckInNodeID"
value: 102
response:
error: NOT_FOUND
- label: "Unregister 3.0"
command: "UnregisterClient"
arguments:
values:
- name: "CheckInNodeID"
value: 102
response:
error: NOT_FOUND
# chip-tool will register itself with the ICD during the tests.
- label: "Read RegisteredClients For Registration During Commissioning"
command: "readAttribute"
attribute: "RegisteredClients"
response:
value:
[
{
CheckInNodeID: commissionerNodeId,
MonitoredSubject: commissionerNodeId,
},
]
- label: "Unregister Client Registered During Commissioning"
command: "UnregisterClient"
arguments:
values:
- name: "CheckInNodeID"
value: commissionerNodeId
- label: "Register 1.0 (key too short)"
command: "RegisterClient"
arguments:
values:
- name: "CheckInNodeID"
value: 101
- name: "MonitoredSubject"
value: 1001
- name: "Key"
value: "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e"
response:
error: CONSTRAINT_ERROR
- label: "Register 1.0 (key too long)"
command: "RegisterClient"
arguments:
values:
- name: "CheckInNodeID"
value: 101
- name: "MonitoredSubject"
value: 1001
- name: "Key"
value: "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\xff"
response:
error: CONSTRAINT_ERROR
- label: "Register 1.1"
command: "RegisterClient"
arguments:
values:
- name: "CheckInNodeID"
value: 101
- name: "MonitoredSubject"
value: 1001
- name: "Key"
value: "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
response:
values:
- name: "ICDCounter"
constraints:
type: int32u
minValue: 0x0
maxValue: 0xFFFFFFFF
- label: "Register 2.1"
command: "RegisterClient"
arguments:
values:
- name: "CheckInNodeID"
value: 201
- name: "MonitoredSubject"
value: 2001
- name: "Key"
value:
"\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
response:
values:
- name: "ICDCounter"
constraints:
type: int32u
minValue: 0x0
maxValue: 0xFFFFFFFF
- label: "Register 3.1"
command: "RegisterClient"
arguments:
values:
- name: "CheckInNodeID"
value: 301
- name: "MonitoredSubject"
value: 3001
- name: "Key"
value: "\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
response:
error: RESOURCE_EXHAUSTED
- label: "Read RegisteredClients"
command: "readAttribute"
attribute: "RegisteredClients"
response:
value:
[
{ CheckInNodeID: 101, MonitoredSubject: 1001 },
{ CheckInNodeID: 201, MonitoredSubject: 2001 },
]
- label: "Register 1.1 (update)"
command: "RegisterClient"
arguments:
values:
- name: "CheckInNodeID"
value: 101
- name: "MonitoredSubject"
value: 1002
- name: "Key"
value: "\x01\x11\x21\x31\x41\x51\x61\x71\x81\x91\xa1\xb1\xc1\xd1\xe1\xf1"
response:
values:
- name: "ICDCounter"
constraints:
type: int32u
minValue: 0x0
maxValue: 0xFFFFFFFF
- label: "Read RegisteredClients"
command: "readAttribute"
attribute: "RegisteredClients"
response:
value:
[
{ CheckInNodeID: 101, MonitoredSubject: 1002 },
{ CheckInNodeID: 201, MonitoredSubject: 2001 },
]
- label: "Register 2.2 (wrong verification key)"
command: "RegisterClient"
arguments:
values:
- name: "CheckInNodeID"
value: 201
- name: "MonitoredSubject"
value: 2002
- name: "Key"
value: "\x02\x12\x22\x32\x42\x52\x62\x72\x82\x92\xa2\xb2\xc2\xd2\xe2\x2f"
- name: "VerificationKey"
value:
"\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2f\x2f"
response:
values:
- name: "ICDCounter"
constraints:
type: int32u
minValue: 0x0
maxValue: 0xFFFFFFFF
- label: "Read RegisteredClients"
command: "readAttribute"
attribute: "RegisteredClients"
response:
value:
[
{ CheckInNodeID: 101, MonitoredSubject: 1002 },
{ CheckInNodeID: 201, MonitoredSubject: 2002 },
]
- label: "Unregister 1.1 (wrong key)"
command: "UnregisterClient"
arguments:
values:
- name: "CheckInNodeID"
value: 101
- name: "VerificationKey"
value: "\x01\x21\x21\x31\x41\x51\x61\x71\x81\x91\xa1\xb1\xc1\xd1\xe1\xf1"
- label: "Read RegisteredClients"
command: "readAttribute"
attribute: "RegisteredClients"
response:
value: [{ CheckInNodeID: 201, MonitoredSubject: 2002 }]
- label: "Unregister 2.1"
command: "UnregisterClient"
arguments:
values:
- name: "CheckInNodeID"
value: 201
- label: "Read RegisteredClients"
command: "readAttribute"
attribute: "RegisteredClients"
response:
value: []
- label: "Unregister 1.3"
command: "UnregisterClient"
arguments:
values:
- name: "CheckInNodeID"
value: 101
response:
error: NOT_FOUND
- label: "Unregister 2.2"
command: "UnregisterClient"
arguments:
values:
- name: "CheckInNodeID"
value: 102
response:
error: NOT_FOUND