diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 3acc9e4cdf4fe2..9aa099bf0bbef2 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -399,6 +399,7 @@ jobs: ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py \ --target linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test \ + --target linux-x64-lock-ipv6only-no-ble-no-wifi-tsan-clang-test \ --target linux-x64-python-bindings \ build \ --copy-artifacts-to objdir-clone \ @@ -426,6 +427,9 @@ jobs: scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_RVCCLEANM_1_2.py" --script-args "--int-arg PIXIT_ENDPOINT:1 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_RVCRUNM_1_2.py" --script-args "--int-arg PIXIT_ENDPOINT:1 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --script "src/python_testing/TestMatterTestingSupport.py" --script-args "--trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' + scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-lock-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-lock-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_DRLK_2_2.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' + scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-lock-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-lock-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_DRLK_2_3.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' + scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-lock-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-lock-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_DRLK_2_12.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"' scripts/run_in_python_env.sh out/venv './scripts/tests/TestTimeSyncTrustedTimeSourceRunner.py' - name: Uploading core files uses: actions/upload-artifact@v3 diff --git a/scripts/tests/chiptest/__init__.py b/scripts/tests/chiptest/__init__.py index 29942b0a2e2ac4..e3d2f25d2db368 100644 --- a/scripts/tests/chiptest/__init__.py +++ b/scripts/tests/chiptest/__init__.py @@ -170,9 +170,6 @@ def _GetChipReplUnsupportedTests() -> Set[str]: "Test_TC_DRLK_2_8.yaml", # Test fails only in chip-repl: Refer--> https://github.com/project-chip/connectedhomeip/pull/27011#issuecomment-1593339855 "Test_TC_ACE_1_6.yaml", # Test fails only in chip-repl: Refer--> https://github.com/project-chip/connectedhomeip/pull/27910#issuecomment-1632485584 "Test_TC_IDM_1_2.yaml", # chip-repl does not support AnyCommands (19/07/2023) - "Test_TC_DRLK_2_2.yaml", # chip-repl does not support EqualityCommands pseudo-cluster (08/04/2023) - "Test_TC_DRLK_2_3.yaml", # chip-repl does not support EqualityCommands pseudo-cluster (08/04/2023) - "Test_TC_DRLK_2_12.yaml", # chip-repl does not support EqualityCommands pseudo-cluster (08/04/2023) "TestGroupKeyManagementCluster.yaml", # chip-repl does not support EqualityCommands (2023-08-04) "Test_TC_S_2_2.yaml", # chip-repl does not support scenes cluster commands "Test_TC_S_2_3.yaml", # chip-repl does not support scenes cluster commands diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_12.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_12.yaml deleted file mode 100644 index 2ac6471498e574..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_12.yaml +++ /dev/null @@ -1,544 +0,0 @@ -# Copyright (c) 2023 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: 121.3.2. [TC-DRLK-2.12] Verification for Ubolt Door command [DUT-Server] - -PICS: - - DRLK.S.F0c - -config: - nodeId: 0x12344321 - cluster: "Door Lock" - endpoint: 1 - requirePINIsTrue: - type: BOOLEAN - defaultValue: false - -tests: - - label: "Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Precondition: Create new user" - PICS: DRLK.S.F00 && DRLK.S.F07 - command: "SetUser" - timedInteractionTimeoutMs: 1000 - 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: "Precondition: Read the user back and verify its fields" - PICS: DRLK.S.F00 && DRLK.S.F07 - 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: [] - - name: "CreatorFabricIndex" - value: 1 - - name: "LastModifiedFabricIndex" - value: 1 - - name: "NextUserIndex" - value: null - - - label: "Precondition: Create new PIN credential and lock/unlock user" - PICS: DRLK.S.F00 && DRLK.S.F07 - command: "SetCredential" - timedInteractionTimeoutMs: 1000 - 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: "Precondition: Verify created PIN credential" - PICS: DRLK.S.F00 && DRLK.S.F07 - command: "GetCredentialStatus" - arguments: - values: - - name: "Credential" - value: { CredentialType: 1, CredentialIndex: 1 } - response: - values: - - name: "CredentialExists" - value: true - - name: "UserIndex" - value: 1 - - name: "CreatorFabricIndex" - value: 1 - - name: "LastModifiedFabricIndex" - value: 1 - - name: "NextCredentialIndex" - value: null - - - label: - "Step 1: TH writes the RequirePINforRemoteOperation attribute value as - False on the DUT" - PICS: DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033.Write - command: "writeAttribute" - attribute: "RequirePINforRemoteOperation" - arguments: - value: false - - - label: - "Step 1: TH writes the RequirePINforRemoteOperation attribute value as - False on the DUT" - PICS: DRLK.S.F07 && DRLK.S.F00 && !DRLK.S.A0033.Write - command: "writeAttribute" - attribute: "RequirePINforRemoteOperation" - arguments: - value: false - response: - error: UNSUPPORTED_WRITE - - - label: - "Step 2: TH reads the RequirePINforRemoteOperation attribute from the - DUT" - PICS: DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033 - command: "readAttribute" - attribute: "RequirePINforRemoteOperation" - response: - saveAs: requirePINIsTrue - constraints: - type: boolean - minValue: 0 - maxValue: 1 - - - label: - "Step 2a: TH verifies the RequirePINforRemoteOperation attribute value - is now False on the DUT" - PICS: DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033.Write - cluster: "EqualityCommands" - command: "BooleanEquals" - arguments: - values: - - name: "Value1" - value: requirePINIsTrue - - name: "Value2" - value: false - response: - - values: - - name: "Equals" - value: true - - - label: "Step 2b: Compute RequirePINforRemoteOperation" - cluster: "EqualityCommands" - command: "BooleanEquals" - arguments: - values: - - name: "Value1" - value: requirePINIsTrue - - name: "Value2" - value: false - response: - - values: - - name: "Equals" - saveAs: requirePINIsFalse - constraints: - type: boolean - minValue: 0 - maxValue: 1 - - - label: "Step 3: TH sends Ubolt Door Command to the DUT without PINCode" - runIf: requirePINIsFalse - PICS: DRLK.S.C27.Rsp - command: "UnboltDoor" - timedInteractionTimeoutMs: 1000 - - - label: "Step 3: TH sends Ubolt Door Command to the DUT without PINCode" - runIf: requirePINIsTrue - PICS: DRLK.S.C27.Rsp - command: "UnboltDoor" - timedInteractionTimeoutMs: 1000 - response: - error: FAILURE - - - label: "Step 4: TH sends Ubolt Door Command to the DUT with PINCode" - PICS: DRLK.S.C27.Rsp - command: "UnboltDoor" - timedInteractionTimeoutMs: 1000 - arguments: - values: - - name: "PINCode" - value: "123456" - - - label: - "Step 5: TH writes the RequirePINforRemoteOperation attribute value as - true on the DUT" - PICS: DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033.Write - command: "writeAttribute" - attribute: "RequirePINforRemoteOperation" - arguments: - value: true - - - label: - "Step 5: TH writes the RequirePINforRemoteOperation attribute value as - true on the DUT" - PICS: DRLK.S.F07 && DRLK.S.F00 && !DRLK.S.A0033.Write - command: "writeAttribute" - attribute: "RequirePINforRemoteOperation" - arguments: - value: true - response: - error: UNSUPPORTED_WRITE - - - label: - "Step 6: TH reads the RequirePINforRemoteOperation attribute from the - DUT" - PICS: DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033 - command: "readAttribute" - attribute: "RequirePINforRemoteOperation" - response: - saveAs: requirePINIsTrue - constraints: - type: boolean - minValue: 0 - maxValue: 1 - - - label: - "Step 6a: TH verifies the RequirePINforRemoteOperation attribute value - is now True on the DUT" - PICS: DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033.Write - cluster: "EqualityCommands" - command: "BooleanEquals" - arguments: - values: - - name: "Value1" - value: requirePINIsTrue - - name: "Value2" - value: true - response: - - values: - - name: "Equals" - value: true - - - label: "Step 6b: Compute RequirePINforRemoteOperation" - cluster: "EqualityCommands" - command: "BooleanEquals" - arguments: - values: - - name: "Value1" - value: requirePINIsTrue - - name: "Value2" - value: false - response: - - values: - - name: "Equals" - saveAs: requirePINIsFalse - constraints: - type: boolean - minValue: 0 - maxValue: 1 - - - label: - "Step 7: TH sends Unbolt Door Command to the DUT with Invalid PINCode" - PICS: DRLK.S.F00 && DRLK.S.C27.Rsp - command: "UnboltDoor" - timedInteractionTimeoutMs: 1000 - arguments: - values: - - name: "PINCode" - value: "123458" - response: - error: FAILURE - - - label: "Step 8: TH sends Unbolt Door Command to the DUT without PINCode" - runIf: requirePINIsTrue - PICS: DRLK.S.F00 && DRLK.S.C27.Rsp - command: "UnboltDoor" - timedInteractionTimeoutMs: 1000 - response: - error: FAILURE - - - label: "Step 8: TH sends Unbolt Door Command to the DUT without PINCode" - runIf: requirePINIsFalse - PICS: DRLK.S.F00 && DRLK.S.C27.Rsp - command: "UnboltDoor" - timedInteractionTimeoutMs: 1000 - - - label: "Step 9: TH sends Ubolt Door Command to the DUT with valid PINCode" - PICS: DRLK.S.C27.Rsp - command: "UnboltDoor" - timedInteractionTimeoutMs: 1000 - arguments: - values: - - name: "PINCode" - value: "123456" - - - label: - "Step 10: TH writes WrongCodeEntryLimit attribute value as 3 on the - DUT" - PICS: ( DRLK.S.F00 || DRLK.S.F01 ) && DRLK.S.A0030.Write - command: "writeAttribute" - attribute: "WrongCodeEntryLimit" - arguments: - value: 3 - - - label: - "Step 10: TH writes WrongCodeEntryLimit attribute value as 3 on the - DUT" - PICS: ( DRLK.S.F00 || DRLK.S.F01 ) && !DRLK.S.A0030.Write - command: "writeAttribute" - attribute: "WrongCodeEntryLimit" - arguments: - value: 3 - response: - error: UNSUPPORTED_WRITE - - - label: - "Step 11: TH writes UserCodeTemporaryDisableTime attribute value as 15 - Seconds on the DUT and Verify that the DUT sends Success response" - PICS: ( DRLK.S.F00 || DRLK.S.F01 ) && DRLK.S.A0031.Write - command: "writeAttribute" - attribute: "UserCodeTemporaryDisableTime" - arguments: - value: 15 - - - label: - "Step 11: TH writes UserCodeTemporaryDisableTime attribute value as 15 - Seconds on the DUT and Verify that the DUT sends Success response" - PICS: ( DRLK.S.F00 || DRLK.S.F01 ) && !DRLK.S.A0031.Write - command: "writeAttribute" - attribute: "UserCodeTemporaryDisableTime" - arguments: - value: 15 - response: - error: UNSUPPORTED_WRITE - - - label: - "Step 12a: TH sends Unbolt Door Command to the DUT with invalid - PINCode" - PICS: DRLK.S.F00 && DRLK.S.C27.Rsp - command: "UnboltDoor" - timedInteractionTimeoutMs: 1000 - arguments: - values: - - name: "PINCode" - value: "123457" - response: - error: FAILURE - - - label: - "Step 12b: TH sends Unbolt Door Command to the DUT with invalid - PINCode" - PICS: DRLK.S.F00 && DRLK.S.C27.Rsp - command: "UnboltDoor" - timedInteractionTimeoutMs: 1000 - arguments: - values: - - name: "PINCode" - value: "123458" - response: - error: FAILURE - - - label: - "Step 12c: TH sends Unbolt Door Command to the DUT with invalid - PINCode" - PICS: DRLK.S.F00 && DRLK.S.C27.Rsp - command: "UnboltDoor" - timedInteractionTimeoutMs: 1000 - arguments: - values: - - name: "PINCode" - value: "123459" - response: - error: FAILURE - - - label: - "Step 13: TH reads UserCodedTemporaryDisableTime attribute from DUT" - PICS: ( DRLK.S.F00 || DRLK.S.F01 ) && DRLK.S.A0031 - command: "readAttribute" - attribute: "UserCodeTemporaryDisableTime" - response: - value: 15 - - - label: - "Step 14: TH sends Unbolt Door Command to the DUT with valid PINCode - before UserCodeTemporaryDisableTime expires" - PICS: DRLK.S.F00 && DRLK.S.C27.Rsp - command: "UnboltDoor" - timedInteractionTimeoutMs: 1000 - arguments: - values: - - name: "PINCode" - value: "123456" - response: - error: FAILURE - - - label: "Wait for UserCodeTemporaryDisableTime expires" - cluster: "DelayCommands" - command: "WaitForMs" - PICS: ( DRLK.S.F00 || DRLK.S.F01 ) && DRLK.S.A0031 - arguments: - values: - - name: "ms" - value: 15000 - - - label: - "Step 15: TH writes AutoRelockTime attribute value as 60 seconds on - the DUT" - PICS: DRLK.S.A0023.Write && PICS_SDK_CI_ONLY - command: "writeAttribute" - attribute: "AutoRelockTime" - arguments: - value: 10 - - - label: - "Step 15: TH writes AutoRelockTime attribute value as 60 seconds on - the DUT" - PICS: DRLK.S.A0023.Write && PICS_SKIP_SAMPLE_APP - command: "writeAttribute" - attribute: "AutoRelockTime" - arguments: - value: 60 - - - label: - "Step 15: TH writes AutoRelockTime attribute value as 10 seconds on - the DUT" - PICS: PICS_SDK_CI_ONLY && !DRLK.S.A0023.Write - command: "writeAttribute" - attribute: "AutoRelockTime" - arguments: - value: 10 - response: - error: UNSUPPORTED_WRITE - - - label: - "Step 15: TH writes AutoRelockTime attribute value as 60 seconds on - the DUT" - PICS: PICS_SKIP_SAMPLE_APP && !DRLK.S.A0023.Write - command: "writeAttribute" - attribute: "AutoRelockTime" - arguments: - value: 60 - response: - error: UNSUPPORTED_WRITE - - - label: "Step 16: TH reads the AutoRelockTime attribute from the DUT" - PICS: DRLK.S.A0023 && PICS_SDK_CI_ONLY - command: "readAttribute" - attribute: "AutoRelockTime" - response: - value: 10 - - - label: "Step 16: TH reads the AutoRelockTime attribute from the DUT" - PICS: DRLK.S.A0023 && PICS_SKIP_SAMPLE_APP - command: "readAttribute" - attribute: "AutoRelockTime" - response: - value: 60 - - - label: - "Step 17: TH sends the Unbolt Door command to the DUT with valid - PINCode" - PICS: DRLK.S.C27.Rsp - command: "UnboltDoor" - timedInteractionTimeoutMs: 1000 - arguments: - values: - - name: "PINCode" - value: "123456" - - - label: "Wait for AutoRelockTime Expires" - cluster: "DelayCommands" - command: "WaitForMs" - PICS: DRLK.S.A0023 && PICS_SDK_CI_ONLY - arguments: - values: - - name: "ms" - value: 10000 - - - label: "Wait for AutoRelockTime Expires" - cluster: "DelayCommands" - command: "WaitForMs" - PICS: DRLK.S.A0023 && PICS_SKIP_SAMPLE_APP - arguments: - values: - - name: "ms" - value: 60000 - - - label: "Step 18: TH reads LockState attribute" - PICS: DRLK.S.A0000 && DRLK.S.C01.Rsp - command: "readAttribute" - attribute: "LockState" - response: - value: 1 - - - label: "Cleanup the created user" - PICS: DRLK.S.F00 && DRLK.S.F07 - command: "ClearUser" - timedInteractionTimeoutMs: 1000 - arguments: - values: - - name: "UserIndex" - value: 1 - - - label: "Clean the created credential" - PICS: DRLK.S.F00 && DRLK.S.F07 && DRLK.S.C26.Rsp - command: "ClearCredential" - timedInteractionTimeoutMs: 1000 - arguments: - values: - - name: "Credential" - value: { CredentialType: 1, CredentialIndex: 1 } diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_2.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_2.yaml deleted file mode 100644 index be0775f8f9e7ee..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_2.yaml +++ /dev/null @@ -1,523 +0,0 @@ -# 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.2. [TC-DRLK-2.2] Verification for Door lock command[DUT-Server] - -PICS: - - DRLK.S - -config: - nodeId: 0x12344321 - cluster: "Door Lock" - endpoint: 1 - requirePINIsTrue: - type: BOOLEAN - defaultValue: false - -tests: - - label: "Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Precondition: Create new user" - PICS: DRLK.S.F00 && DRLK.S.F07 - command: "SetUser" - timedInteractionTimeoutMs: 1000 - 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: "Precondition: Read the user back and verify its fields" - PICS: DRLK.S.F00 && DRLK.S.F07 - 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: [] - - name: "CreatorFabricIndex" - value: 1 - - name: "LastModifiedFabricIndex" - value: 1 - - name: "NextUserIndex" - value: null - - - label: "Precondition: Create new PIN credential and lock/unlock user" - PICS: DRLK.S.F00 && DRLK.S.F07 - command: "SetCredential" - timedInteractionTimeoutMs: 1000 - 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: "Precondition: Verify created PIN credential" - PICS: DRLK.S.F00 && DRLK.S.F07 - command: "GetCredentialStatus" - arguments: - values: - - name: "Credential" - value: { CredentialType: 1, CredentialIndex: 1 } - response: - values: - - name: "CredentialExists" - value: true - - name: "UserIndex" - value: 1 - - name: "CreatorFabricIndex" - value: 1 - - name: "LastModifiedFabricIndex" - value: 1 - - name: "NextCredentialIndex" - value: null - - - label: - "Step 1: TH writes the RequirePINforRemoteOperation attribute value as - False on the DUT" - PICS: DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033.Write - command: "writeAttribute" - attribute: "RequirePINforRemoteOperation" - arguments: - value: false - - - label: - "Step 1: TH writes the RequirePINforRemoteOperation attribute value as - False on the DUT" - PICS: DRLK.S.F07 && DRLK.S.F00 && !DRLK.S.A0033.Write - command: "writeAttribute" - attribute: "RequirePINforRemoteOperation" - arguments: - value: false - response: - error: UNSUPPORTED_WRITE - - - label: - "Step 2: TH reads the RequirePINforRemoteOperation attribute from the - DUT" - PICS: DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033 - command: "readAttribute" - attribute: "RequirePINforRemoteOperation" - response: - saveAs: requirePINIsTrue - constraints: - type: boolean - minValue: 0 - maxValue: 1 - - - label: - "Step 2a: TH verifies the RequirePINforRemoteOperation attribute value - is now False on the DUT" - PICS: DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033.Write - cluster: "EqualityCommands" - command: "BooleanEquals" - arguments: - values: - - name: "Value1" - value: requirePINIsTrue - - name: "Value2" - value: false - response: - - values: - - name: "Equals" - value: true - - - label: "Step 2b: Compute RequirePINforRemoteOperation" - cluster: "EqualityCommands" - command: "BooleanEquals" - arguments: - values: - - name: "Value1" - value: requirePINIsTrue - - name: "Value2" - value: false - response: - - values: - - name: "Equals" - saveAs: requirePINIsFalse - constraints: - type: boolean - minValue: 0 - maxValue: 1 - - - label: "Step 3: TH sends Lock Door Command to the DUT without PINCode" - runIf: requirePINIsFalse - PICS: DRLK.S.C00.Rsp - command: "LockDoor" - timedInteractionTimeoutMs: 1000 - - - label: "Step 3: TH sends Lock Door Command to the DUT without PINCode" - runIf: requirePINIsTrue - PICS: DRLK.S.C00.Rsp - command: "LockDoor" - timedInteractionTimeoutMs: 1000 - response: - error: FAILURE - - - label: "Step 4: TH sends Lock Door Command to the DUT with valid PINCode" - PICS: DRLK.S.C00.Rsp - command: "LockDoor" - timedInteractionTimeoutMs: 1000 - arguments: - values: - - name: "PINCode" - value: "123456" - - - label: - "Step 5: TH writes the RequirePINforRemoteOperation attribute value as - true on the DUT" - PICS: DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033.Write - command: "writeAttribute" - attribute: "RequirePINforRemoteOperation" - arguments: - value: true - - - label: - "Step 5: TH writes the RequirePINforRemoteOperation attribute value as - true on the DUT" - PICS: DRLK.S.F07 && DRLK.S.F00 && !DRLK.S.A0033.Write - command: "writeAttribute" - attribute: "RequirePINforRemoteOperation" - arguments: - value: true - response: - error: UNSUPPORTED_WRITE - - - label: - "Step 6: TH reads the RequirePINforRemoteOperation attribute from the - DUT" - PICS: DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033 - command: "readAttribute" - attribute: "RequirePINforRemoteOperation" - response: - saveAs: requirePINIsTrue - constraints: - type: boolean - minValue: 0 - maxValue: 1 - - - label: - "Step 6a: TH verifies the RequirePINforRemoteOperation attribute value - is now True on the DUT" - PICS: DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033.Write - cluster: "EqualityCommands" - command: "BooleanEquals" - arguments: - values: - - name: "Value1" - value: requirePINIsTrue - - name: "Value2" - value: true - response: - - values: - - name: "Equals" - value: true - - - label: "Step 6b: Compute RequirePINforRemoteOperation" - cluster: "EqualityCommands" - command: "BooleanEquals" - arguments: - values: - - name: "Value1" - value: requirePINIsTrue - - name: "Value2" - value: false - response: - - values: - - name: "Equals" - saveAs: requirePINIsFalse - constraints: - type: boolean - minValue: 0 - maxValue: 1 - - - label: - "Step 7: TH sends Lock Door Command to the DUT without valid PINCode" - PICS: DRLK.S.F00 && DRLK.S.C00.Rsp && DRLK.S.A0033 - command: "LockDoor" - timedInteractionTimeoutMs: 1000 - arguments: - values: - - name: "PINCode" - value: "645321" - response: - error: FAILURE - - - label: "Step 8: TH sends Lock Door Command to the DUT without PINCode" - runIf: requirePINIsTrue - PICS: DRLK.S.F00 && DRLK.S.C00.Rsp && DRLK.S.A0033 - command: "LockDoor" - timedInteractionTimeoutMs: 1000 - response: - error: FAILURE - - - label: "Step 8: TH sends Lock Door Command to the DUT without PINCode" - runIf: requirePINIsFalse - PICS: DRLK.S.F00 && DRLK.S.C00.Rsp && DRLK.S.A0033 - command: "LockDoor" - timedInteractionTimeoutMs: 1000 - - - label: "Step 9: TH sends Lock Door Command to the DUT with valid PINCode" - PICS: DRLK.S.C00.Rsp && DRLK.S.A0033 - command: "LockDoor" - timedInteractionTimeoutMs: 1000 - arguments: - values: - - name: "PINCode" - value: "123456" - - - label: "Step 10a: H reads the WrongCodeEntryLimit attribute from the DUT" - PICS: DRLK.S.A0030 - command: "readAttribute" - attribute: "WrongCodeEntryLimit" - response: - constraints: - minValue: 1 - maxValue: 255 - - #currently for loop is not implemented in yaml framework so converted this step as user prompt - - label: - "Step 10b: TH sends an Unlock Door Command from the DUT with invalid - PINCode. Repeat this step PIXIT.DRLK.WrongCodeEntryLimit times and - Verify that DUT sends failure response to the TH" - verification: | - ./chip-tool doorlock unlock-door 1 1 --timedInteractionTimeoutMs 1000 --PINCode 1234568 - - Verify " DUT sends failure response" on the TH(Chip-tool) Log: - - [1659013993.892445][25432:25437] CHIP:DMG: CommandPathIB = - [1659013993.892496][25432:25437] CHIP:DMG: { - [1659013993.892546][25432:25437] CHIP:DMG: EndpointId = 0x1, - [1659013993.892597][25432:25437] CHIP:DMG: ClusterId = 0x101, - [1659013993.892647][25432:25437] CHIP:DMG: CommandId = 0x1, - [1659013993.892694][25432:25437] CHIP:DMG: }, - [1659013993.892747][25432:25437] CHIP:DMG: - [1659013993.892791][25432:25437] CHIP:DMG: StatusIB = - [1659013993.892840][25432:25437] CHIP:DMG: { - [1659013993.892890][25432:25437] CHIP:DMG: status = 0x01 (FAILURE), - [1659013993.892938][25432:25437] CHIP:DMG: }, - [1659013993.892987][25432:25437] CHIP:DMG: - [1659013993.893029][25432:25437] CHIP:DMG: }, - [1659013993.893076][25432:25437] CHIP:DMG: - [1659013993.893105][25432:25437] CHIP:DMG: }, - [1659013993.893147][25432:25437] CHIP:DMG: - [1659013993.893173][25432:25437] CHIP:DMG: ], - [1659013993.893203][25432:25437] CHIP:DMG: - [1659013993.893227][25432:25437] CHIP:DMG: InteractionModelRevision = 1 - [1659013993.893251][25432:25437] CHIP:DMG: }, - [1659013993.893310][25432:25437] CHIP:DMG: Received Command Response Status for Endpoint=1 Cluster=0x0000_0101 Command=0x0000_0001 Status=0x1 - [1659013993.893344][25432:25437] CHIP:TOO: Error: IM Error 0x00000501: General error: 0x01 (FAILURE) - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT && DRLK.S.F00 && DRLK.S.A0030 - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: - "Step 10c: TH sends an Unlock Door Command from User1 to the DUT with - the valid PINCode and verify the DUT response" - verification: | - ./chip-tool doorlock unlock-door 1 1 --timedInteractionTimeoutMs 1000 --PINCode 123456 - - Verify " DUT sends failure response" on the TH(Chip-tool) Log: - - [1659517923.875822][33902:33907] CHIP:DMG: StatusIB = - [1659517923.875858][33902:33907] CHIP:DMG: { - [1659517923.875894][33902:33907] CHIP:DMG: status = 0x01 (FAILURE), - [1659517923.876008][33902:33907] CHIP:DMG: }, - [1659517923.876048][33902:33907] CHIP:DMG: - [1659517923.876079][33902:33907] CHIP:DMG: }, - [1659517923.876116][33902:33907] CHIP:DMG: - [1659517923.876145][33902:33907] CHIP:DMG: }, - [1659517923.876178][33902:33907] CHIP:DMG: - [1659517923.876233][33902:33907] CHIP:DMG: ], - [1659517923.876266][33902:33907] CHIP:DMG: - [1659517923.876290][33902:33907] CHIP:DMG: InteractionModelRevision = 1 - [1659517923.876395][33902:33907] CHIP:DMG: }, - [1659517923.876460][33902:33907] CHIP:DMG: Received Command Response Status for Endpoint=1 Cluster=0x0000_0101 Command=0x0000_0001 Status=0x1 - [1659517923.876495][33902:33907] CHIP:TOO: Error: IM Error 0x00000501: General error: 0x01 (FAILURE) - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT && DRLK.S.F00 && DRLK.S.A0030 - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: - "Step 10d: Wait for PIXIT.DRLK.UserCodeTemporaryDisableTime.TH then - sends an Unlock Door Command from User1 to the DUT with the valid - PINCode." - verification: | - ./chip-tool doorlock read user-code-temporary-disable-time 1 1 - - Verify "UserCodeTemporaryDisable" on the TH(Chip-tool) Log: - - [1661767967.006958][131055:131060] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0101 Attribute 0x0000_0031 DataVersion: 683420143 - [1661767967.006988][131055:131060] CHIP:TOO: UserCodeTemporaryDisableTime: 10 - - ./chip-tool doorlock unlock-door 1 1 --timedInteractionTimeoutMs 1000 --PINCode 123456 - - Verify " DUT sends success response" on the TH(Chip-tool) Log: - - [1659517972.769737][33910:33915] CHIP:DMG: - [1659517972.769774][33910:33915] CHIP:DMG: StatusIB = - [1659517972.769815][33910:33915] CHIP:DMG: { - [1659517972.769856][33910:33915] CHIP:DMG: status = 0x00 (SUCCESS), - [1659517972.769899][33910:33915] CHIP:DMG: }, - [1659517972.769939][33910:33915] CHIP:DMG: - [1659517972.769974][33910:33915] CHIP:DMG: }, - [1659517972.770015][33910:33915] CHIP:DMG: - [1659517972.770045][33910:33915] CHIP:DMG: }, - [1659517972.770080][33910:33915] CHIP:DMG: - [1659517972.770109][33910:33915] CHIP:DMG: ], - [1659517972.770144][33910:33915] CHIP:DMG: - [1659517972.770172][33910:33915] CHIP:DMG: InteractionModelRevision = 1 - [1659517972.770200][33910:33915] CHIP:DMG: }, - [1659517972.770267][33910:33915] CHIP:DMG: Received Command Response Status for Endpoint=1 Cluster=0x0000_0101 Command=0x0000_0001 Status=0x0 - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT && DRLK.S.A0030 - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: - "Step 10e: TH writes WrongCodeEntryLimit attribute value as between 1 - and 255 on the DUT and Verify that the DUT sends Success response" - PICS: ( DRLK.S.F00 || DRLK.S.F01 ) && DRLK.S.A0030.Write - command: "writeAttribute" - attribute: "WrongCodeEntryLimit" - arguments: - value: 3 - - - label: - "Step 10e: TH writes WrongCodeEntryLimit attribute value as between 1 - and 255 on the DUT and verify DUT responds with UNSUPPORTED_WRITE" - PICS: ( DRLK.S.F00 || DRLK.S.F01 ) && !DRLK.S.A0030.Write - command: "writeAttribute" - attribute: "WrongCodeEntryLimit" - arguments: - value: 3 - response: - error: UNSUPPORTED_WRITE - - - label: - "Step 11a: TH reads the UserCodeTemporaryDisableTime attribute from - the DUT" - PICS: DRLK.S.A0031 - command: "readAttribute" - attribute: "UserCodeTemporaryDisableTime" - response: - constraints: - minValue: 1 - maxValue: 255 - - - label: - "Step 12a: TH writes UserCodeTemporaryDisableTime attribute value as - between 1 and 255 on the DUT and Verify that the DUT sends Success - response" - PICS: ( DRLK.S.F00 || DRLK.S.F01 ) && DRLK.S.A0031.Write - command: "writeAttribute" - attribute: "UserCodeTemporaryDisableTime" - arguments: - value: 15 - - - label: - "Step 12a: TH writes UserCodeTemporaryDisableTime attribute value as - between 1 and 255 on the DUT and verify DUT responds with - UNSUPPORTED_WRITE" - PICS: ( DRLK.S.F00 || DRLK.S.F01 ) && !DRLK.S.A0031.Write - command: "writeAttribute" - attribute: "UserCodeTemporaryDisableTime" - arguments: - value: 15 - response: - error: UNSUPPORTED_WRITE - - - label: "Clean the created user" - PICS: DRLK.S.F00 && DRLK.S.F07 - command: "ClearUser" - timedInteractionTimeoutMs: 1000 - arguments: - values: - - name: "UserIndex" - value: 1 - - - label: "Cleanup the created credential" - PICS: DRLK.S.F00 && DRLK.S.F07 && DRLK.S.C26.Rsp - command: "ClearCredential" - timedInteractionTimeoutMs: 1000 - arguments: - values: - - name: "Credential" - value: { CredentialType: 1, CredentialIndex: 1 } diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_3.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_3.yaml deleted file mode 100644 index 65ec938b819295..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_3.yaml +++ /dev/null @@ -1,554 +0,0 @@ -# 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.3. [TC-DRLK-2.3] Verification for Unlock Door command [DUT-Server] - -PICS: - - DRLK.S - -config: - nodeId: 0x12344321 - cluster: "Door Lock" - endpoint: 1 - timeout: 200 - requirePINIsTrue: - type: BOOLEAN - defaultValue: false - -tests: - - label: "Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Precondition: Create new user" - PICS: DRLK.S.F00 && DRLK.S.F07 - command: "SetUser" - timedInteractionTimeoutMs: 1000 - 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: "Precondition: Read the user back and verify its fields" - PICS: DRLK.S.F00 && DRLK.S.F07 - 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: [] - - name: "CreatorFabricIndex" - value: 1 - - name: "LastModifiedFabricIndex" - value: 1 - - name: "NextUserIndex" - value: null - - - label: "Precondition: Create new PIN credential and lock/unlock user" - PICS: DRLK.S.F00 && DRLK.S.F07 - command: "SetCredential" - timedInteractionTimeoutMs: 1000 - 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: "Precondition: Verify created PIN credential" - PICS: DRLK.S.F00 && DRLK.S.F07 - command: "GetCredentialStatus" - arguments: - values: - - name: "Credential" - value: { CredentialType: 1, CredentialIndex: 1 } - response: - values: - - name: "CredentialExists" - value: true - - name: "UserIndex" - value: 1 - - name: "CreatorFabricIndex" - value: 1 - - name: "LastModifiedFabricIndex" - value: 1 - - name: "NextCredentialIndex" - value: null - - - label: - "Step 1: TH writes the RequirePINforRemoteOperation attribute value as - False on the DUT" - PICS: DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033.Write - command: "writeAttribute" - attribute: "RequirePINforRemoteOperation" - arguments: - value: false - - - label: - "Step 1: TH writes the RequirePINforRemoteOperation attribute value as - False on the DUT" - PICS: DRLK.S.F07 && DRLK.S.F00 && !DRLK.S.A0033.Write - command: "writeAttribute" - attribute: "RequirePINforRemoteOperation" - arguments: - value: false - response: - error: UNSUPPORTED_WRITE - - - label: - "Step 2: TH reads the RequirePINforRemoteOperation attribute from the - DUT" - PICS: DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033 - command: "readAttribute" - attribute: "RequirePINforRemoteOperation" - response: - saveAs: requirePINIsTrue - constraints: - type: boolean - minValue: 0 - maxValue: 1 - - - label: - "Step 2a: TH verifies the RequirePINforRemoteOperation attribute value - is now False on the DUT" - PICS: DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033.Write - cluster: "EqualityCommands" - command: "BooleanEquals" - arguments: - values: - - name: "Value1" - value: requirePINIsTrue - - name: "Value2" - value: false - response: - - values: - - name: "Equals" - value: true - - - label: "Step 2b: Compute RequirePINforRemoteOperation" - cluster: "EqualityCommands" - command: "BooleanEquals" - arguments: - values: - - name: "Value1" - value: requirePINIsTrue - - name: "Value2" - value: false - response: - - values: - - name: "Equals" - saveAs: requirePINIsFalse - constraints: - type: boolean - minValue: 0 - maxValue: 1 - - - label: - "Step 3: TH sends the unlock Door command to the DUT without PINCode" - runIf: requirePINIsFalse - PICS: DRLK.S.C01.Rsp - command: "UnlockDoor" - timedInteractionTimeoutMs: 1000 - - - label: - "Step 3: TH sends the unlock Door command to the DUT without PINCode" - runIf: requirePINIsTrue - PICS: DRLK.S.C01.Rsp - command: "UnlockDoor" - timedInteractionTimeoutMs: 1000 - response: - error: FAILURE - - - label: - "Step 4: TH sends the unlock Door command to the DUT with valid - PINCode" - PICS: DRLK.S.C01.Rsp - command: "UnlockDoor" - timedInteractionTimeoutMs: 1000 - arguments: - values: - - name: "PINCode" - value: "123456" - - - label: - "Step 5: TH writes the RequirePINforRemoteOperation attribute value as - true on the DUT" - PICS: DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033.Write - command: "writeAttribute" - attribute: "RequirePINforRemoteOperation" - arguments: - value: true - - - label: - "Step 5: TH writes the RequirePINforRemoteOperation attribute value as - true on the DUT" - PICS: DRLK.S.F07 && DRLK.S.F00 && !DRLK.S.A0033.Write - command: "writeAttribute" - attribute: "RequirePINforRemoteOperation" - arguments: - value: true - response: - error: UNSUPPORTED_WRITE - - - label: - "Step 6: TH reads the RequirePINforRemoteOperation attribute from the - DUT" - PICS: DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033 - command: "readAttribute" - attribute: "RequirePINforRemoteOperation" - response: - saveAs: requirePINIsTrue - constraints: - type: boolean - minValue: 0 - maxValue: 1 - - - label: - "Step 6a: TH verifies the RequirePINforRemoteOperation attribute value - is now True on the DUT" - PICS: DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033.Write - cluster: "EqualityCommands" - command: "BooleanEquals" - arguments: - values: - - name: "Value1" - value: requirePINIsTrue - - name: "Value2" - value: true - response: - - values: - - name: "Equals" - value: true - - - label: "Step 6b: Compute RequirePINforRemoteOperation" - cluster: "EqualityCommands" - command: "BooleanEquals" - arguments: - values: - - name: "Value1" - value: requirePINIsTrue - - name: "Value2" - value: false - response: - - values: - - name: "Equals" - saveAs: requirePINIsFalse - constraints: - type: boolean - minValue: 0 - maxValue: 1 - - - label: - "Step 7: TH sends the unlock Door command to the DUT with invalid - PINCode" - PICS: DRLK.S.F00 && DRLK.S.C01.Rsp && DRLK.S.A0033 - command: "UnlockDoor" - timedInteractionTimeoutMs: 1000 - arguments: - values: - - name: "PINCode" - value: "1234568" - response: - error: FAILURE - - - label: - "Step 8: TH sends the unlock Door command to the DUT without PINCode" - runIf: requirePINIsTrue - PICS: DRLK.S.F00 && DRLK.S.C01.Rsp && DRLK.S.A0033 - command: "UnlockDoor" - timedInteractionTimeoutMs: 1000 - response: - error: FAILURE - - - label: - "Step 8: TH sends the unlock Door command to the DUT without PINCode" - runIf: requirePINIsFalse - PICS: DRLK.S.F00 && DRLK.S.C01.Rsp && DRLK.S.A0033 - command: "UnlockDoor" - timedInteractionTimeoutMs: 1000 - - - label: - "Step 9: TH sends the unlock Door command to the DUT with valid - PINCode" - PICS: DRLK.S.C01.Rsp && DRLK.S.A0033 - command: "UnlockDoor" - timedInteractionTimeoutMs: 1000 - arguments: - values: - - name: "PINCode" - value: "123456" - - - label: - "Step 10: TH writes WrongCodeEntryLimit attribute value as 3 on the - DUT" - PICS: ( DRLK.S.F00 || DRLK.S.F01 ) && DRLK.S.A0030.Write - command: "writeAttribute" - attribute: "WrongCodeEntryLimit" - arguments: - value: 3 - - - label: - "Step 10: TH writes WrongCodeEntryLimit attribute value as 3 on the - DUT" - PICS: ( DRLK.S.F00 || DRLK.S.F01 ) && !DRLK.S.A0030.Write - command: "writeAttribute" - attribute: "WrongCodeEntryLimit" - arguments: - value: 3 - response: - error: UNSUPPORTED_WRITE - - - label: - "Step 11: TH writes UserCodeTemporaryDisableTime attribute value as 15 - Seconds on the DUT and Verify that the DUT sends Success response" - PICS: ( DRLK.S.F00 || DRLK.S.F01 ) && DRLK.S.A0031.Write - command: "writeAttribute" - attribute: "UserCodeTemporaryDisableTime" - arguments: - value: 15 - - - label: - "Step 11: TH writes UserCodeTemporaryDisableTime attribute value as 15 - Seconds on the DUT and Verify that the DUT sends Success response" - PICS: ( DRLK.S.F00 || DRLK.S.F01 ) && !DRLK.S.A0031.Write - command: "writeAttribute" - attribute: "UserCodeTemporaryDisableTime" - arguments: - value: 15 - response: - error: UNSUPPORTED_WRITE - - - label: - "Step 12a: TH sends the unlock Door command to the DUT with invalid - PINCode" - PICS: DRLK.S.F00 && DRLK.S.C01.Rsp - command: "UnlockDoor" - timedInteractionTimeoutMs: 1000 - arguments: - values: - - name: "PINCode" - value: "1234568" - response: - error: FAILURE - - - label: - "Step 12b: TH sends the unlock Door command to the DUT with invalid - PINCode" - PICS: DRLK.S.F00 && DRLK.S.C01.Rsp - command: "UnlockDoor" - timedInteractionTimeoutMs: 1000 - arguments: - values: - - name: "PINCode" - value: "1234568" - response: - error: FAILURE - - - label: - "Step 12c: TH sends the unlock Door command to the DUT with invalid - PINCode" - PICS: DRLK.S.F00 && DRLK.S.C01.Rsp - command: "UnlockDoor" - timedInteractionTimeoutMs: 1000 - arguments: - values: - - name: "PINCode" - value: "1234568" - response: - error: FAILURE - - - label: - "Step 13: TH reads UserCodedTemporaryDisableTime attribute from DUT" - PICS: ( DRLK.S.F00 || DRLK.S.F01 ) && DRLK.S.A0031 - command: "readAttribute" - attribute: "UserCodeTemporaryDisableTime" - response: - value: 15 - - - label: - "Step 14: TH sends the unlock Door command to the DUT with valid - PINCode" - PICS: DRLK.S.F00 && DRLK.S.C01.Rsp - command: "UnlockDoor" - timedInteractionTimeoutMs: 1000 - arguments: - values: - - name: "PINCode" - value: "123456" - response: - error: FAILURE - - - label: "Wait for UserCodeTemporaryDisableTime expires" - cluster: "DelayCommands" - command: "WaitForMs" - PICS: ( DRLK.S.F00 || DRLK.S.F01 ) && DRLK.S.A0031 - arguments: - values: - - name: "ms" - value: 15000 - - - label: - "Step 15a: TH writes AutoRelockTime attribute value as 10 seconds on - the DUT" - PICS: DRLK.S.A0023.Write && PICS_SDK_CI_ONLY - command: "writeAttribute" - attribute: "AutoRelockTime" - arguments: - value: 10 - - - label: - "Step 15b: TH writes AutoRelockTime attribute value as 60 seconds on - the DUT" - PICS: DRLK.S.A0023.Write && PICS_SKIP_SAMPLE_APP - command: "writeAttribute" - attribute: "AutoRelockTime" - arguments: - value: 60 - - - label: - "Step 15c: TH writes AutoRelockTime attribute value as 10 seconds on - the DUT" - PICS: " !DRLK.S.A0023.Write && PICS_SDK_CI_ONLY " - command: "writeAttribute" - attribute: "AutoRelockTime" - arguments: - value: 10 - response: - error: UNSUPPORTED_WRITE - - - label: - "Step 15d: TH writes AutoRelockTime attribute value as 60 seconds on - the DUT" - PICS: " !DRLK.S.A0023.Write && PICS_SKIP_SAMPLE_APP " - command: "writeAttribute" - attribute: "AutoRelockTime" - arguments: - value: 60 - response: - error: UNSUPPORTED_WRITE - - - label: "Step 16a: TH reads the AutoRelockTime attribute from the DUT" - PICS: DRLK.S.A0023 && PICS_SDK_CI_ONLY - command: "readAttribute" - attribute: "AutoRelockTime" - response: - value: 10 - - - label: "Step 16b: TH reads the AutoRelockTime attribute from the DUT" - PICS: DRLK.S.A0023 && PICS_SKIP_SAMPLE_APP - command: "readAttribute" - attribute: "AutoRelockTime" - response: - value: 60 - - - label: - "Step 17: TH sends the unlock Door command to the DUT with valid - PINCode and Verify that DUT sends SUCCESS response to the TH" - PICS: DRLK.S.C01.Rsp - command: "UnlockDoor" - timedInteractionTimeoutMs: 1000 - arguments: - values: - - name: "PINCode" - value: "123456" - - - label: "Wait for AutoRelockTime Expires" - cluster: "DelayCommands" - command: "WaitForMs" - PICS: DRLK.S.A0023 && PICS_SDK_CI_ONLY - arguments: - values: - - name: "ms" - value: 10000 - - - label: "Wait for AutoRelockTime Expires" - cluster: "DelayCommands" - command: "WaitForMs" - PICS: DRLK.S.A0023 && PICS_SKIP_SAMPLE_APP - arguments: - values: - - name: "ms" - value: 60000 - - - label: "Step 18: TH reads LockState attribute" - PICS: DRLK.S.A0000 && DRLK.S.C01.Rsp - command: "readAttribute" - attribute: "LockState" - response: - value: 1 - - - label: "Cleanup the created user" - PICS: DRLK.S.F00 && DRLK.S.F07 - command: "ClearUser" - timedInteractionTimeoutMs: 1000 - arguments: - values: - - name: "UserIndex" - value: 1 - - - label: "Clean the created credential" - PICS: DRLK.S.F00 && DRLK.S.F07 && DRLK.S.C26.Rsp - command: "ClearCredential" - timedInteractionTimeoutMs: 1000 - arguments: - values: - - name: "Credential" - value: { CredentialType: 1, CredentialIndex: 1 } diff --git a/src/python_testing/TC_DRLK_2_12.py b/src/python_testing/TC_DRLK_2_12.py new file mode 100644 index 00000000000000..a0b4f7909158ff --- /dev/null +++ b/src/python_testing/TC_DRLK_2_12.py @@ -0,0 +1,47 @@ +# +# Copyright (c) 2023 Project CHIP Authors +# All rights reserved. +# +# 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. +# + +from drlk_2_x_common import DRLK_COMMON +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main + +# Configurable parameters: +# - CredentialIndex: CredentialIndex to use when creating a Credential on the DUT for testing purposes +# defaults to 1. Add `--int-arg credential_index:` to command line to override +# - UserCodeTemporaryDisableTime: Value used to configure DUT for testing purposes. +# defaults to 15 seconds. Add `--int-arg user_code_temporary_disable_time:` to command line to override +# - WrongCodeEntryLimit: Value used to configure DUT for testing purposes. +# defaults to 3 attempts. Add `--int-arg wrong_code_entry_limit:` to command line to override +# - AutoRelockTime: Value used to configure DUT for testing purposes. +# defaults to 60 seconds. Add `--int-arg auto_relock_time:` to command line to override + + +class TC_DRLK_2_12(MatterBaseTest, DRLK_COMMON): + def setup_class(self): + return super().setup_class() + + @async_test_body + async def teardown_test(self): + await self.teardown() + return super().teardown_test() + + @async_test_body + async def test_TC_DRLK_2_12(self): + await self.run_drlk_test_2_12() + + +if __name__ == "__main__": + default_matter_test_main() diff --git a/src/python_testing/TC_DRLK_2_2.py b/src/python_testing/TC_DRLK_2_2.py new file mode 100644 index 00000000000000..787e8c37b93dc2 --- /dev/null +++ b/src/python_testing/TC_DRLK_2_2.py @@ -0,0 +1,47 @@ +# +# Copyright (c) 2023 Project CHIP Authors +# All rights reserved. +# +# 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. +# + +from drlk_2_x_common import DRLK_COMMON +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main + +# Configurable parameters: +# - CredentialIndex: CredentialIndex to use when creating a Credential on the DUT for testing purposes +# defaults to 1. Add `--int-arg credential_index:` to command line to override +# - UserCodeTemporaryDisableTime: Value used to configure DUT for testing purposes. +# defaults to 15 seconds. Add `--int-arg user_code_temporary_disable_time:` to command line to override +# - WrongCodeEntryLimit: Value used to configure DUT for testing purposes. +# defaults to 3 attempts. Add `--int-arg wrong_code_entry_limit:` to command line to override +# - AutoRelockTime: Value used to configure DUT for testing purposes. +# defaults to 60 seconds. Add `--int-arg auto_relock_time:` to command line to override + + +class TC_DRLK_2_2(MatterBaseTest, DRLK_COMMON): + def setup_class(self): + return super().setup_class() + + @async_test_body + async def teardown_test(self): + await self.teardown() + return super().teardown_test() + + @async_test_body + async def test_TC_DRLK_2_2(self): + await self.run_drlk_test_2_2() + + +if __name__ == "__main__": + default_matter_test_main() diff --git a/src/python_testing/TC_DRLK_2_3.py b/src/python_testing/TC_DRLK_2_3.py new file mode 100644 index 00000000000000..b114171ddd0457 --- /dev/null +++ b/src/python_testing/TC_DRLK_2_3.py @@ -0,0 +1,47 @@ +# +# Copyright (c) 2023 Project CHIP Authors +# All rights reserved. +# +# 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. +# + +from drlk_2_x_common import DRLK_COMMON +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main + +# Configurable parameters: +# - CredentialIndex: CredentialIndex to use when creating a Credential on the DUT for testing purposes +# defaults to 1. Add `--int-arg credential_index:` to command line to override +# - UserCodeTemporaryDisableTime: Value used to configure DUT for testing purposes. +# defaults to 15 seconds. Add `--int-arg user_code_temporary_disable_time:` to command line to override +# - WrongCodeEntryLimit: Value used to configure DUT for testing purposes. +# defaults to 3 attempts. Add `--int-arg wrong_code_entry_limit:` to command line to override +# - AutoRelockTime: Value used to configure DUT for testing purposes. +# defaults to 60 seconds. Add `--int-arg auto_relock_time:` to command line to override + + +class TC_DRLK_2_3(MatterBaseTest, DRLK_COMMON): + def setup_class(self): + return super().setup_class() + + @async_test_body + async def teardown_test(self): + await self.teardown() + return super().teardown_test() + + @async_test_body + async def test_TC_DRLK_2_3(self): + await self.run_drlk_test_2_3() + + +if __name__ == "__main__": + default_matter_test_main() diff --git a/src/python_testing/drlk_2_x_common.py b/src/python_testing/drlk_2_x_common.py new file mode 100644 index 00000000000000..bdc52cce1afd62 --- /dev/null +++ b/src/python_testing/drlk_2_x_common.py @@ -0,0 +1,309 @@ +# +# Copyright (c) 2023 Project CHIP Authors +# All rights reserved. +# +# 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. +# + +import logging +import random +import string +import time + +import chip.clusters as Clusters +from chip.clusters.Types import NullValue +from chip.interaction_model import InteractionModelError, Status +from matter_testing_support import type_matches +from mobly import asserts + + +class DRLK_COMMON: + async def read_drlk_attribute_expect_success(self, attribute): + cluster = Clusters.Objects.DoorLock + return await self.read_single_attribute_check_success(endpoint=self.endpoint, cluster=cluster, attribute=attribute) + + async def write_drlk_attribute_expect_success(self, attribute): + cluster = Clusters.Objects.DoorLock + result = await self.default_controller.WriteAttribute(self.dut_node_id, [(self.endpoint, attribute)]) + err_msg = "Received error status {} when writing {}:{}".format(str(result[0].Status), str(cluster), str(attribute)) + asserts.assert_equal(result[0].Status, Status.Success, err_msg) + + async def write_drlk_attribute_expect_error(self, attribute, error): + cluster = Clusters.Objects.DoorLock + result = await self.default_controller.WriteAttribute(self.dut_node_id, [(self.endpoint, attribute)]) + err_msg = "Did not see expected error {} when writing {}:{}".format(str(error), str(cluster), str(attribute)) + asserts.assert_equal(result[0].Status, error, err_msg) + + async def send_drlk_cmd_expect_success(self, command) -> None: + await self.send_single_cmd(cmd=command, endpoint=self.endpoint, timedRequestTimeoutMs=1000) + + async def send_drlk_cmd_expect_error(self, command, error: Status) -> None: + try: + await self.send_single_cmd(cmd=command, endpoint=self.endpoint, timedRequestTimeoutMs=1000) + asserts.assert_true(False, "Unexpected command success, command=%s", command) + except InteractionModelError as e: + asserts.assert_equal(e.status, error, "Unexpected error returned") + pass + + async def send_set_credential_cmd(self, operationType, credential, credentialData, userIndex, userStatus, userType) -> Clusters.Objects.DoorLock.Commands.SetCredentialResponse: + ret = await self.send_single_cmd(cmd=Clusters.Objects.DoorLock.Commands.SetCredential(operationType=operationType, + credential=credential, + credentialData=credentialData, + userIndex=userIndex, + userStatus=userStatus, + userType=userType), + endpoint=self.endpoint, + timedRequestTimeoutMs=1000) + asserts.assert_true(type_matches(ret, Clusters.Objects.DoorLock.Commands.SetCredentialResponse), + "Unexpected return type for SetCredential") + asserts.assert_true(ret.status == Status.Success, "Error sending SetCredential command, status={}".format(str(ret.status))) + return ret + + async def send_clear_credential_cmd(self, credential) -> None: + await self.send_single_cmd(cmd=Clusters.Objects.DoorLock.Commands.ClearCredential(credential=credential), + endpoint=self.endpoint, + timedRequestTimeoutMs=1000) + ret = await self.send_single_cmd(cmd=Clusters.Objects.DoorLock.Commands.GetCredentialStatus(credential=self.createdCredential), + endpoint=self.endpoint) + asserts.assert_true(type_matches(ret, Clusters.Objects.DoorLock.Commands.GetCredentialStatusResponse), + "Unexpected return type for GetCredentialStatus") + asserts.assert_false(ret.credentialExists, "Error clearing Credential (credentialExists==True)") + + async def cleanup_users_and_credentials(self): + self.print_step("Cleanup", "Clear created User and Credential on the DUT") + if self.createdCredential: + await self.send_clear_credential_cmd(self.createdCredential) + logging.info("Credential cleared at CredentialIndex %d" % (self.createdCredential.credentialIndex)) + self.createdCredential = None + + async def generate_pincode(self, maxPincodeLength): + return ''.join(random.choices(string.digits, k=maxPincodeLength)) + + async def teardown(self): + await self.cleanup_users_and_credentials() + + async def run_drlk_test_common(self, lockUnlockCommand, lockUnlockCmdRspPICS, lockUnlockText, doAutoRelockTest): + is_ci = self.check_pics('PICS_SDK_CI_ONLY') + + self.createdCredential = None + + self.endpoint = self.user_params.get("endpoint", 1) + + # Allow for user overrides of these values + credentialIndex = self.user_params.get("credential_index", 1) + userCodeTemporaryDisableTime = self.user_params.get("user_code_temporary_disable_time", 15) + wrongCodeEntryLimit = self.user_params.get("wrong_code_entry_limit", 3) + autoRelockTime = self.user_params.get("auto_relock_time", 60) + if is_ci: + autoRelockTime = 10 + + cluster = Clusters.Objects.DoorLock + attributes = Clusters.DoorLock.Attributes + + validPincode = None + invalidPincode = None + + self.print_step(0, "Commissioning, already done") + + if self.check_pics("DRLK.S.F00") and self.check_pics("DRLK.S.F07"): + self.print_step("Preconditions.1a", + "TH reads MaxPINCodeLength attribute from DUT and generates a valid PINCode") + maxPincodeLength_dut = await self.read_drlk_attribute_expect_success(attribute=attributes.MaxPINCodeLength) + logging.info("MaxPINCodeLength value is %s" % (maxPincodeLength_dut)) + + validPincodeString = await self.generate_pincode(maxPincodeLength_dut) + while True: + invalidPincodeString = await self.generate_pincode(maxPincodeLength_dut) + if invalidPincodeString != validPincodeString: + break + logging.info("Valid PinCode=%s, Invalid PinCode=%s" % (validPincodeString, invalidPincodeString)) + + validPincode = bytes(validPincodeString, 'ascii') + invalidPincode = bytes(invalidPincodeString, 'ascii') + + self.print_step("Preconditions.1b", + "TH sends SetCredential command to DUT to set up User and Credential at CredentialIndex {}".format(str(credentialIndex))) + credential = cluster.Structs.CredentialStruct(credentialIndex=credentialIndex, + credentialType=Clusters.DoorLock.Enums.CredentialTypeEnum.kPin) + ret = await self.send_set_credential_cmd(Clusters.DoorLock.Enums.DataOperationTypeEnum.kAdd, + credential, + validPincode, + NullValue, + NullValue, + NullValue) + logging.info("Credential created at CredentialIndex %d, UserIndex %d." % (credentialIndex, ret.userIndex)) + self.createdCredential = credential + + if self.check_pics("DRLK.S.F00") and self.check_pics("DRLK.S.F07"): + requirePinForRemoteOperation_dut = False + self.print_step("1", "TH writes the RequirePINforRemoteOperation attribute value as false on the DUT") + attribute = attributes.RequirePINforRemoteOperation(False) + if self.check_pics("DRLK.S.A0033.Write"): + await self.write_drlk_attribute_expect_success(attribute=attribute) + else: + await self.write_drlk_attribute_expect_error(attribute=attribute, error=Status.UnsupportedWrite) + + if self.check_pics("DRLK.S.A0033"): + self.print_step("2", "TH reads and saves the value of the RequirePINforRemoteOperation attribute from the DUT") + requirePinForRemoteOperation_dut = await self.read_drlk_attribute_expect_success(attribute=attributes.RequirePINforRemoteOperation) + logging.info("Current RequirePINforRemoteOperation value is %s" % (requirePinForRemoteOperation_dut)) + + if self.check_pics("DRLK.S.A0033.Write"): + self.print_step("2a", "TH verifies that RequirePINforRemoteOperation is FALSE") + asserts.assert_false(requirePinForRemoteOperation_dut, "RequirePINforRemoteOperation is expected to be FALSE") + else: + asserts.assert_true( + False, "RequirePINforRemoteOperation is a mandatory attribute if DRLK.S.F07(COTA) & DRLK.S.F00(PIN)") + + if self.check_pics(lockUnlockCmdRspPICS): + self.print_step("3", "TH sends %s Command to the DUT without PINCode" % lockUnlockText) + command = lockUnlockCommand(PINCode=None) + if requirePinForRemoteOperation_dut: + await self.send_drlk_cmd_expect_error(command=command, error=Status.Failure) + else: + await self.send_drlk_cmd_expect_success(command=command) + + self.print_step("4", "TH sends %s Command to the DUT with valid PINCode" % lockUnlockText) + command = lockUnlockCommand(PINCode=validPincode) + await self.send_drlk_cmd_expect_success(command=command) + else: + asserts.assert_true(False, "%sResponse is a mandatory command response and must be supported in PICS" % lockUnlockText) + + if self.check_pics("DRLK.S.F00") and self.check_pics("DRLK.S.F07"): + self.print_step("5", "TH writes the RequirePINforRemoteOperation attribute value as true on the DUT") + attribute = attributes.RequirePINforRemoteOperation(True) + if self.check_pics("DRLK.S.A0033.Write"): + await self.write_drlk_attribute_expect_success(attribute=attribute) + else: + await self.write_drlk_attribute_expect_error(attribute=attribute, error=Status.UnsupportedWrite) + + if self.check_pics("DRLK.S.A0033"): + self.print_step("6", "TH reads and saves the value of the RequirePINforRemoteOperation attribute from the DUT") + requirePinForRemoteOperation_dut = await self.read_drlk_attribute_expect_success(attribute=attributes.RequirePINforRemoteOperation) + logging.info("Current RequirePINforRemoteOperation value is %s" % (requirePinForRemoteOperation_dut)) + + if self.check_pics("DRLK.S.A0033.Write"): + self.print_step("6a", "TH verifies that RequirePINforRemoteOperation is TRUE") + asserts.assert_true(requirePinForRemoteOperation_dut, "RequirePINforRemoteOperation is expected to be TRUE") + + if self.check_pics("DRLK.S.F00") and self.check_pics(lockUnlockCmdRspPICS) and self.check_pics("DRLK.S.A0033"): + self.print_step("7", "TH sends %s Command to the DUT with an invalid PINCode" % lockUnlockText) + command = lockUnlockCommand(PINCode=invalidPincode) + await self.send_drlk_cmd_expect_error(command=command, error=Status.Failure) + + self.print_step("8", "TH sends %s Command to the DUT without PINCode" % lockUnlockText) + command = lockUnlockCommand(PINCode=None) + if requirePinForRemoteOperation_dut: + await self.send_drlk_cmd_expect_error(command=command, error=Status.Failure) + else: + await self.send_drlk_cmd_expect_success(command=command) + + if self.check_pics(lockUnlockCmdRspPICS) and self.check_pics("DRLK.S.A0033"): + self.print_step("9", "TH sends %s Command to the DUT with valid PINCode" % lockUnlockText) + command = lockUnlockCommand(PINCode=validPincode) + await self.send_drlk_cmd_expect_success(command=command) + + if self.check_pics("DRLK.S.F00") or self.check_pics("DRLK.S.F01"): + self.print_step("10a", "TH writes the WrongCodeEntryLimit to any value between 1 and 255") + attribute = attributes.WrongCodeEntryLimit(wrongCodeEntryLimit) + if self.check_pics("DRLK.S.A0030.Write"): + await self.write_drlk_attribute_expect_success(attribute=attribute) + else: + await self.write_drlk_attribute_expect_error(attribute=attribute, error=Status.UnsupportedWrite) + + self.print_step("10b", "TH reads the value of WrongCodeEntryLimit attribute. Verify a range of 1-255") + wrongCodeEntryLimit_dut = await self.read_drlk_attribute_expect_success(attribute=attributes.WrongCodeEntryLimit) + logging.info("WrongCodeEntryLimit value is %s" % (wrongCodeEntryLimit_dut)) + asserts.assert_in(wrongCodeEntryLimit_dut, range(1, 255), "WrongCodeEntryLimit value is out of range") + + self.print_step("11a", "TH writes the UserCodeTemporaryDisableTime to any value between 1 and 255") + attribute = attributes.UserCodeTemporaryDisableTime(userCodeTemporaryDisableTime) + if self.check_pics("DRLK.S.A0031.Write"): + await self.write_drlk_attribute_expect_success(attribute=attribute) + else: + await self.write_drlk_attribute_expect_error(attribute=attribute, error=Status.UnsupportedWrite) + + self.print_step("11b", "TH reads the value of UserCodeTemporaryDisableTime attribute. Verify a range of 1-255") + userCodeTemporaryDisableTime_dut = await self.read_drlk_attribute_expect_success(attribute=attributes.UserCodeTemporaryDisableTime) + logging.info("UserCodeTemporaryDisableTime value is %s" % (userCodeTemporaryDisableTime_dut)) + asserts.assert_in(userCodeTemporaryDisableTime_dut, range(1, 255), "UserCodeTemporaryDisableTime value is out of range") + + if self.check_pics(lockUnlockCmdRspPICS) and self.check_pics("DRLK.S.F00"): + self.print_step("12", "TH sends {} Command to the DUT with an invalid PINCode, repeated {} times".format( + lockUnlockText, wrongCodeEntryLimit_dut)) + for i in range(wrongCodeEntryLimit_dut): + command = lockUnlockCommand(PINCode=invalidPincode) + await self.send_drlk_cmd_expect_error(command=command, error=Status.Failure) + + self.print_step("13", "TH sends %s Command to the DUT with valid PINCode. Verify failure or no response" % lockUnlockText) + command = lockUnlockCommand(PINCode=validPincode) + await self.send_drlk_cmd_expect_error(command=command, error=Status.Failure) + + if self.check_pics("DRLK.S.A0031"): + self.print_step("14", "Wait for UserCodeTemporaryDisableTime seconds") + time.sleep(userCodeTemporaryDisableTime_dut) + + if not doAutoRelockTest: + self.print_step("15", "Send %s with valid Pincode and verify success" % lockUnlockText) + command = lockUnlockCommand(PINCode=validPincode) + await self.send_drlk_cmd_expect_success(command=command) + + if doAutoRelockTest: + if self.check_pics("DRLK.S.A0023"): + self.print_step("15", "TH writes the AutoRelockTime attribute value on the DUT") + attribute = attributes.AutoRelockTime(autoRelockTime) + if self.check_pics("DRLK.S.A0023.Write"): + await self.write_drlk_attribute_expect_success(attribute=attribute) + else: + await self.write_drlk_attribute_expect_error(attribute=attribute, error=Status.UnsupportedWrite) + + self.print_step("16", "TH reads the value of AutoRelockTime attribute.") + autoRelockTime_dut = await self.read_drlk_attribute_expect_success(attribute=attributes.AutoRelockTime) + logging.info("AutoRelockTime value is %s" % (autoRelockTime_dut)) + + if self.check_pics(lockUnlockCmdRspPICS): + self.print_step("17", "Send %s with valid Pincode and verify success" % lockUnlockText) + command = lockUnlockCommand(PINCode=validPincode) + await self.send_drlk_cmd_expect_success(command=command) + + if self.check_pics("DRLK.S.A0023"): + self.print_step("18a", "Wait for AutoRelockTime seconds") + # Add additional wait time buffer for motor movement, etc. + time.sleep(autoRelockTime_dut + 5) + + if self.check_pics("DRLK.S.A0000"): + self.print_step("18b", "TH reads LockState attribute after AutoRelockTime Expires") + lockstate_dut = await self.read_drlk_attribute_expect_success(attribute=attributes.LockState) + logging.info("Current LockState is %s" % (lockstate_dut)) + asserts.assert_equal(lockstate_dut, Clusters.DoorLock.Enums.DlLockState.kLocked, + "LockState expected to be value==Locked") + + await self.cleanup_users_and_credentials() + + async def run_drlk_test_2_2(self): + await self.run_drlk_test_common(lockUnlockCommand=Clusters.Objects.DoorLock.Commands.LockDoor, + lockUnlockCmdRspPICS="DRLK.S.C00.Rsp", + lockUnlockText="LockDoor", + doAutoRelockTest=False) + + async def run_drlk_test_2_3(self): + await self.run_drlk_test_common(lockUnlockCommand=Clusters.Objects.DoorLock.Commands.UnlockDoor, + lockUnlockCmdRspPICS="DRLK.S.C01.Rsp", + lockUnlockText="UnlockDoor", + doAutoRelockTest=True) + + async def run_drlk_test_2_12(self): + await self.run_drlk_test_common(lockUnlockCommand=Clusters.Objects.DoorLock.Commands.UnboltDoor, + lockUnlockCmdRspPICS="DRLK.S.C27.Rsp", + lockUnlockText="UnboltDoor", + doAutoRelockTest=True)