From 4e175143a65dfd75541cea0bb38f97f024bb2cd1 Mon Sep 17 00:00:00 2001 From: Jake Ororke Date: Tue, 17 Sep 2024 12:35:09 -0700 Subject: [PATCH 1/3] [Test] Creating TC_CADMIN_1_22 and TC_CADMIN_1_24: - Created CADMIN_1_22 python test module following steps in PR here: - Created CADMIN_1_24 python test module following steps in PR here: - Removed following yaml test modules: -- Test_TC_CADMIN_1_21.yaml, Test_TC_CADMIN_1_22.yaml, Test_TC_CADMIN_1_23.yaml, Test_TC_CADMIN_1_24.yaml --- .../certification/Test_TC_CADMIN_1_21.yaml | 123 ----------- .../certification/Test_TC_CADMIN_1_22.yaml | 199 ------------------ .../certification/Test_TC_CADMIN_1_23.yaml | 124 ----------- .../certification/Test_TC_CADMIN_1_24.yaml | 199 ------------------ src/python_testing/TC_CADMIN_1_22.py | 138 ++++++++++++ src/python_testing/TC_CADMIN_1_24.py | 139 ++++++++++++ 6 files changed, 277 insertions(+), 645 deletions(-) delete mode 100644 src/app/tests/suites/certification/Test_TC_CADMIN_1_21.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_CADMIN_1_22.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_CADMIN_1_23.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_CADMIN_1_24.yaml create mode 100644 src/python_testing/TC_CADMIN_1_22.py create mode 100644 src/python_testing/TC_CADMIN_1_24.py diff --git a/src/app/tests/suites/certification/Test_TC_CADMIN_1_21.yaml b/src/app/tests/suites/certification/Test_TC_CADMIN_1_21.yaml deleted file mode 100644 index f6e7332a9d1f91..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_CADMIN_1_21.yaml +++ /dev/null @@ -1,123 +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: - 30.1.21. [TC-CADMIN-1.21] Open commissioning window - durations max and - max+1 [BCM] [DUT - Commissionee] - -PICS: - - CADMIN.S - - CADMIN.S.F00 - -config: - nodeId: 0x12344321 - timeout: 950 - endpoint: 0 - payload: - type: char_string - defaultValue: "MT:-24J0AFN00KA0648G00" - -tests: - - label: "Precondition: Reset Devices to factory defaults" - PICS: PICS_SDK_CI_ONLY - cluster: "SystemCommands" - command: "FactoryReset" - - - label: "Precondition: Reset Devices to factory defaults" - verification: | - Reset Devices to factory defaults - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_SKIP_SAMPLE_APP - arguments: - values: - - name: "message" - value: "Factory Reset the DUT and enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: "Step 1: TH_CR1 starts a commissioning process with DUT_CE" - cluster: "CommissionerCommands" - command: "PairWithCode" - PICS: CADMIN.S - arguments: - values: - - name: "nodeId" - value: nodeId - - name: "payload" - value: payload - - - label: "Step 1: TH_CR1 commissioned with DUT_CE" - cluster: "DelayCommands" - command: "WaitForCommissionee" - PICS: CADMIN.S - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: - "Step 2: TH_CR1 opens a commissioning window on DUT_CE using BCM with - a value of 900 seconds" - cluster: "Administrator Commissioning" - command: "OpenBasicCommissioningWindow" - timedInteractionTimeoutMs: 10000 - PICS: CADMIN.S.C01.Rsp - arguments: - values: - - name: "CommissioningTimeout" - value: 900 - - - label: "Step 3: Wait 901 seconds for commissioning Window to be closed" - PICS: CADMIN.S.C01.Rsp - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 901000 - - - label: - "Step 4: TH_CR1 reads the window status to verify the DUT_CE window is - closed" - cluster: "Administrator Commissioning" - command: "readAttribute" - attribute: "WindowStatus" - PICS: CADMIN.S.A0000 - response: - value: 0 - - - label: - "Step 5: TH_CR1 opens a commissioning window on DUT_CE using BCM with - a value of 901 seconds" - cluster: "Administrator Commissioning" - command: "OpenBasicCommissioningWindow" - PICS: CADMIN.S.C01.Rsp - timedInteractionTimeoutMs: 10000 - arguments: - values: - - name: "CommissioningTimeout" - value: 901 - response: - error: INVALID_COMMAND - - - label: - "Step 6: TH_CR1 reads the window status to verify the DUT_CE window is - closed" - cluster: "Administrator Commissioning" - command: "readAttribute" - attribute: "WindowStatus" - PICS: CADMIN.S.A0000 - response: - value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_CADMIN_1_22.yaml b/src/app/tests/suites/certification/Test_TC_CADMIN_1_22.yaml deleted file mode 100644 index 4b94b6518a7529..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_CADMIN_1_22.yaml +++ /dev/null @@ -1,199 +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: - 30.1.22. [TC-CADMIN-1.22] Open commissioning window - durations max and - max+1 [ECM] [DUT - Commissionee] - -PICS: - - CADMIN.S - -config: - nodeId: 0x12344321 - timeout: 950 - endpoint: 0 - payload: - type: char_string - defaultValue: "MT:-24J0AFN00KA0648G00" - discriminator: - type: int16u - defaultValue: 3840 - PakeVerifier: - type: octet_string - defaultValue: "hex:b96170aae803346884724fe9a3b287c30330c2a660375d17bb205a8cf1aecb350457f8ab79ee253ab6a8e46bb09e543ae422736de501e3db37d441fe344920d09548e4c18240630c4ff4913c53513839b7c07fcc0627a1b8573a149fcd1fa466cf" - -tests: - - label: "Precondition: Reset Devices to factory defaults" - cluster: "SystemCommands" - PICS: PICS_SDK_CI_ONLY - command: "FactoryReset" - - - label: "Precondition: Reset Devices to factory defaults" - verification: | - Reset Devices to factory defaults - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_SKIP_SAMPLE_APP - arguments: - values: - - name: "message" - value: "Factory Reset the DUT and enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: "Step 1: TH_CR1 starts a commissioning process with DUT_CE" - cluster: "CommissionerCommands" - command: "PairWithCode" - PICS: CADMIN.S - arguments: - values: - - name: "nodeId" - value: nodeId - - name: "payload" - value: payload - - - label: "Step 1: TH_CR1 commissioned with DUT_CE" - cluster: "DelayCommands" - command: "WaitForCommissionee" - PICS: CADMIN.S.C00.Rsp - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: - "Step 2: TH_CR1 opens a commissioning window on DUT_CE using ECM with - a value of 900 seconds" - verification: | - On TH_CR1 - (chip tool), open commissioning window - - ./chip-tool pairing open-commissioning-window 1 1 900 1000 3840 - - Verify Manual pairing code on TH_CR1(chip-tool) Log - - [1635925713.966786][9695:9700] CHIP:SC: Success status report received. Session was established - [1635925713.966839][9695:9700] CHIP:IN: New secure session created for device 0x0000000000000001, key 33!! - [1635925713.966938][9695:9700] CHIP:CTL: OpenCommissioningWindow for device ID 1 - [1635925713.972601][9695:9700] CHIP:DMG: ICR moving to [AddingComm] - [1635925713.972705][9695:9700] CHIP:DMG: ICR moving to [AddedComma] - [1635925713.972815][9695:9700] CHIP:IN: Prepared encrypted message 0xaaaad9b57d10 to 0x0000000000000001 of type 0x8 and protocolId (0, 1) on exchange 31056i with MessageCounter:0. - [1635925713.972876][9695:9700] CHIP:IN: Sending encrypted msg 0xaaaad9b57d10 with MessageCounter:0 to 0x0000000000000001 at monotonic time: 13449459 msec - [1635925713.973006][9695:9700] CHIP:DMG: ICR moving to [CommandSen] - [1635925713.973061][9695:9700] CHIP:CTL: Manual pairing code: [35484132896] - [1635925713.973120][9695:9700] CHIP:CTL: SetupQRCode: [MT:00000CQM00A7F87ZT10] - [1635925713.973178][9695:9700] CHIP:EM: Sending Standalone Ack for MessageCounter:1964916542 on exchange 31055i - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_SKIP_SAMPLE_APP && CADMIN.S.C00.Rsp - arguments: - values: - - name: "message" - value: "Enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 2a: TH_CR1 opens a commissioning window on DUT_CE using ECM with - a value of 900 seconds" - cluster: "Administrator Commissioning" - command: "OpenCommissioningWindow" - PICS: CADMIN.S.C00.Rsp && PICS_SDK_CI_ONLY - timedInteractionTimeoutMs: 10000 - arguments: - values: - - name: "CommissioningTimeout" - value: 900 - - name: "PAKEPasscodeVerifier" - value: PakeVerifier - - name: "Discriminator" - value: discriminator - - name: "Iterations" - value: 1000 - - name: "Salt" - value: "SPAKE2P Key Salt" - - - label: "Step 3: Wait for commissioning Window to 901 seconds" - PICS: CADMIN.S.C00.Rsp - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 901000 - - - label: - "Step 4: TH_CR1 reads the window status to verify the DUT_CE window is - closed" - cluster: "Administrator Commissioning" - command: "readAttribute" - attribute: "WindowStatus" - PICS: CADMIN.S.A0000 - response: - value: 0 - - - label: - "Step 5: TH_CR1 opens a commissioning window on DUT_CE using ECM with - a value of 901 seconds" - verification: | - On TH_CR1 (chip tool), open commissioning window - - ./chip-tool pairing open-commissioning-window 1 1 901 2000 3841 - - Verify DUT_CE responds General error 0x85 on TH_CR1 (chip-tool) log - - CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_003C Command=0x0000_0001 Status=0x85 - [1652860801.225084][9512:9517] CHIP:TOO: Error: IM Error 0x00000585: General error: 0x85 (INVALID_COMMAND) - [1652860801.225173][9512:9517] CHIP:DMG: ICR moving to [AwaitingDe] - [1652860801.225294][9512:9517] CHIP:EM: Sending Standalone Ack for MessageCounter:4191961 on exchange 37827i - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_SKIP_SAMPLE_APP && CADMIN.S.C00.Rsp - arguments: - values: - - name: "message" - value: "Enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 5a: TH_CR1 opens a commissioning window on DUT_CE using ECM with - a value of 901 seconds" - cluster: "Administrator Commissioning" - command: "OpenCommissioningWindow" - PICS: CADMIN.S.C00.Rsp && PICS_SDK_CI_ONLY - timedInteractionTimeoutMs: 10000 - arguments: - values: - - name: "CommissioningTimeout" - value: 901 - - name: "PAKEPasscodeVerifier" - value: PakeVerifier - - name: "Discriminator" - value: discriminator - - name: "Iterations" - value: 1000 - - name: "Salt" - value: "SPAKE2P Key Salt" - response: - error: INVALID_COMMAND - - - label: - "Step 6: TH_CR1 reads the window status to verify the DUT_CE window is - closed" - cluster: "Administrator Commissioning" - command: "readAttribute" - attribute: "WindowStatus" - PICS: CADMIN.S.A0000 - response: - value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_CADMIN_1_23.yaml b/src/app/tests/suites/certification/Test_TC_CADMIN_1_23.yaml deleted file mode 100644 index 9aab51aa3876d2..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_CADMIN_1_23.yaml +++ /dev/null @@ -1,124 +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: - 24.1.23. [TC-CADMIN-1.23] Open commissioning window - durations max and - max+1 [BCM] [DUT - Commissionee] - -PICS: - - CADMIN.S - - CADMIN.S.F00 - -config: - nodeId: 0x12344321 - timeout: 200 - endpoint: 0 - payload: - type: char_string - defaultValue: "MT:-24J0AFN00KA0648G00" - -tests: - - label: "Precondition: Reset Devices to factory defaults" - PICS: PICS_SDK_CI_ONLY - cluster: "SystemCommands" - command: "FactoryReset" - - - label: "Precondition: Reset Devices to factory defaults" - verification: | - Reset Devices to factory defaults - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_SKIP_SAMPLE_APP - arguments: - values: - - name: "message" - value: "Factory Reset the DUT and enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: "Step 1: TH_CR1 starts a commissioning process with DUT_CE" - cluster: "CommissionerCommands" - command: "PairWithCode" - PICS: CADMIN.S - arguments: - values: - - name: "nodeId" - value: nodeId - - name: "payload" - value: payload - - - label: "Step 1: TH_CR1 commissioned with DUT_CE" - cluster: "DelayCommands" - command: "WaitForCommissionee" - PICS: CADMIN.S.C01.Rsp - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: - "Step 2: TH_CR1 opens a commissioning window on DUT_CE using BCM with - a value of 180 seconds" - cluster: "Administrator Commissioning" - command: "OpenBasicCommissioningWindow" - PICS: CADMIN.S.C01.Rsp - timedInteractionTimeoutMs: 10000 - arguments: - values: - - name: "CommissioningTimeout" - value: 180 - - - label: - "Step 3: Wait for 181 seconds for commissioning Window to be closed" - PICS: CADMIN.S.C01.Rsp - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 181000 - - - label: - "Step 4: TH_CR1 reads the window status to verify the DUT_CE window is - closed" - cluster: "Administrator Commissioning" - command: "readAttribute" - attribute: "WindowStatus" - PICS: CADMIN.S.A0000 - response: - value: 0 - - - label: - "Step 5: TH_CR1 opens a commissioning window on DUT_CE using BCM with - a value of 179 seconds" - cluster: "Administrator Commissioning" - command: "OpenBasicCommissioningWindow" - PICS: CADMIN.S.C01.Rsp - timedInteractionTimeoutMs: 10000 - arguments: - values: - - name: "CommissioningTimeout" - value: 179 - response: - error: INVALID_COMMAND - - - label: - "Step 6: TH_CR1 reads the window status to verify the DUT_CE window is - closed" - cluster: "Administrator Commissioning" - command: "readAttribute" - attribute: "WindowStatus" - PICS: CADMIN.S.A0000 - response: - value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_CADMIN_1_24.yaml b/src/app/tests/suites/certification/Test_TC_CADMIN_1_24.yaml deleted file mode 100644 index 8e201988cc87db..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_CADMIN_1_24.yaml +++ /dev/null @@ -1,199 +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: - 24.1.24. [TC-CADMIN-1.24] Open commissioning window - durations max and - max+1 [ECM] [DUT - Commissionee] - -PICS: - - CADMIN.S - -config: - nodeId: 0x12344321 - timeout: 200 - endpoint: 0 - payload: - type: char_string - defaultValue: "MT:-24J0AFN00KA0648G00" - discriminator: - type: int16u - defaultValue: 3840 - PakeVerifier: - type: octet_string - defaultValue: "hex:b96170aae803346884724fe9a3b287c30330c2a660375d17bb205a8cf1aecb350457f8ab79ee253ab6a8e46bb09e543ae422736de501e3db37d441fe344920d09548e4c18240630c4ff4913c53513839b7c07fcc0627a1b8573a149fcd1fa466cf" - -tests: - - label: "Precondition: Reset Devices to factory defaults" - cluster: "SystemCommands" - PICS: PICS_SDK_CI_ONLY - command: "FactoryReset" - - - label: "Precondition: Reset Devices to factory defaults" - verification: | - Reset Devices to factory defaults - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_SKIP_SAMPLE_APP - arguments: - values: - - name: "message" - value: "Factory Reset the DUT and enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: "Step 1: TH_CR1 starts a commissioning process with DUT_CE" - cluster: "CommissionerCommands" - command: "PairWithCode" - PICS: CADMIN.S - arguments: - values: - - name: "nodeId" - value: nodeId - - name: "payload" - value: payload - - - label: "Step 1: TH_CR1 commissioned with DUT_CE" - cluster: "DelayCommands" - command: "WaitForCommissionee" - PICS: CADMIN.S.C00.Rsp - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: - "Step 2: TH_CR1 opens a commissioning window on DUT_CE using ECM with - a value of 180 seconds" - verification: | - On TH_CR1 ( chip tool), open commissioning window - - ./chip-tool pairing open-commissioning-window 1 1 180 1000 3840 - - Verify Manual pairing code on TH_CR1(chip-tool) Log - - [1635925713.966786][9695:9700] CHIP:SC: Success status report received. Session was established - [1635925713.966839][9695:9700] CHIP:IN: New secure session created for device 0x0000000000000001, key 33!! - [1635925713.966938][9695:9700] CHIP:CTL: OpenCommissioningWindow for device ID 1 - [1635925713.972601][9695:9700] CHIP:DMG: ICR moving to [AddingComm] - [1635925713.972705][9695:9700] CHIP:DMG: ICR moving to [AddedComma] - [1635925713.972815][9695:9700] CHIP:IN: Prepared encrypted message 0xaaaad9b57d10 to 0x0000000000000001 of type 0x8 and protocolId (0, 1) on exchange 31056i with MessageCounter:0. - [1635925713.972876][9695:9700] CHIP:IN: Sending encrypted msg 0xaaaad9b57d10 with MessageCounter:0 to 0x0000000000000001 at monotonic time: 13449459 msec - [1635925713.973006][9695:9700] CHIP:DMG: ICR moving to [CommandSen] - [1635925713.973061][9695:9700] CHIP:CTL: Manual pairing code: [35484132896] - [1635925713.973120][9695:9700] CHIP:CTL: SetupQRCode: [MT:00000CQM00A7F87ZT10] - [1635925713.973178][9695:9700] CHIP:EM: Sending Standalone Ack for MessageCounter:1964916542 on exchange 31055i - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_SKIP_SAMPLE_APP && CADMIN.S.C00.Rsp - arguments: - values: - - name: "message" - value: "Enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 2a: TH_CR1 opens a commissioning window on DUT_CE using ECM with - a value of 180 seconds" - cluster: "Administrator Commissioning" - command: "OpenCommissioningWindow" - PICS: CADMIN.S.C00.Rsp && PICS_SDK_CI_ONLY - timedInteractionTimeoutMs: 10000 - arguments: - values: - - name: "CommissioningTimeout" - value: 180 - - name: "PAKEPasscodeVerifier" - value: PakeVerifier - - name: "Discriminator" - value: discriminator - - name: "Iterations" - value: 1000 - - name: "Salt" - value: "SPAKE2P Key Salt" - - - label: "Step 3: Wait for commissioning Window to 181 seconds" - PICS: CADMIN.S.C00.Rsp - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 181000 - - - label: - "Step 4: TH_CR1 reads the window status to verify the DUT_CE window is - closed" - cluster: "Administrator Commissioning" - command: "readAttribute" - attribute: "WindowStatus" - PICS: CADMIN.S.A0000 - response: - value: 0 - - - label: - "Step 5: TH_CR1 opens a commissioning window on DUT_CE using ECM with - a value of 179 seconds" - verification: | - On TH_CR1 ( chip tool), open commissioning window - - ./chip-tool pairing open-commissioning-window 1 1 179 2000 3841 - - Verify DUT_CE responds General error 0x85 on TH_CR1 (chip-tool) log - - CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_003C Command=0x0000_0001 Status=0x85 - [1652860801.225084][9512:9517] CHIP:TOO: Error: IM Error 0x00000585: General error: 0x85 (INVALID_COMMAND) - [1652860801.225173][9512:9517] CHIP:DMG: ICR moving to [AwaitingDe] - [1652860801.225294][9512:9517] CHIP:EM: Sending Standalone Ack for MessageCounter:4191961 on exchange 37827i - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_SKIP_SAMPLE_APP && CADMIN.S.C00.Rsp - arguments: - values: - - name: "message" - value: "Enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 5a: TH_CR1 opens a commissioning window on DUT_CE using ECM with - a value of 179 seconds" - cluster: "Administrator Commissioning" - command: "OpenCommissioningWindow" - PICS: CADMIN.S.C00.Rsp && PICS_SDK_CI_ONLY - timedInteractionTimeoutMs: 10000 - arguments: - values: - - name: "CommissioningTimeout" - value: 179 - - name: "PAKEPasscodeVerifier" - value: PakeVerifier - - name: "Discriminator" - value: discriminator - - name: "Iterations" - value: 1000 - - name: "Salt" - value: "SPAKE2P Key Salt" - response: - error: INVALID_COMMAND - - - label: - "Step 6: TH_CR1 reads the window status to verify the DUT_CE window is - closed" - cluster: "Administrator Commissioning" - command: "readAttribute" - attribute: "WindowStatus" - PICS: CADMIN.S.A0000 - response: - value: 0 diff --git a/src/python_testing/TC_CADMIN_1_22.py b/src/python_testing/TC_CADMIN_1_22.py new file mode 100644 index 00000000000000..4ecd2a780959b4 --- /dev/null +++ b/src/python_testing/TC_CADMIN_1_22.py @@ -0,0 +1,138 @@ +# +# Copyright (c) 2024 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. +# +# === BEGIN CI TEST ARGUMENTS === +# test-runner-runs: run1 +# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} +# test-runner-run/run1/factoryreset: True +# test-runner-run/run1/quiet: True +# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto --PICS src/app/tests/suites/certification/ci-pics-values +# === END CI TEST ARGUMENTS === + +import logging +import random +from time import sleep + +import chip.clusters as Clusters +from chip import ChipDeviceCtrl +from chip.ChipDeviceCtrl import CommissioningParameters +from chip.exceptions import ChipStackError +from chip.native import PyChipError +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from mobly import asserts + + +class TC_CADMIN_1_22(MatterBaseTest): + async def OpenCommissioningWindow(self) -> CommissioningParameters: + try: + params = await self.th1.OpenCommissioningWindow( + nodeid=self.dut_node_id, timeout=self.max_window_duration, iteration=10000, discriminator=self.discriminator, option=1) + return params + + except Exception as e: + logging.exception('Error running OpenCommissioningWindow %s', e) + asserts.assert_true(False, 'Failed to open commissioning window') + + def generate_unique_random_value(self, value): + while True: + random_value = random.randint(10000000, 99999999) + if random_value != value: + return random_value + + async def CommissionAttempt( + self, setupPinCode: int, thnum: int, th: str, fail: bool): + + logging.info(f"-----------------Commissioning with TH_CR{str(thnum)}-------------------------") + if fail == True: + ctx = asserts.assert_raises(ChipStackError) + self.print_step(0, ctx) + with ctx: + await th.CommissionOnNetwork( + nodeId=self.dut_node_id, setupPinCode=setup_code, + filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=self.discriminator) + errcode = PyChipError.from_code(ctx.exception.err) + logging.info('Commissioning complete done. Successful? {}, errorcode = {}, cycle={}'.format( + errcode.is_success, errcode, (cycle+1))) + asserts.assert_false(errcode.is_success, 'Commissioning complete did not error as expected') + asserts.assert_true(errcode.sdk_code == 0x0000000B, + 'Unexpected error code returned from CommissioningComplete') + + elif fail == False: + await th.CommissionOnNetwork( + nodeId=self.dut_node_id, setupPinCode=setupPinCode, + filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=self.discriminator) + + async def get_window_status(self) -> int: + AC_cluster = Clusters.AdministratorCommissioning + window_status = await self.read_single_attribute_check_success(dev_ctrl=self.th1, fabric_filtered=False, endpoint=0, cluster=AC_cluster, attribute=AC_cluster.Attributes.WindowStatus) + return window_status + + def steps_TC_CADMIN_1_22(self) -> list[TestStep]: + return [ + TestStep(1, "Commissioning, already done", is_commissioning=True), + TestStep(2, "TH_CR1 opens a commissioning window on DUT_CE using ECM with a value of 900 seconds", + "DUT_CE opens its Commissioning window to allow a second commissioning"), + TestStep(3, "TH_CR1 sends an RevokeCommissioning command to the DUT"), + TestStep(4, "TH_CR1 reads the window status to verify the DUT_CE window is closed", "DUT_CE windows status shows the window is closed"), + TestStep(5, "TH_CR1 opens a commissioning window on DUT_CE using ECM with a value of 901 seconds", + "DUT_CE does not open its Commissioning window to allow a second commissioning. DUT_CE shows 'Failed to open commissioning window. Global status 0x85'"), + TestStep(6, "TH_CR1 reads the window status to verify the DUT_CE window is closed", "DUT_CE windows status shows the window is closed"), + ] + + def pics_TC_CADMIN_1_22(self) -> list[str]: + return ["CADMIN.S"] + + @async_test_body + async def test_TC_CADMIN_1_22(self): + self.step(1) + self.th1 = self.default_controller + self.discriminator = random.randint(0, 4095) + + self.step(2) + params = await self.th1.OpenCommissioningWindow( + nodeid=self.dut_node_id, timeout=900, iteration=10000, discriminator=self.discriminator, option=1) + + self.step(3) + revokeCmd = Clusters.AdministratorCommissioning.Commands.RevokeCommissioning() + await self.th1.SendCommand(nodeid=self.dut_node_id, endpoint=0, payload=revokeCmd, timedRequestTimeoutMs=6000) + # The failsafe cleanup is scheduled after the command completes, so give it a bit of time to do that + sleep(1) + + self.step(4) + window_status = await self.get_window_status() + if window_status != 0: + asserts.fail(f"Commissioning window is expected to be closed, but was found to be open") + + self.step(5) + try: + params = await self.th1.OpenCommissioningWindow( + nodeid=self.dut_node_id, timeout=901, iteration=10000, discriminator=self.discriminator, option=1) + + except ChipStackError as e: + # Since we provided 901 seconds as the timeout duration, + # we should not be able to open comm window as duration is too long. + asserts.assert_equal(e.err, 0x00000585, + "Expected to error as we provided failure value for opening commissioning window") + + self.step(6) + window_status2 = await self.get_window_status() + if window_status2 != 0: + asserts.fail(f"Commissioning window is expected to be closed, but was found to be open") + + +if __name__ == "__main__": + default_matter_test_main() diff --git a/src/python_testing/TC_CADMIN_1_24.py b/src/python_testing/TC_CADMIN_1_24.py new file mode 100644 index 00000000000000..d36e405e2c41d6 --- /dev/null +++ b/src/python_testing/TC_CADMIN_1_24.py @@ -0,0 +1,139 @@ +# +# Copyright (c) 2024 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. +# +# === BEGIN CI TEST ARGUMENTS === +# test-runner-runs: run1 +# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} +# test-runner-run/run1/factoryreset: True +# test-runner-run/run1/quiet: True +# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto --PICS src/app/tests/suites/certification/ci-pics-values +# === END CI TEST ARGUMENTS === + +import logging +import random +from time import sleep + +import chip.clusters as Clusters +from chip import ChipDeviceCtrl +from chip.ChipDeviceCtrl import CommissioningParameters +from chip.exceptions import ChipStackError +from chip.native import PyChipError +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from mobly import asserts + + +class TC_CADMIN_1_24(MatterBaseTest): + async def OpenCommissioningWindow(self) -> CommissioningParameters: + try: + params = await self.th1.OpenCommissioningWindow( + nodeid=self.dut_node_id, timeout=self.max_window_duration, iteration=10000, discriminator=self.discriminator, option=1) + return params + + except Exception as e: + logging.exception('Error running OpenCommissioningWindow %s', e) + asserts.assert_true(False, 'Failed to open commissioning window') + + def generate_unique_random_value(self, value): + while True: + random_value = random.randint(10000000, 99999999) + if random_value != value: + return random_value + + async def CommissionAttempt( + self, setupPinCode: int, thnum: int, th: str, fail: bool): + + logging.info(f"-----------------Commissioning with TH_CR{str(thnum)}-------------------------") + if fail == True: + ctx = asserts.assert_raises(ChipStackError) + self.print_step(0, ctx) + with ctx: + await th.CommissionOnNetwork( + nodeId=self.dut_node_id, setupPinCode=setup_code, + filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=self.discriminator) + errcode = PyChipError.from_code(ctx.exception.err) + logging.info('Commissioning complete done. Successful? {}, errorcode = {}, cycle={}'.format( + errcode.is_success, errcode, (cycle+1))) + asserts.assert_false(errcode.is_success, 'Commissioning complete did not error as expected') + asserts.assert_true(errcode.sdk_code == 0x0000000B, + 'Unexpected error code returned from CommissioningComplete') + + elif fail == False: + await th.CommissionOnNetwork( + nodeId=self.dut_node_id, setupPinCode=setupPinCode, + filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=self.discriminator) + + async def get_window_status(self) -> int: + AC_cluster = Clusters.AdministratorCommissioning + window_status = await self.read_single_attribute_check_success(dev_ctrl=self.th1, fabric_filtered=False, endpoint=0, cluster=AC_cluster, attribute=AC_cluster.Attributes.WindowStatus) + return window_status + + def steps_TC_CADMIN_1_24(self) -> list[TestStep]: + return [ + TestStep(1, "Commissioning, already done", is_commissioning=True), + TestStep(2, "TH_CR1 opens a commissioning window on DUT_CE using ECM with a value of 180 seconds", + "DUT_CE opens its Commissioning window to allow a second commissioning"), + TestStep(3, "TH_CR1 sends an RevokeCommissioning command to the DUT"), + TestStep(4, "TH_CR1 reads the window status to verify the DUT_CE window is closed", + "DUT_CE windows status shows the window is closed"), + TestStep(5, "TH_CR1 opens a commissioning window on DUT_CE using ECM with a value of 179 seconds", + "DUT_CE does not open its Commissioning window to allow a second commissioning. DUT_CE shows 'Failed to open commissioning window. Global status 0x85'"), + TestStep(6, "TH_CR1 reads the window status to verify the DUT_CE window is closed", "DUT_CE windows status shows the window is closed"), + ] + + def pics_TC_CADMIN_1_24(self) -> list[str]: + return ["CADMIN.S"] + + @async_test_body + async def test_TC_CADMIN_1_24(self): + self.step(1) + self.th1 = self.default_controller + self.discriminator = random.randint(0, 4095) + + self.step(2) + params = await self.th1.OpenCommissioningWindow( + nodeid=self.dut_node_id, timeout=180, iteration=10000, discriminator=self.discriminator, option=1) + + self.step(3) + revokeCmd = Clusters.AdministratorCommissioning.Commands.RevokeCommissioning() + await self.th1.SendCommand(nodeid=self.dut_node_id, endpoint=0, payload=revokeCmd, timedRequestTimeoutMs=6000) + # The failsafe cleanup is scheduled after the command completes, so give it a bit of time to do that + sleep(1) + + self.step(4) + window_status = await self.get_window_status() + if window_status != 0: + asserts.fail(f"Commissioning window is expected to be closed, but was found to be open") + + self.step(5) + try: + params = await self.th1.OpenCommissioningWindow( + nodeid=self.dut_node_id, timeout=179, iteration=10000, discriminator=self.discriminator, option=1) + + except ChipStackError as e: + # Since we provided 901 seconds as the timeout duration, + # we should not be able to open comm window as duration is too long. + asserts.assert_equal(e.err, 0x00000585, + "Expected to error as we provided failure value for opening commissioning window") + + self.step(6) + window_status2 = await self.get_window_status() + if window_status2 != 0: + asserts.fail(f"Commissioning window is expected to be closed, but was found to be open") + + +if __name__ == "__main__": + default_matter_test_main() From e244d9808c2db5d3f09789c54f948e30a143d0ca Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Tue, 17 Sep 2024 19:42:22 +0000 Subject: [PATCH 2/3] Restyled by autopep8 --- src/python_testing/TC_CADMIN_1_22.py | 20 +++++++++++--------- src/python_testing/TC_CADMIN_1_24.py | 21 +++++++++++---------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/src/python_testing/TC_CADMIN_1_22.py b/src/python_testing/TC_CADMIN_1_22.py index 4ecd2a780959b4..20085b6c30626c 100644 --- a/src/python_testing/TC_CADMIN_1_22.py +++ b/src/python_testing/TC_CADMIN_1_22.py @@ -84,13 +84,15 @@ async def get_window_status(self) -> int: def steps_TC_CADMIN_1_22(self) -> list[TestStep]: return [ TestStep(1, "Commissioning, already done", is_commissioning=True), - TestStep(2, "TH_CR1 opens a commissioning window on DUT_CE using ECM with a value of 900 seconds", - "DUT_CE opens its Commissioning window to allow a second commissioning"), + TestStep(2, "TH_CR1 opens a commissioning window on DUT_CE using ECM with a value of 900 seconds", + "DUT_CE opens its Commissioning window to allow a second commissioning"), TestStep(3, "TH_CR1 sends an RevokeCommissioning command to the DUT"), - TestStep(4, "TH_CR1 reads the window status to verify the DUT_CE window is closed", "DUT_CE windows status shows the window is closed"), - TestStep(5, "TH_CR1 opens a commissioning window on DUT_CE using ECM with a value of 901 seconds", - "DUT_CE does not open its Commissioning window to allow a second commissioning. DUT_CE shows 'Failed to open commissioning window. Global status 0x85'"), - TestStep(6, "TH_CR1 reads the window status to verify the DUT_CE window is closed", "DUT_CE windows status shows the window is closed"), + TestStep(4, "TH_CR1 reads the window status to verify the DUT_CE window is closed", + "DUT_CE windows status shows the window is closed"), + TestStep(5, "TH_CR1 opens a commissioning window on DUT_CE using ECM with a value of 901 seconds", + "DUT_CE does not open its Commissioning window to allow a second commissioning. DUT_CE shows 'Failed to open commissioning window. Global status 0x85'"), + TestStep(6, "TH_CR1 reads the window status to verify the DUT_CE window is closed", + "DUT_CE windows status shows the window is closed"), ] def pics_TC_CADMIN_1_22(self) -> list[str]: @@ -118,15 +120,15 @@ async def test_TC_CADMIN_1_22(self): asserts.fail(f"Commissioning window is expected to be closed, but was found to be open") self.step(5) - try: + try: params = await self.th1.OpenCommissioningWindow( nodeid=self.dut_node_id, timeout=901, iteration=10000, discriminator=self.discriminator, option=1) except ChipStackError as e: - # Since we provided 901 seconds as the timeout duration, + # Since we provided 901 seconds as the timeout duration, # we should not be able to open comm window as duration is too long. asserts.assert_equal(e.err, 0x00000585, - "Expected to error as we provided failure value for opening commissioning window") + "Expected to error as we provided failure value for opening commissioning window") self.step(6) window_status2 = await self.get_window_status() diff --git a/src/python_testing/TC_CADMIN_1_24.py b/src/python_testing/TC_CADMIN_1_24.py index d36e405e2c41d6..1b50bc909c6a33 100644 --- a/src/python_testing/TC_CADMIN_1_24.py +++ b/src/python_testing/TC_CADMIN_1_24.py @@ -84,14 +84,15 @@ async def get_window_status(self) -> int: def steps_TC_CADMIN_1_24(self) -> list[TestStep]: return [ TestStep(1, "Commissioning, already done", is_commissioning=True), - TestStep(2, "TH_CR1 opens a commissioning window on DUT_CE using ECM with a value of 180 seconds", - "DUT_CE opens its Commissioning window to allow a second commissioning"), + TestStep(2, "TH_CR1 opens a commissioning window on DUT_CE using ECM with a value of 180 seconds", + "DUT_CE opens its Commissioning window to allow a second commissioning"), TestStep(3, "TH_CR1 sends an RevokeCommissioning command to the DUT"), - TestStep(4, "TH_CR1 reads the window status to verify the DUT_CE window is closed", - "DUT_CE windows status shows the window is closed"), - TestStep(5, "TH_CR1 opens a commissioning window on DUT_CE using ECM with a value of 179 seconds", - "DUT_CE does not open its Commissioning window to allow a second commissioning. DUT_CE shows 'Failed to open commissioning window. Global status 0x85'"), - TestStep(6, "TH_CR1 reads the window status to verify the DUT_CE window is closed", "DUT_CE windows status shows the window is closed"), + TestStep(4, "TH_CR1 reads the window status to verify the DUT_CE window is closed", + "DUT_CE windows status shows the window is closed"), + TestStep(5, "TH_CR1 opens a commissioning window on DUT_CE using ECM with a value of 179 seconds", + "DUT_CE does not open its Commissioning window to allow a second commissioning. DUT_CE shows 'Failed to open commissioning window. Global status 0x85'"), + TestStep(6, "TH_CR1 reads the window status to verify the DUT_CE window is closed", + "DUT_CE windows status shows the window is closed"), ] def pics_TC_CADMIN_1_24(self) -> list[str]: @@ -119,15 +120,15 @@ async def test_TC_CADMIN_1_24(self): asserts.fail(f"Commissioning window is expected to be closed, but was found to be open") self.step(5) - try: + try: params = await self.th1.OpenCommissioningWindow( nodeid=self.dut_node_id, timeout=179, iteration=10000, discriminator=self.discriminator, option=1) except ChipStackError as e: - # Since we provided 901 seconds as the timeout duration, + # Since we provided 901 seconds as the timeout duration, # we should not be able to open comm window as duration is too long. asserts.assert_equal(e.err, 0x00000585, - "Expected to error as we provided failure value for opening commissioning window") + "Expected to error as we provided failure value for opening commissioning window") self.step(6) window_status2 = await self.get_window_status() From c8a2509ad2cdd348f0dbfcdc5f4e7b50590b49c6 Mon Sep 17 00:00:00 2001 From: Jake Ororke Date: Tue, 17 Sep 2024 13:02:57 -0700 Subject: [PATCH 3/3] Updating TC_CADMIN_1_22 and TC_CADMIN_1_24: - Resolved linting issues --- src/python_testing/TC_CADMIN_1_22.py | 18 +++++++++--------- src/python_testing/TC_CADMIN_1_24.py | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/python_testing/TC_CADMIN_1_22.py b/src/python_testing/TC_CADMIN_1_22.py index 20085b6c30626c..71cfd01948293d 100644 --- a/src/python_testing/TC_CADMIN_1_22.py +++ b/src/python_testing/TC_CADMIN_1_22.py @@ -57,21 +57,21 @@ async def CommissionAttempt( self, setupPinCode: int, thnum: int, th: str, fail: bool): logging.info(f"-----------------Commissioning with TH_CR{str(thnum)}-------------------------") - if fail == True: + if fail: ctx = asserts.assert_raises(ChipStackError) self.print_step(0, ctx) with ctx: await th.CommissionOnNetwork( - nodeId=self.dut_node_id, setupPinCode=setup_code, + nodeId=self.dut_node_id, setupPinCode=setupPinCode, filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=self.discriminator) errcode = PyChipError.from_code(ctx.exception.err) - logging.info('Commissioning complete done. Successful? {}, errorcode = {}, cycle={}'.format( - errcode.is_success, errcode, (cycle+1))) + logging.info('Commissioning complete done. Successful? {}, errorcode = {}'.format( + errcode.is_success, errcode)) asserts.assert_false(errcode.is_success, 'Commissioning complete did not error as expected') asserts.assert_true(errcode.sdk_code == 0x0000000B, 'Unexpected error code returned from CommissioningComplete') - elif fail == False: + elif not fail: await th.CommissionOnNetwork( nodeId=self.dut_node_id, setupPinCode=setupPinCode, filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=self.discriminator) @@ -105,7 +105,7 @@ async def test_TC_CADMIN_1_22(self): self.discriminator = random.randint(0, 4095) self.step(2) - params = await self.th1.OpenCommissioningWindow( + await self.th1.OpenCommissioningWindow( nodeid=self.dut_node_id, timeout=900, iteration=10000, discriminator=self.discriminator, option=1) self.step(3) @@ -117,11 +117,11 @@ async def test_TC_CADMIN_1_22(self): self.step(4) window_status = await self.get_window_status() if window_status != 0: - asserts.fail(f"Commissioning window is expected to be closed, but was found to be open") + asserts.fail("Commissioning window is expected to be closed, but was found to be open") self.step(5) try: - params = await self.th1.OpenCommissioningWindow( + await self.th1.OpenCommissioningWindow( nodeid=self.dut_node_id, timeout=901, iteration=10000, discriminator=self.discriminator, option=1) except ChipStackError as e: @@ -133,7 +133,7 @@ async def test_TC_CADMIN_1_22(self): self.step(6) window_status2 = await self.get_window_status() if window_status2 != 0: - asserts.fail(f"Commissioning window is expected to be closed, but was found to be open") + asserts.fail("Commissioning window is expected to be closed, but was found to be open") if __name__ == "__main__": diff --git a/src/python_testing/TC_CADMIN_1_24.py b/src/python_testing/TC_CADMIN_1_24.py index 1b50bc909c6a33..7d1c1791ca8770 100644 --- a/src/python_testing/TC_CADMIN_1_24.py +++ b/src/python_testing/TC_CADMIN_1_24.py @@ -57,21 +57,21 @@ async def CommissionAttempt( self, setupPinCode: int, thnum: int, th: str, fail: bool): logging.info(f"-----------------Commissioning with TH_CR{str(thnum)}-------------------------") - if fail == True: + if fail: ctx = asserts.assert_raises(ChipStackError) self.print_step(0, ctx) with ctx: await th.CommissionOnNetwork( - nodeId=self.dut_node_id, setupPinCode=setup_code, + nodeId=self.dut_node_id, setupPinCode=setupPinCode, filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=self.discriminator) errcode = PyChipError.from_code(ctx.exception.err) - logging.info('Commissioning complete done. Successful? {}, errorcode = {}, cycle={}'.format( - errcode.is_success, errcode, (cycle+1))) + logging.info('Commissioning complete done. Successful? {}, errorcode = {}'.format( + errcode.is_success, errcode)) asserts.assert_false(errcode.is_success, 'Commissioning complete did not error as expected') asserts.assert_true(errcode.sdk_code == 0x0000000B, 'Unexpected error code returned from CommissioningComplete') - elif fail == False: + elif not fail: await th.CommissionOnNetwork( nodeId=self.dut_node_id, setupPinCode=setupPinCode, filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=self.discriminator) @@ -105,7 +105,7 @@ async def test_TC_CADMIN_1_24(self): self.discriminator = random.randint(0, 4095) self.step(2) - params = await self.th1.OpenCommissioningWindow( + await self.th1.OpenCommissioningWindow( nodeid=self.dut_node_id, timeout=180, iteration=10000, discriminator=self.discriminator, option=1) self.step(3) @@ -117,11 +117,11 @@ async def test_TC_CADMIN_1_24(self): self.step(4) window_status = await self.get_window_status() if window_status != 0: - asserts.fail(f"Commissioning window is expected to be closed, but was found to be open") + asserts.fail("Commissioning window is expected to be closed, but was found to be open") self.step(5) try: - params = await self.th1.OpenCommissioningWindow( + await self.th1.OpenCommissioningWindow( nodeid=self.dut_node_id, timeout=179, iteration=10000, discriminator=self.discriminator, option=1) except ChipStackError as e: @@ -133,7 +133,7 @@ async def test_TC_CADMIN_1_24(self): self.step(6) window_status2 = await self.get_window_status() if window_status2 != 0: - asserts.fail(f"Commissioning window is expected to be closed, but was found to be open") + asserts.fail("Commissioning window is expected to be closed, but was found to be open") if __name__ == "__main__":