blob: 9a39dfa75404c76dc862fd09edc9f5acc69a121c [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:
111.2.9. [TC-DRLK-2.9] Verification for the following Commands - Set
Credential , Set Credential Response, Get Credential Status, Get Credential
Status Response, Clear Credential [DUT-Server]
PICS:
- DRLK.S
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 user with default parameters"
command: "SetUser"
timedInteractionTimeoutMs: 10000
arguments:
values:
- name: "operationType"
value: 0
- name: "userIndex"
value: 1
- name: "userName"
value: "xxx"
- name: "userUniqueId"
value: 6452
- name: "userStatus"
value: 1
- name: "userType"
value: 0
- name: "credentialRule"
value: 0
- label: "Read the user back and verify its fields"
command: "GetUser"
arguments:
values:
- name: "userIndex"
value: 1
response:
values:
- name: "userIndex"
value: 1
- name: "userName"
value: "xxx"
- name: "userUniqueId"
value: 6452
- name: "userStatus"
value: 1
- name: "userType"
value: 0
- name: "credentialRule"
value: 0
- name: "credentials"
value: null
- name: "creatorFabricIndex"
value: 1
- name: "lastModifiedFabricIndex"
value: 1
- name: "nextUserIndex"
value: null
- label:
"TH reads NumberOfTotalUsersSupported attribute and saves for future
use."
PICS: DRLK.S.F08 && DRLK.S.A0011
command: "readAttribute"
attribute: "NumberOfTotalUsersSupported"
response:
saveAs: NumberOfTotalUsersSupported
constraints:
minValue: 0
maxValue: 65534
- label: "TH sends Set Credential Command to DUT"
PICS: DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx
command: "SetCredential"
timedInteractionTimeoutMs: 10000
arguments:
values:
- name: "operationType"
value: 0
- name: "credential"
value: { CredentialType: 1, CredentialIndex: 1 }
- name: "credentialData"
value: "123456"
- name: "userIndex"
value: 1
- name: "userStatus"
value: null
- name: "userType"
value: null
response:
values:
- name: "status"
value: 0
- name: "userIndex"
value: null
- name: "nextCredentialIndex"
value: 2
- label: "TH sends Get Credential Status Command"
PICS: DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx
command: "GetCredentialStatus"
arguments:
values:
- name: "credential"
value: { CredentialType: 1, CredentialIndex: 1 }
response:
values:
- name: "credentialExists"
constraints:
type: boolean
- name: "userIndex"
value: 1
- name: "creatorFabricIndex"
value: 1
- name: "lastModifiedFabricIndex"
value: 1
- name: "nextCredentialIndex"
value: null
- label: "TH sends Set Credential Command to DUT"
PICS: DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx
command: "SetCredential"
timedInteractionTimeoutMs: 10000
arguments:
values:
- name: "operationType"
value: 0
- name: "credential"
value: { CredentialType: 1, CredentialIndex: 2 }
- name: "credentialData"
value: "4321"
- name: "userIndex"
value: null
- name: "userStatus"
value: 5
- name: "userType"
value: 10
response:
values:
- name: "status"
value: 0x85
- name: "userIndex"
value: null
- name: "nextCredentialIndex"
value: 3
- label: "TH sends Set Credential Command to DUT"
PICS: DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx
command: "SetCredential"
timedInteractionTimeoutMs: 10000
arguments:
values:
- name: "operationType"
value: 0
- name: "credential"
value: { CredentialType: 1, CredentialIndex: 2 }
- name: "credentialData"
value: "123456"
- name: "userIndex"
value: null
- name: "userStatus"
value: null
- name: "userType"
value: null
response:
values:
- name: "status"
value: 0x02
- name: "userIndex"
value: null
- name: "nextCredentialIndex"
value: 3
- label:
"TH sends Set Credential Command to DUT and Verify that the DUT sends
Set Credential Response command with status as DUPLICATE or OCCUPIED"
verification: |
./chip-tool doorlock set-credential 0 '{ "credentialType" : 1, "credentialIndex" : 1 }' 123456 1 null null 1 1 --timedInteractionTimeoutMs 1000
Verify "DUT sends Set Credential Response command with response as DUPLICATE or OCCUPIED" on the TH(Chip-tool) Log:
[[1656506733.767451][27276:27281] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0101 Command=0x0000_0023
[1656506733.767542][27276:27281] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0101 Command 0x0000_0023
[1656506733.767663][27276:27281] CHIP:TOO: SetCredentialResponse: {
[1656506733.767731][27276:27281] CHIP:TOO: status: 2
[1656506733.767779][27276:27281] CHIP:TOO: userIndex: null
[1656506733.767826][27276:27281] CHIP:TOO: nextCredentialIndex: 2
[1656506733.767871][27276:27281] CHIP:TOO: }
cluster: "LogCommands"
command: "UserPrompt"
PICS: PICS_USER_PROMPT && DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx
arguments:
values:
- name: "message"
value: "Please enter 'y' for success"
- name: "expectedValue"
value: "y"
- label:
"TH sends Set Credential Command to DUT and Verify that the DUT sends
Set Credential Response command with response as OCCUPIED if the
CredentialIndex is repeated"
verification: |
./chip-tool doorlock set-credential 0 '{ "credentialType" : 1, "credentialIndex" : 1 }' 12345 1 null null 1 1 --timedInteractionTimeoutMs 1000
Verify "DUT sends Set Credential Response command with response as DUPLICATE or OCCUPIED" on the TH(Chip-tool) Log:
[1660216276.191641][71849:71854] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0101 Command=0x0000_0023
[1660216276.191673][71849:71854] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0101 Command 0x0000_0023
[1660216276.191725][71849:71854] CHIP:TOO: SetCredentialResponse: {
[1660216276.191752][71849:71854] CHIP:TOO: status: 3
[1660216276.191764][71849:71854] CHIP:TOO: userIndex: null
[1660216276.191776][71849:71854] CHIP:TOO: nextCredentialIndex: 2
[1660216276.191798][71849:71854] CHIP:TOO: }
cluster: "LogCommands"
command: "UserPrompt"
PICS: PICS_USER_PROMPT && DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx
arguments:
values:
- name: "message"
value: "Please enter 'y' for success"
- name: "expectedValue"
value: "y"
#Issue 19990 expected response OCCUPIED, but CHIP Tool Verification Steps shows status: 2 fix script once the issue is fixed.
- label:
"TH sends Set Credential Command to DUT and Verify that the DUT sends
Set Credential Response command with response as OCCUPIED if the
CredentialIndex is repeated"
verification: |
Mark as not applicable and proceed to next step
./chip-tool doorlock set-credential 2 '{ "credentialType" : 1, "credentialIndex" : 3 }' 1234567 1 null null 1 1 --timedInteractionTimeoutMs 1000
Verify "DUT sends Set Credential Response command with response as OCCUPIED" on the TH(Chip-tool) Log:
[1658473055.384297][2667:2672] CHIP:DMG: },
[1658473055.384374][2667:2672] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0101 Command=0x0000_0023
[1658473055.384433][2667:2672] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0101 Command 0x0000_0023
[1658473055.384516][2667:2672] CHIP:TOO: SetCredentialResponse: {
[1658473055.384571][2667:2672] CHIP:TOO: status: 2
[1658473055.384602][2667:2672] CHIP:TOO: userIndex: null
[1658473055.384632][2667:2672] CHIP:TOO: nextCredentialIndex: 4
[1658473055.384660][2667:2672] CHIP:TOO: }
cluster: "LogCommands"
command: "UserPrompt"
PICS: PICS_USER_PROMPT && DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx
arguments:
values:
- name: "message"
value: "Please enter 'y' for success"
- name: "expectedValue"
value: "y"
- label: "TH sends Clear Credential Command to DUT"
PICS: DRLK.S.F08 && DRLK.S.C26.Rsp
command: "ClearCredential"
timedInteractionTimeoutMs: 10000
arguments:
values:
- name: "credential"
value: { CredentialType: 1, CredentialIndex: 1 }
- label: "TH sends Get Credential Status Command to DUT"
PICS: DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx
command: "GetCredentialStatus"
arguments:
values:
- name: "credential"
value: { CredentialType: 1, CredentialIndex: 1 }
response:
values:
- name: "credentialExists"
value: false
- name: "userIndex"
value: null
- name: "creatorFabricIndex"
value: null
- name: "lastModifiedFabricIndex"
value: null
- name: "nextCredentialIndex"
value: null
- label: "TH sends Set User Command to DUT"
PICS: DRLK.S.F08 && DRLK.S.C1a.Rsp
command: "SetUser"
timedInteractionTimeoutMs: 10000
arguments:
values:
- name: "operationType"
value: 0
- name: "userIndex"
value: 2
- name: "userName"
value: "xxx"
- name: "userUniqueId"
value: "6452"
- name: "userStatus"
value: 1
- name: "userType"
value: 0
- name: "credentialRule"
value: 0
- label: "TH sends Set Credential Command to DUT"
PICS: DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx
command: "SetCredential"
timedInteractionTimeoutMs: 10000
arguments:
values:
- name: "operationType"
value: 0
- name: "credential"
value: { CredentialType: 1, CredentialIndex: 1 }
- name: "credentialData"
value: "123456"
- name: "userIndex"
value: 2
- name: "userStatus"
value: null
- name: "userType"
value: null
response:
values:
- name: "status"
value: 0
- name: "userIndex"
value: null
- name: "nextCredentialIndex"
value: 2
- label: "TH sends Clear Credential Command to DUT"
PICS: DRLK.S.F08 && DRLK.S.C26.Rsp
command: "ClearCredential"
timedInteractionTimeoutMs: 10000
arguments:
values:
- name: "credential"
value: { CredentialType: 1, CredentialIndex: 65534 }
- label: "TH sends Get Credential Status Command"
PICS: DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx
command: "GetCredentialStatus"
arguments:
values:
- name: "credential"
value: { CredentialType: 1, CredentialIndex: 65534 }
response:
values:
- name: "credentialExists"
value: false
- name: "userIndex"
value: null
- name: "creatorFabricIndex"
value: null
- name: "lastModifiedFabricIndex"
value: null
- name: "nextCredentialIndex"
value: null
- label: "TH sends Get Credential Status Command"
PICS: DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx
command: "GetCredentialStatus"
arguments:
values:
- name: "credential"
value: { CredentialType: 1, CredentialIndex: 1 }
response:
values:
- name: "credentialExists"
value: false
- name: "userIndex"
value: null
- name: "creatorFabricIndex"
value: null
- name: "lastModifiedFabricIndex"
value: null
- name: "nextCredentialIndex"
value: null
- label: "TH sends Clear Credential Command to DUT"
PICS: DRLK.S.F08 && DRLK.S.C26.Rsp
command: "ClearCredential"
timedInteractionTimeoutMs: 10000
arguments:
values:
- name: "credential"
value: { CredentialType: 8, CredentialIndex: 2 }
response:
error: INVALID_COMMAND
- label: "Cleanup the first created user"
command: "ClearUser"
timedInteractionTimeoutMs: 10000
arguments:
values:
- name: "userIndex"
value: 1
- label: "Cleanup the second created user"
command: "ClearUser"
timedInteractionTimeoutMs: 10000
arguments:
values:
- name: "userIndex"
value: 2