| # 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: GroupKeyManagement Cluster Tests |
| |
| config: |
| nodeId: 0x12344321 |
| cluster: "Group Key Management" |
| endpoint: 0 |
| |
| tests: |
| - label: "Wait for the commissioned device to be retrieved" |
| cluster: "DelayCommands" |
| command: "WaitForCommissionee" |
| arguments: |
| values: |
| - name: "nodeId" |
| value: nodeId |
| |
| - label: "Read maxGroupsPerFabric" |
| command: "readAttribute" |
| attribute: "maxGroupsPerFabric" |
| response: |
| constraints: |
| minValue: 2 |
| |
| - label: "Read maxGroupKeysPerFabric" |
| command: "readAttribute" |
| attribute: "maxGroupKeysPerFabric" |
| response: |
| constraints: |
| minValue: 3 |
| |
| - label: "KeySet Write 1" |
| command: "KeySetWrite" |
| arguments: |
| values: |
| - name: "GroupKeySet" |
| value: |
| { |
| GroupKeySetID: 0x01a1, |
| GroupKeySecurityPolicy: 0, |
| EpochKey0: "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf", |
| EpochStartTime0: 1110000, |
| EpochKey1: "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf", |
| EpochStartTime1: 1110001, |
| EpochKey2: "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", |
| EpochStartTime2: 1110002, |
| } |
| |
| - label: "KeySet Write 2" |
| command: "KeySetWrite" |
| arguments: |
| values: |
| - name: "GroupKeySet" |
| value: |
| { |
| GroupKeySetID: 0x01a2, |
| GroupKeySecurityPolicy: 1, |
| EpochKey0: "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf", |
| EpochStartTime0: 2110000, |
| EpochKey1: "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef", |
| EpochStartTime1: 2110001, |
| EpochKey2: "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff", |
| EpochStartTime2: 2110002, |
| } |
| |
| - label: "KeySet Read" |
| command: "KeySetRead" |
| arguments: |
| values: |
| - name: "GroupKeySetID" |
| value: 0x01a1 |
| response: |
| values: |
| - name: "GroupKeySet" |
| value: |
| { |
| GroupKeySetID: 0x01a1, |
| GroupKeySecurityPolicy: 0, |
| EpochKey0: null, |
| EpochStartTime0: 1110000, |
| EpochKey1: null, |
| EpochStartTime1: 1110001, |
| EpochKey2: null, |
| EpochStartTime2: 1110002, |
| } |
| |
| - label: "KeySet Read All Indicers" |
| disabled: true |
| command: "KeySetReadAllIndices" |
| response: |
| values: |
| - name: "GroupKeySetIDs" |
| value: [0x01a1, 0x01a2] |
| |
| - label: "Write Group Keys (invalid)" |
| command: "writeAttribute" |
| attribute: "GroupKeyMap" |
| arguments: |
| value: [{ FabricIndex: 1, GroupId: 0x0102, GroupKeySetID: 0 }] |
| response: |
| error: CONSTRAINT_ERROR |
| |
| - label: "Write Group Keys (too many)" |
| command: "writeAttribute" |
| attribute: "GroupKeyMap" |
| arguments: |
| value: |
| [ |
| { FabricIndex: 1, GroupId: 0x0101, GroupKeySetID: 0x01a1 }, |
| { FabricIndex: 1, GroupId: 0x0101, GroupKeySetID: 0x01a2 }, |
| { FabricIndex: 1, GroupId: 0x0102, GroupKeySetID: 0x01a1 }, |
| { FabricIndex: 1, GroupId: 0x0102, GroupKeySetID: 0x01a2 }, |
| ] |
| response: |
| error: FAILURE |
| |
| - label: "Write Group Keys" |
| command: "writeAttribute" |
| attribute: "GroupKeyMap" |
| arguments: |
| value: |
| [ |
| { FabricIndex: 1, GroupId: 0x0101, GroupKeySetID: 0x01a1 }, |
| { FabricIndex: 1, GroupId: 0x0102, GroupKeySetID: 0x01a1 }, |
| { FabricIndex: 1, GroupId: 0x0102, GroupKeySetID: 0x01a2 }, |
| ] |
| |
| - label: "Read Group Keys" |
| command: "readAttribute" |
| attribute: "GroupKeyMap" |
| response: |
| value: |
| [ |
| { FabricIndex: 1, GroupId: 0x0101, GroupKeySetID: 0x01a1 }, |
| { FabricIndex: 1, GroupId: 0x0102, GroupKeySetID: 0x01a1 }, |
| { FabricIndex: 1, GroupId: 0x0102, GroupKeySetID: 0x01a2 }, |
| ] |
| |
| - label: "Add Group 1" |
| cluster: "Groups" |
| endpoint: 1 |
| command: "AddGroup" |
| arguments: |
| values: |
| - name: "GroupId" |
| value: 0x0101 |
| - name: "GroupName" |
| value: "Group #1" |
| response: |
| values: |
| - name: "status" |
| value: 0 |
| - name: "GroupId" |
| value: 0x0101 |
| |
| - label: "Add Group 2" |
| cluster: "Groups" |
| endpoint: 1 |
| command: "AddGroup" |
| arguments: |
| values: |
| - name: "GroupId" |
| value: 0x0102 |
| - name: "GroupName" |
| value: "Group #2" |
| response: |
| values: |
| - name: "status" |
| value: 0 |
| - name: "GroupId" |
| value: 0x0102 |
| |
| - label: "Read GroupTable" |
| command: "readAttribute" |
| attribute: "GroupTable" |
| response: |
| value: |
| [ |
| { |
| FabricIndex: 1, |
| GroupId: 0x0101, |
| endpoints: [1], |
| GroupName: "Group #1", |
| }, |
| { |
| FabricIndex: 1, |
| GroupId: 0x0102, |
| endpoints: [1], |
| GroupName: "Group #2", |
| }, |
| ] |
| |
| - label: "KeySet Remove 1" |
| command: "KeySetRemove" |
| arguments: |
| values: |
| - name: "GroupKeySetID" |
| value: 0x01a1 |
| |
| - label: "KeySet Read (removed)" |
| command: "KeySetRead" |
| arguments: |
| values: |
| - name: "GroupKeySetID" |
| value: 0x01a1 |
| response: |
| error: NOT_FOUND |
| |
| - label: "KeySet Read (not removed)" |
| command: "KeySetRead" |
| arguments: |
| values: |
| - name: "GroupKeySetID" |
| value: 0x01a2 |
| response: |
| values: |
| - name: "GroupKeySet" |
| value: |
| { |
| GroupKeySetID: 0x01a2, |
| GroupKeySecurityPolicy: 1, |
| EpochKey0: null, |
| EpochStartTime0: 2110000, |
| EpochKey1: null, |
| EpochStartTime1: 2110001, |
| EpochKey2: null, |
| EpochStartTime2: 2110002, |
| } |
| |
| - label: "Remove Group 1" |
| cluster: "Groups" |
| endpoint: 1 |
| command: "RemoveGroup" |
| arguments: |
| values: |
| - name: "groupId" |
| value: 0x0101 |
| response: |
| values: |
| - name: "status" |
| value: 0 |
| - name: "groupId" |
| value: 0x0101 |
| |
| - label: "Read GroupTable 2" |
| command: "readAttribute" |
| attribute: "GroupTable" |
| response: |
| value: |
| [ |
| { |
| FabricIndex: 1, |
| GroupId: 0x0102, |
| endpoints: [1], |
| GroupName: "Group #2", |
| }, |
| ] |
| |
| - label: "Remove All" |
| cluster: "Groups" |
| endpoint: 1 |
| command: "RemoveAllGroups" |
| |
| - label: "Read GroupTable 3" |
| command: "readAttribute" |
| attribute: "GroupTable" |
| response: |
| value: [] |
| |
| - label: "KeySet Remove 2" |
| command: "KeySetRemove" |
| arguments: |
| values: |
| - name: "GroupKeySetID" |
| value: 0x01a2 |
| |
| - label: "KeySet Read (also removed)" |
| command: "KeySetRead" |
| arguments: |
| values: |
| - name: "GroupKeySetID" |
| value: 0x01a2 |
| response: |
| error: NOT_FOUND |