Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests in DL_LockUnlock yaml to validate Lock/Unlock credentials and userIndex (#24992) #25030

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"Test_TC_ACL_2_7",
"Test_TC_ACL_2_8",
"Test_TC_ACL_2_9",
"Test_TC_ACL_2_10"
"Test_TC_ACL_2_10",
"DL_LockUnlock"
]
}
92 changes: 85 additions & 7 deletions src/app/tests/suites/DL_LockUnlock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ config:
nodeId: 0x12344321
cluster: "Door Lock"
endpoint: 1
timeout: 15

tests:
- label: "Wait for the commissioned device to be retrieved"
Expand Down Expand Up @@ -48,19 +49,41 @@ tests:
response:
value: 1

- label: "Create new PIN credential and lock/unlock user"
- label: "Create new lock/unlock user"
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:
"Create new PIN credential and associate it with lock/unlock user,
with userIndex != credentialIndex"
command: "SetCredential"
timedInteractionTimeoutMs: 10000
arguments:
values:
- name: "OperationType"
value: 0
- name: "Credential"
value: { CredentialType: 1, CredentialIndex: 1 }
value: { CredentialType: 1, CredentialIndex: 2 }
- name: "CredentialData"
value: "123456"
- name: "UserIndex"
value: null
value: 1
- name: "UserStatus"
value: null
- name: "UserType"
Expand All @@ -70,9 +93,9 @@ tests:
- name: "Status"
value: 0x00
- name: "UserIndex"
value: 1
value: null
- name: "NextCredentialIndex"
value: 2
value: 3

- label:
"Set the WrongCodeEntryLimit to big value so that we can test
Expand Down Expand Up @@ -106,6 +129,36 @@ tests:
- name: "PINCode"
value: "123456"

- label: "Read the LockOperation event list"
command: "readEvent"
event: "LockOperation"
response:
- values:
- value:
{
"LockOperationType": 1,
"OperationSource": 7,
"UserIndex": null,
"Credentials": null,
}
- values:
- value:
{
"LockOperationType": 0,
"OperationSource": 7,
"UserIndex": null,
"Credentials": null,
}
- values:
- value:
{
"LockOperationType": 1,
"OperationSource": 7,
"UserIndex": 1,
"Credentials":
[{ "CredentialType": 1, "CredentialIndex": 2 }],
}

- label: "Verify that lock state attribute value is set to Unlocked"
command: "readAttribute"
attribute: "LockState"
Expand All @@ -122,6 +175,31 @@ tests:
response:
error: FAILURE

- label:
"Read the LockOperationError event list; verify null UserIndex and
Credentials"
command: "readEvent"
event: "LockOperationError"
response:
- values:
- value:
{
"LockOperationType": 1,
"OperationSource": 7,
"OperationError": 1,
"UserIndex": null,
"Credentials": null,
}
- values:
- value:
{
"LockOperationType": 0,
"OperationSource": 7,
"OperationError": 1,
"UserIndex": null,
"Credentials": null,
}

- label: "Verify that lock state attribute value is set to Unlocked"
command: "readAttribute"
attribute: "LockState"
Expand Down Expand Up @@ -254,7 +332,7 @@ tests:
- name: "OperationType"
value: 0
- name: "Credential"
value: { CredentialType: 1, CredentialIndex: 2 }
value: { CredentialType: 1, CredentialIndex: 3 }
- name: "CredentialData"
value: "654321"
- name: "UserIndex"
Expand All @@ -270,7 +348,7 @@ tests:
- name: "UserIndex"
value: 2
- name: "NextCredentialIndex"
value: 3
value: 4

- label: "Try to unlock the door with disabled user PIN"
command: "UnlockDoor"
Expand Down
Loading