From fb1ce98e295fa53601c5fdea045d2497a6a73fe1 Mon Sep 17 00:00:00 2001 From: Jake Ororke Date: Tue, 10 Sep 2024 11:51:42 -0700 Subject: [PATCH 01/21] Created CADMIN 1.15 test module: - Creating TC_CADMIN_1_15.py test module following test steps in draft PR from Cecille here: https://github.com/CHIP-Specifications/chip-test-plans/pull/4636 - Removing test_TC_CADMIN_1_15.yaml as no longer needed once python module is created. --- .../certification/Test_TC_CADMIN_1_15.yaml | 316 ------------------ src/python_testing/TC_CADMIN_1_15.py | 237 +++++++++++++ 2 files changed, 237 insertions(+), 316 deletions(-) delete mode 100644 src/app/tests/suites/certification/Test_TC_CADMIN_1_15.yaml create mode 100644 src/python_testing/TC_CADMIN_1_15.py diff --git a/src/app/tests/suites/certification/Test_TC_CADMIN_1_15.yaml b/src/app/tests/suites/certification/Test_TC_CADMIN_1_15.yaml deleted file mode 100644 index 72f93fe51ae3d4..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_CADMIN_1_15.yaml +++ /dev/null @@ -1,316 +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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: - 4.1.15. [TC-CADMIN-1.15] Removing Fabrics from DUT and Fabric index - enumeration using ECM [DUT - Commissionee] - -PICS: - - CADMIN.S - -config: - nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 - -tests: - - label: "Precondition" - verification: | - Reset Devices to factory defaults - disabled: true - - - label: "Step 1: TH_CR1 starts a commissioning process with DUT_CE" - PICS: CADMIN.S - verification: | - "1. Provision the device using TH_CR1 (Chip-tool as controller) - " - disabled: true - - - label: - "Step 2: TH_CR1 opens a commissioning window on DUT_CE using a - commissioning timeout of PIXIT.CADMIN.CwDuration seconds using ECM" - PICS: CADMIN.S.C00.Rsp - verification: | - On TH_CR1 chip tool, open commissioning window using ECM - - ./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: [36217551633] - [1635925713.973120][9695:9700] CHIP:CTL: SetupQRCode: [MT:00000CQM00A7F87ZT10] - [1635925713.973178][9695:9700] CHIP:EM: Sending Standalone Ack for MessageCounter:1964916542 on exchange 31055i - disabled: true - - - label: "Step 3: TH_CR2 starts a commissioning process with DUT_CE" - PICS: CADMIN.S - verification: | - On TH_CR2 using chip tool connect to the accessory - - - ./chip-tool pairing code 2 36217551633 --commissioner-name beta - - Verify you got below message on TH_CR2 (chip-tool) - Device commissioning completed with success - disabled: true - - - label: - "Step 4: TH_CR1 opens a commissioning window on DUT_CE using a - commissioning timeout of PIXIT.CADMIN.CwDuration seconds using ECM" - PICS: CADMIN.S.C00.Rsp - verification: | - On TH_CR1 chip tool, open commissioning window using ECM - - ./chip-tool pairing open-commissioning-window 1 1 300 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: [36217551633] - [1635925713.973120][9695:9700] CHIP:CTL: SetupQRCode: [MT:00000CQM00A7F87ZT10] - [1635925713.973178][9695:9700] CHIP:EM: Sending Standalone Ack for MessageCounter:1964916542 on exchange 31055i - disabled: true - - - label: "Step 5: TH_CR3 starts a commissioning process with DUT_CE" - PICS: CADMIN.S - verification: | - On TH_CR3 using chip tool connect to the accessory - - ./chip-tool pairing code 3 36217551633 --commissioner-name gamma - - Verify you got below message on TH_CR3 (chip-tool) side - Device commissioning completed with success - disabled: true - - - label: "Step 6: TH_CR2 reads the list of Fabrics on DUT_CE" - PICS: OPCREDS.S.A0001 - verification: | - On TH_CR2 using chip tool, read fabrics list - - ./chip-tool operationalcredentials read fabrics 2 0 --fabric-filtered 0 --commissioner-name beta - - Verify the list of Fabrics consists of FabricIndex 1, FabricIndex 2, FabricIndex 3 on TH_CR2 (chip-tool) log - - CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003E Attribute 0x0000_0001 DataVersion: 2455995193 - CHIP:TOO: Fabrics: 3 entries - CHIP:TOO: [1]: { - CHIP:TOO: RootPublicKey: 04656F56DBDB677DC957028DFC0ED76709C72753C9194B117A483BDC07386BFD9529B68EB4448FBBA3964EFF37A56A8F461D348B0DAF3B56A75F3B94BF8209D36F - CHIP:TOO: VendorId: 65521 - CHIP:TOO: FabricId: 1 - CHIP:TOO: NodeId: 1 - CHIP:TOO: Label: - CHIP:TOO: FabricIndex: 1 - CHIP:TOO: } - CHIP:TOO: [2]: { - CHIP:TOO: RootPublicKey: 04F8F28D5D70A4510E0F72FBBA31369796C4206FF95D97B77C1BDFD0438A3BE43510631A1B915BE189323F4CC0E015480192654D8170F8F230C7713898962958B7 - CHIP:TOO: VendorId: 65521 - CHIP:TOO: FabricId: 1 - CHIP:TOO: NodeId: 2 - CHIP:TOO: Label: - CHIP:TOO: FabricIndex: 2 - CHIP:TOO: } - CHIP:TOO: [3]: { - CHIP:TOO: RootPublicKey: 04F8F28D5D70A4510E0F72FBBA31369796C4206FF95D97B77C1BDFD0438A3BE43510631A1B915BE189323F4CC0E015480192654D8170F8F230C7713898962958B7 - CHIP:TOO: VendorId: 65521 - CHIP:TOO: FabricId: 1 - CHIP:TOO: NodeId: 3 - CHIP:TOO: Label: - CHIP:TOO: FabricIndex: 3 - CHIP:TOO: } - CHIP:EM: Sending Standalone Ack for MessageCounter:9143157 on exchange 1147i - disabled: true - - - label: - "Step 7: TH_CR2 sends RemoveFabric with FabricIndex = 2 command to - DUT_CE" - PICS: OPCREDS.S.C0a.Rsp - verification: | - on TH_CR2 using chip tool, remove fabric with FabricIndex=2 - - ./chip-tool operationalcredentials remove-fabric 2 2 0 --commissioner-name beta - - Verify DUT_CE responses with NOCResponse with a StatusCode OK on TH_CR2 (chip-tool) log - - CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_003E Command=0x0000_0008 - CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003E Command 0x0000_0008 - CHIP:TOO: NOCResponse: { - CHIP:TOO: statusCode: 0 - CHIP:TOO: fabricIndex: 2 - CHIP:TOO: } - CHIP:DMG: ICR moving to [AwaitingDe] - disabled: true - - - label: - "Step 8: TH_CR2 writes and reads the Basic Information Clusters - NodeLabel mandatory attribute of DUT_CE" - PICS: BINFO.S.A0005 - verification: | - Using TH_CR2 , write attribute and read attribute - - Verify read/write commands fail as expected since the DUT_CE is no longer on the network on TH_CR2 (chip-tool) side - - ./chip-tool basicinformation write node-label te5new 2 0 --commissioner-name beta - - [1678875950.655277][713499:713501] CHIP:SC: Received error (protocol code 1) during pairing process: ../../third_party/connectedhomeip/src/protocols/secure_channel/CASESession.cpp:1727: CHIP Error 0x000000C9: No shared trusted root - [1678875950.655290][713499:713501] CHIP:IN: SecureSession[0x7f5760026220]: Released - Type:2 LSID:1179 - [1678875950.655316][713499:713501] CHIP:-: ../../third_party/connectedhomeip/src/protocols/secure_channel/CASESession.cpp:1727: CHIP Error 0x000000C9: No shared trusted root at ../../commands/clusters/ModelCommand.cpp:62 - - - ./chip-tool basicinformation read node-label 2 0 --commissioner-name beta - - [1678875950.655277][713499:713501] CHIP:SC: Received error (protocol code 1) during pairing process: ../../third_party/connectedhomeip/src/protocols/secure_channel/CASESession.cpp:1727: CHIP Error 0x000000C9: No shared trusted root - [1678875950.655290][713499:713501] CHIP:IN: SecureSession[0x7f5760026220]: Released - Type:2 LSID:1179 - [1678875950.655316][713499:713501] CHIP:-: ../../third_party/connectedhomeip/src/protocols/secure_channel/CASESession.cpp:1727: CHIP Error 0x000000C9: No shared trusted root at ../../commands/clusters/ModelCommand.cpp:62 - disabled: true - - - label: "Step 9: TH_CR1 reads the list of Fabrics on DUT_CE" - PICS: OPCREDS.S.A0001 - verification: | - On TH_CR1 using chip tool, read fabrics list - - Verify the list of Fabrics consists of FabricIndex 1, FabricIndex 3 on TH_CR1 (chip-tool) log - - ./chip-tool operationalcredentials read fabrics 1 0 --fabric-filtered 0 - - CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003E Attribute 0x0000_0001 DataVersion: 2455995219 - [1647863260.286772][9294:9299] CHIP:TOO: Fabrics: 2 entries - [1647863260.286908][9294:9299] CHIP:TOO: [1]: { - [1647863260.286947][9294:9299] CHIP:TOO: RootPublicKey: 04656F56DBDB677DC957028DFC0ED76709C72753C9194B117A483BDC07386BFD9529B68EB4448FBBA3964EFF37A56A8F461D348B0DAF3B56A75F3B94BF8209D36F - [1647863260.286995][9294:9299] CHIP:TOO: VendorId: 65521 - [1647863260.287026][9294:9299] CHIP:TOO: FabricId: 1 - [1647863260.287055][9294:9299] CHIP:TOO: NodeId: 1 - [1647863260.287084][9294:9299] CHIP:TOO: Label: - [1647863260.287113][9294:9299] CHIP:TOO: FabricIndex: 1 - [1647863260.287144][9294:9299] CHIP:TOO: } - [1647863260.287185][9294:9299] CHIP:TOO: [2]: { - [1647863260.287221][9294:9299] CHIP:TOO: RootPublicKey: 04F8F28D5D70A4510E0F72FBBA31369796C4206FF95D97B77C1BDFD0438A3BE43510631A1B915BE189323F4CC0E015480192654D8170F8F230C7713898962958B7 - [1647863260.287253][9294:9299] CHIP:TOO: VendorId: 65521 - [1647863260.287282][9294:9299] CHIP:TOO: FabricId: 1 - [1647863260.287310][9294:9299] CHIP:TOO: NodeId: 3 - [1647863260.287339][9294:9299] CHIP:TOO: Label: - [1647863260.287368][9294:9299] CHIP:TOO: FabricIndex: 3 - [1647863260.287396][9294:9299] CHIP:TOO: } - [1647863260.287515][9294:9299] CHIP:EM: Sending Standalone Ack for MessageCounter:11301761 on exchange 13180i" - disabled: true - - - label: - "Step 10: Verify DUT_CE is now discoverable over DNS-SD with 2 - Operational service records (_matter._tcp SRV records)." - PICS: CADMIN.S.C00.Rsp - verification: | - Execute the below command in any linux platform or in TH_CR1 - avahi-browse -rt _matter._tcp - - + wlp5s0 IPv6 8E50A59FAF52A809-0000000000000001 _matter._tcp local - + wlp5s0 IPv6 03E707466A904C7E-0000000000000003 _matter._tcp local - = wlp5s0 IPv6 8E50A59FAF52A809-0000000000000001 _matter._tcp local - hostname = [E45F010F27530000.local] - address = [fe80::e65f:1ff:fe0f:2753] - port = [5540] - txt = ["T=1" "SAI=300" "SII=5000"] - = wlp5s0 IPv6 03E707466A904C7E-0000000000000003 _matter._tcp local - hostname = [E45F010F27530000.local] - address = [fe80::e65f:1ff:fe0f:2753] - port = [5540] - txt = ["T=1" "SAI=300" "SII=5000"] - disabled: true - - - label: - "Step 11: TH_CR1 opens a commissioning window on DUT_CE using a - commissioning timeout of PIXIT.CADMIN.CwDuration seconds using ECM" - PICS: CADMIN.S.C00.Rsp - verification: | - On TH_CR1 chip tool, open commissioning window using ECM - - ./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: [36217551633] - [1635925713.973120][9695:9700] CHIP:CTL: SetupQRCode: [MT:00000CQM00A7F87ZT10] - [1635925713.973178][9695:9700] CHIP:EM: Sending Standalone Ack for MessageCounter:1964916542 on exchange 31055i - disabled: true - - - label: "Step 12: TH_CR2 starts a commissioning process with DUT_CE" - PICS: CADMIN.S - verification: | - On TH_CR2 using chip tool connect to the accessory - - ./chip-tool pairing code 2 36217551633 --commissioner-name beta - - Verify you got below message on TH_CR2 (chip-tool) side - Device commissioning completed with success - disabled: true - - - label: "Step 13: TH_CR1 reads the list of Fabrics on DUT_CE" - PICS: OPCREDS.S.A0001 - verification: | - On TH_CR1 , read fabrics list - - Verify the list shows FabricIndex=1, FabricIndex=3, FabricIndex=4 on TH_CR1 (chip-tool) side - - ./chip-tool operationalcredentials read fabrics 1 0 --fabric-filtered 0 - - CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003E Attribute 0x0000_0001 DataVersion: 2455995246 - [1647863342.980899][9309:9314] CHIP:TOO: Fabrics: 3 entries - [1647863342.981158][9309:9314] CHIP:TOO: [1]: { - [1647863342.981231][9309:9314] CHIP:TOO: RootPublicKey: 04656F56DBDB677DC957028DFC0ED76709C72753C9194B117A483BDC07386BFD9529B68EB4448FBBA3964EFF37A56A8F461D348B0DAF3B56A75F3B94BF8209D36F - [1647863342.981322][9309:9314] CHIP:TOO: VendorId: 65521 - [1647863342.981380][9309:9314] CHIP:TOO: FabricId: 1 - [1647863342.981434][9309:9314] CHIP:TOO: NodeId: 1 - [1647863342.981486][9309:9314] CHIP:TOO: Label: - [1647863342.981539][9309:9314] CHIP:TOO: FabricIndex: 1 - [1647863342.981594][9309:9314] CHIP:TOO: } - [1647863342.981671][9309:9314] CHIP:TOO: [2]: { - [1647863342.981737][9309:9314] CHIP:TOO: RootPublicKey: 04F8F28D5D70A4510E0F72FBBA31369796C4206FF95D97B77C1BDFD0438A3BE43510631A1B915BE189323F4CC0E015480192654D8170F8F230C7713898962958B7 - [1647863342.981796][9309:9314] CHIP:TOO: VendorId: 65521 - [1647863342.981849][9309:9314] CHIP:TOO: FabricId: 1 - [1647863342.981901][9309:9314] CHIP:TOO: NodeId: 3 - [1647863342.981952][9309:9314] CHIP:TOO: Label: - [1647863342.982005][9309:9314] CHIP:TOO: FabricIndex: 3 - [1647863342.982057][9309:9314] CHIP:TOO: } - [1647863342.982131][9309:9314] CHIP:TOO: [3]: { - [1647863342.982195][9309:9314] CHIP:TOO: RootPublicKey: 04F8F28D5D70A4510E0F72FBBA31369796C4206FF95D97B77C1BDFD0438A3BE43510631A1B915BE189323F4CC0E015480192654D8170F8F230C7713898962958B7 - [1647863342.982252][9309:9314] CHIP:TOO: VendorId: 65521 - [1647863342.982305][9309:9314] CHIP:TOO: FabricId: 1 - [1647863342.982357][9309:9314] CHIP:TOO: NodeId: 2 - [1647863342.982409][9309:9314] CHIP:TOO: Label: - [1647863342.982460][9309:9314] CHIP:TOO: FabricIndex: 4 - [1647863342.982512][9309:9314] CHIP:TOO: } - [1647863342.982738][9309:9314] CHIP:EM: Sending Standalone Ack for MessageCounter:5772016 on exchange 3310i - disabled: true diff --git a/src/python_testing/TC_CADMIN_1_15.py b/src/python_testing/TC_CADMIN_1_15.py new file mode 100644 index 00000000000000..a39589e0d56ce1 --- /dev/null +++ b/src/python_testing/TC_CADMIN_1_15.py @@ -0,0 +1,237 @@ +# +# 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 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# === 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 matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from mobly import asserts + + +class TC_CADMIN_1_15(MatterBaseTest): + async def OpenCommissioningWindow(self, th, expectedErrCode) -> CommissioningParameters: + if expectedErrCode == 0x00: + params = await th.OpenCommissioningWindow( + nodeid=self.dut_node_id, timeout=self.max_window_duration, iteration=10000, discriminator=self.discriminator, option=1) + return params + + else: + ctx = asserts.assert_raises(ChipStackError) + with ctx: + await th.OpenCommissioningWindow( + nodeid=self.dut_node_id, timeout=self.max_window_duration, iteration=10000, discriminator=self.discriminator, option=1) + errcode = ctx.exception.chip_error + 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 == expectedErrCode, + 'Unexpected error code returned from CommissioningComplete') + + async def read_currentfabricindex(self, th: ChipDeviceCtrl) -> int: + cluster = Clusters.Objects.OperationalCredentials + attribute = Clusters.OperationalCredentials.Attributes.CurrentFabricIndex + current_fabric_index = await self.read_single_attribute_check_success(dev_ctrl=th, endpoint=0, cluster=cluster, attribute=attribute) + return current_fabric_index + + async def get_fabrics(self, th: ChipDeviceCtrl) -> int: + OC_cluster = Clusters.OperationalCredentials + fabrics = await self.read_single_attribute_check_success(dev_ctrl=th, fabric_filtered=False, endpoint=0, cluster=OC_cluster, attribute=OC_cluster.Attributes.Fabrics) + return fabrics + + async def CommissionAttempt( + self, setupPinCode: int, thnum: int, th): + + logging.info(f"-----------------Commissioning with TH_CR{str(thnum)}-------------------------") + await th.CommissionOnNetwork( + nodeId=self.dut_node_id, setupPinCode=setupPinCode, + filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=self.discriminator) + + def generate_unique_random_value(self, value): + while True: + random_value = random.randint(10000000, 99999999) + if random_value != value: + return random_value + + def steps_TC_CADMIN_1_15(self) -> list[TestStep]: + return [ + TestStep(1, "Commissioning, already done", is_commissioning=True), + TestStep( + 2, "TH_CR1 gets the MaxCumulativeFailsafeSeconds value from BasicCommissioningInfo attribute in GeneralCommissioning Cluster", + "Should set the MaxCumulativeFailsafeSeconds value from BasicCommissioningInfo attribute to timeout"), + TestStep( + 3, "TH_CR1 reads the Fabrics attribute from the Node Operational Credentials cluster using a non-fabric-filtered read. Save the number of fabrics in the list as initial_number_of_fabrics"), + TestStep( + 4, "TH_CR1 opens commissioning window on DUT with duration set to value for MaxCumulativeFailsafeSeconds", + "Commissioning window should open with timeout set to MaxCumulativeFailsafeSeconds"), + TestStep(5, "TH_CR2 fully commissions DUT_CE", "DUT should fully commission"), + TestStep( + 6, "TH_CR1 opens commissioning window on DUT with duration set to value from BasicCommissioningInfo", "New commissioning window should open and be set to timeout"), + TestStep(7, "TH_CR3 fully commissions DUT_CE", "DUT should fully commission to TH_CR3"), + TestStep(8, "TH_CR2 reads the Fabrics attribute from the Node Operational Credentials cluster using a non-fabric-filtered read", + "Verify the list shows initial_number_of_fabrics + 2 fabrics"), + TestStep(9, "Verify DUT_CE is now discoverable over DNS-SD with 3 Operational service records (_matter._tcp SRV records).", ""), + TestStep(10, "TH_CR2 reads the CurrentFabricIndex from the Node Operational Credentials cluster and saves as fabric_idx_cr2", ""), + TestStep(11, "TH_CR2 sends RemoveFabric with FabricIndex = fabric_idx_cr2 command to DUT_CE", ""), + TestStep(12, "TH_CR2 reads the Basic Information Cluster’s NodeLabel attribute of DUT_CE", "Verify read/write commands fail as expected since the DUT_CE is no longer on the network"), + TestStep(13, "TH_CR1 reads the list of Fabrics on DUT_CE", "Verify the list shows initial_number_of_fabrics + 1 fabrics and fabric_idx_cr2 is not included."), + TestStep(14, "TH_CR1 sends a OpenCommissioningWindow command to DUT_CE using a commissioning timeout of max_window_duration", ""), + TestStep(15, "TH_CR2 commissions DUT_CE", "Commissioning is successful"), + TestStep(16, "TH_CR2 reads the Fabrics attribute from the Node Operational Credentials cluster using a non-fabric-filtered read", + "Verify the list shows initial_number_of_fabrics + 2 fabrics and fabric_idx_cr2 is not included, since a new fabric index should have been allocated."), + TestStep(17, "TH_CR2 reads the CurrentFabricIndex from the Node Operational Credentials cluster and saves as fabric_idx_cr2_2"), + TestStep(18, "TH_CR3 reads the CurrentFabricIndex from the Node Operational Credentials cluster and saves as fabric_idx_cr3"), + TestStep(19, "TH_CR1 sends RemoveFabric with FabricIndex = fabric_idx_cr2_2 command to DUT_CE", "Verify DUT_CE responses with NOCResponse with a StatusCode OK"), + TestStep(20, "TH_CR1 sends RemoveFabric with FabricIndex = fabric_idx_cr3 command to DUT_CE", "Verify DUT_CE responses with NOCResponse with a StatusCode OK"), + TestStep(21, "TH_CR1 reads the list of Fabrics on DUT_CE", "Verify the list shows initial_number_of_fabrics fabrics."), + ] + + def pics_TC_CADMIN_1_15(self) -> list[str]: + return ["CADMIN.S"] + + @async_test_body + async def test_TC_CADMIN_1_15(self): + self.step(1) + + # Establishing TH1 controller + self.th1 = self.default_controller + self.discriminator = random.randint(0, 4095) + + # Establishing TH2 controller + th2_certificate_authority = self.certificate_authority_manager.NewCertificateAuthority() + th2_fabric_admin = th2_certificate_authority.NewFabricAdmin(vendorId=0xFFF1, fabricId=self.th1.fabricId + 1) + self.th2 = th2_fabric_admin.NewController(nodeId=2, useTestCommissioner=True) + + # Establishing TH3 controller + th3_certificate_authority = self.certificate_authority_manager.NewCertificateAuthority() + th3_fabric_admin = th2_certificate_authority.NewFabricAdmin(vendorId=0xFFF1, fabricId=self.th2.fabricId + 1) + self.th3 = th3_fabric_admin.NewController(nodeId=3, useTestCommissioner=True) + + self.step(2) + GC_cluster = Clusters.GeneralCommissioning + attribute = GC_cluster.Attributes.BasicCommissioningInfo + duration = await self.read_single_attribute_check_success(endpoint=0, cluster=GC_cluster, attribute=attribute) + self.max_window_duration = duration.maxCumulativeFailsafeSeconds + + self.step(3) + fabrics = await self.get_fabrics(th=self.th1) + initial_number_of_fabrics = len(fabrics) + + self.step(4) + params = await self.OpenCommissioningWindow(th=self.th1, expectedErrCode=0x00) + setupPinCode = params.setupPinCode + + self.step(5) + await self.CommissionAttempt(setupPinCode, thnum=2, th=self.th2) + + self.step(6) + params2 = await self.OpenCommissioningWindow(th=self.th1, expectedErrCode=0x00) + setupPinCode2 = params2.setupPinCode + + self.step(7) + await self.CommissionAttempt(setupPinCode2, thnum=3, th=self.th3) + + self.step(8) + fabrics = await self.get_fabrics(th=self.th2) + if len(fabrics) != initial_number_of_fabrics + 2: + # len of fabrics is expected to be 3, if 3 not found then we assert failure here + asserts.fail("Expected number of fabrics not correct") + + self.step(9) + # TODO: Currently on hold for impl created by Raul for DNS-SD check of multiple operational service records + + self.step(10) + fabric_idx_cr2 = await self.read_currentfabricindex(th=self.th2) + + self.step(11) + removeFabricCmd = Clusters.OperationalCredentials.Commands.RemoveFabric(fabric_idx_cr2) + await self.th2.SendCommand(nodeid=self.dut_node_id, endpoint=0, payload=removeFabricCmd) + + self.step(12) + # Verifies TH_CR2 is unable to read the Basic Information Cluster’s NodeLabel attribute of DUT_CE as no longer on network + try: + await self.read_single_attribute_check_success( + dev_ctrl=self.th2, + endpoint=0, + cluster=Clusters.BasicInformation, + attribute=Clusters.BasicInformation.Attributes.NodeLabel + ) + asserts.fail("Expected exception not thrown") + except ChipStackError as e: + # Verify that the DUT returns an "Timeout" status response + asserts.assert_equal(e.err, 0x00000032, + "Expected to timeout as DUT_CE is no longer on network") + + self.step(13) + fabrics2 = await self.get_fabrics(th=self.th1) + fabric_indexes = [fabric.fabricIndex for fabric in fabrics2] + if len(fabrics2) != initial_number_of_fabrics + 1: + # len of fabrics is expected to be 3, if 3 not found then we assert failure + asserts.fail(f"Expected number of fabrics not correct, should show 2, but instead shows {str(len(fabrics2))}") + + if 2 in fabric_indexes: + asserts.fail(f"fabricIndexes should consist of indexes 1 and 3 at this point") + + self.step(14) + params3 = await self.OpenCommissioningWindow(self.th1, expectedErrCode=0x00) + setupPinCode3 = params3.setupPinCode + + self.step(15) + await self.CommissionAttempt(setupPinCode3, thnum=2, th=self.th2) + + self.step(16) + fabrics3 = await self.get_fabrics(th=self.th2) + fabric_indexes2 = [fabric.fabricIndex for fabric in fabrics3] + if len(fabrics3) != initial_number_of_fabrics + 2: + # len of fabrics is expected to be 3, if 3 not found then we assert failure + asserts.fail("Expected number of fabrics not correct") + + if 2 in fabric_indexes2: + asserts.fail(f"fabricIndexes should consist of indexes 1, 3, and 4 at this time") + + self.step(17) + fabric_idx_cr2_2 = await self.read_currentfabricindex(th=self.th2) + + self.step(18) + fabric_idx_cr3 = await self.read_currentfabricindex(th=self.th3) + + self.step(19) + removeFabricCmd2 = Clusters.OperationalCredentials.Commands.RemoveFabric(fabric_idx_cr2_2) + await self.th1.SendCommand(nodeid=self.dut_node_id, endpoint=0, payload=removeFabricCmd2) + + self.step(20) + removeFabricCmd3 = Clusters.OperationalCredentials.Commands.RemoveFabric(fabric_idx_cr3) + await self.th1.SendCommand(nodeid=self.dut_node_id, endpoint=0, payload=removeFabricCmd3) + + self.step(21) + fabrics4 = await self.get_fabrics(th=self.th1) + if len(fabrics4) > initial_number_of_fabrics: + asserts.fail(f"Expected number of fabrics not correct, should be {str(initial_number_of_fabrics)}, but instead found {str(len(fabrics4))}") + +if __name__ == "__main__": + default_matter_test_main() \ No newline at end of file From ff650d5cc985137f6fa0f70f72e4a53b91a0a42e Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Tue, 10 Sep 2024 19:02:49 +0000 Subject: [PATCH 02/21] Restyled by autopep8 --- src/python_testing/TC_CADMIN_1_15.py | 44 ++++++++++++++++------------ 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/src/python_testing/TC_CADMIN_1_15.py b/src/python_testing/TC_CADMIN_1_15.py index a39589e0d56ce1..bd3bb5e802b53e 100644 --- a/src/python_testing/TC_CADMIN_1_15.py +++ b/src/python_testing/TC_CADMIN_1_15.py @@ -82,32 +82,36 @@ def steps_TC_CADMIN_1_15(self) -> list[TestStep]: return [ TestStep(1, "Commissioning, already done", is_commissioning=True), TestStep( - 2, "TH_CR1 gets the MaxCumulativeFailsafeSeconds value from BasicCommissioningInfo attribute in GeneralCommissioning Cluster", - "Should set the MaxCumulativeFailsafeSeconds value from BasicCommissioningInfo attribute to timeout"), + 2, "TH_CR1 gets the MaxCumulativeFailsafeSeconds value from BasicCommissioningInfo attribute in GeneralCommissioning Cluster", + "Should set the MaxCumulativeFailsafeSeconds value from BasicCommissioningInfo attribute to timeout"), TestStep( 3, "TH_CR1 reads the Fabrics attribute from the Node Operational Credentials cluster using a non-fabric-filtered read. Save the number of fabrics in the list as initial_number_of_fabrics"), TestStep( - 4, "TH_CR1 opens commissioning window on DUT with duration set to value for MaxCumulativeFailsafeSeconds", - "Commissioning window should open with timeout set to MaxCumulativeFailsafeSeconds"), + 4, "TH_CR1 opens commissioning window on DUT with duration set to value for MaxCumulativeFailsafeSeconds", + "Commissioning window should open with timeout set to MaxCumulativeFailsafeSeconds"), TestStep(5, "TH_CR2 fully commissions DUT_CE", "DUT should fully commission"), TestStep( 6, "TH_CR1 opens commissioning window on DUT with duration set to value from BasicCommissioningInfo", "New commissioning window should open and be set to timeout"), TestStep(7, "TH_CR3 fully commissions DUT_CE", "DUT should fully commission to TH_CR3"), TestStep(8, "TH_CR2 reads the Fabrics attribute from the Node Operational Credentials cluster using a non-fabric-filtered read", - "Verify the list shows initial_number_of_fabrics + 2 fabrics"), + "Verify the list shows initial_number_of_fabrics + 2 fabrics"), TestStep(9, "Verify DUT_CE is now discoverable over DNS-SD with 3 Operational service records (_matter._tcp SRV records).", ""), TestStep(10, "TH_CR2 reads the CurrentFabricIndex from the Node Operational Credentials cluster and saves as fabric_idx_cr2", ""), TestStep(11, "TH_CR2 sends RemoveFabric with FabricIndex = fabric_idx_cr2 command to DUT_CE", ""), - TestStep(12, "TH_CR2 reads the Basic Information Cluster’s NodeLabel attribute of DUT_CE", "Verify read/write commands fail as expected since the DUT_CE is no longer on the network"), - TestStep(13, "TH_CR1 reads the list of Fabrics on DUT_CE", "Verify the list shows initial_number_of_fabrics + 1 fabrics and fabric_idx_cr2 is not included."), + TestStep(12, "TH_CR2 reads the Basic Information Cluster’s NodeLabel attribute of DUT_CE", + "Verify read/write commands fail as expected since the DUT_CE is no longer on the network"), + TestStep(13, "TH_CR1 reads the list of Fabrics on DUT_CE", + "Verify the list shows initial_number_of_fabrics + 1 fabrics and fabric_idx_cr2 is not included."), TestStep(14, "TH_CR1 sends a OpenCommissioningWindow command to DUT_CE using a commissioning timeout of max_window_duration", ""), TestStep(15, "TH_CR2 commissions DUT_CE", "Commissioning is successful"), - TestStep(16, "TH_CR2 reads the Fabrics attribute from the Node Operational Credentials cluster using a non-fabric-filtered read", - "Verify the list shows initial_number_of_fabrics + 2 fabrics and fabric_idx_cr2 is not included, since a new fabric index should have been allocated."), + TestStep(16, "TH_CR2 reads the Fabrics attribute from the Node Operational Credentials cluster using a non-fabric-filtered read", + "Verify the list shows initial_number_of_fabrics + 2 fabrics and fabric_idx_cr2 is not included, since a new fabric index should have been allocated."), TestStep(17, "TH_CR2 reads the CurrentFabricIndex from the Node Operational Credentials cluster and saves as fabric_idx_cr2_2"), TestStep(18, "TH_CR3 reads the CurrentFabricIndex from the Node Operational Credentials cluster and saves as fabric_idx_cr3"), - TestStep(19, "TH_CR1 sends RemoveFabric with FabricIndex = fabric_idx_cr2_2 command to DUT_CE", "Verify DUT_CE responses with NOCResponse with a StatusCode OK"), - TestStep(20, "TH_CR1 sends RemoveFabric with FabricIndex = fabric_idx_cr3 command to DUT_CE", "Verify DUT_CE responses with NOCResponse with a StatusCode OK"), + TestStep(19, "TH_CR1 sends RemoveFabric with FabricIndex = fabric_idx_cr2_2 command to DUT_CE", + "Verify DUT_CE responses with NOCResponse with a StatusCode OK"), + TestStep(20, "TH_CR1 sends RemoveFabric with FabricIndex = fabric_idx_cr3 command to DUT_CE", + "Verify DUT_CE responses with NOCResponse with a StatusCode OK"), TestStep(21, "TH_CR1 reads the list of Fabrics on DUT_CE", "Verify the list shows initial_number_of_fabrics fabrics."), ] @@ -122,12 +126,12 @@ async def test_TC_CADMIN_1_15(self): self.th1 = self.default_controller self.discriminator = random.randint(0, 4095) - # Establishing TH2 controller + # Establishing TH2 controller th2_certificate_authority = self.certificate_authority_manager.NewCertificateAuthority() th2_fabric_admin = th2_certificate_authority.NewFabricAdmin(vendorId=0xFFF1, fabricId=self.th1.fabricId + 1) self.th2 = th2_fabric_admin.NewController(nodeId=2, useTestCommissioner=True) - # Establishing TH3 controller + # Establishing TH3 controller th3_certificate_authority = self.certificate_authority_manager.NewCertificateAuthority() th3_fabric_admin = th2_certificate_authority.NewFabricAdmin(vendorId=0xFFF1, fabricId=self.th2.fabricId + 1) self.th3 = th3_fabric_admin.NewController(nodeId=3, useTestCommissioner=True) @@ -163,8 +167,8 @@ async def test_TC_CADMIN_1_15(self): asserts.fail("Expected number of fabrics not correct") self.step(9) - # TODO: Currently on hold for impl created by Raul for DNS-SD check of multiple operational service records - + # TODO: Currently on hold for impl created by Raul for DNS-SD check of multiple operational service records + self.step(10) fabric_idx_cr2 = await self.read_currentfabricindex(th=self.th2) @@ -177,8 +181,8 @@ async def test_TC_CADMIN_1_15(self): try: await self.read_single_attribute_check_success( dev_ctrl=self.th2, - endpoint=0, - cluster=Clusters.BasicInformation, + endpoint=0, + cluster=Clusters.BasicInformation, attribute=Clusters.BasicInformation.Attributes.NodeLabel ) asserts.fail("Expected exception not thrown") @@ -231,7 +235,9 @@ async def test_TC_CADMIN_1_15(self): self.step(21) fabrics4 = await self.get_fabrics(th=self.th1) if len(fabrics4) > initial_number_of_fabrics: - asserts.fail(f"Expected number of fabrics not correct, should be {str(initial_number_of_fabrics)}, but instead found {str(len(fabrics4))}") + asserts.fail( + f"Expected number of fabrics not correct, should be {str(initial_number_of_fabrics)}, but instead found {str(len(fabrics4))}") + if __name__ == "__main__": - default_matter_test_main() \ No newline at end of file + default_matter_test_main() From ed04de6369ad83055062d5f21e7d4ce5c8976ceb Mon Sep 17 00:00:00 2001 From: Jake Ororke Date: Tue, 10 Sep 2024 14:38:09 -0700 Subject: [PATCH 03/21] Updating TC_CADMIN_1_15 test module: - Fixing linting errors --- src/python_testing/TC_CADMIN_1_15.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/python_testing/TC_CADMIN_1_15.py b/src/python_testing/TC_CADMIN_1_15.py index bd3bb5e802b53e..7917c55cc3cbcf 100644 --- a/src/python_testing/TC_CADMIN_1_15.py +++ b/src/python_testing/TC_CADMIN_1_15.py @@ -25,7 +25,6 @@ import logging import random -from time import sleep import chip.clusters as Clusters from chip import ChipDeviceCtrl @@ -133,7 +132,7 @@ async def test_TC_CADMIN_1_15(self): # Establishing TH3 controller th3_certificate_authority = self.certificate_authority_manager.NewCertificateAuthority() - th3_fabric_admin = th2_certificate_authority.NewFabricAdmin(vendorId=0xFFF1, fabricId=self.th2.fabricId + 1) + th3_fabric_admin = th3_certificate_authority.NewFabricAdmin(vendorId=0xFFF1, fabricId=self.th2.fabricId + 1) self.th3 = th3_fabric_admin.NewController(nodeId=3, useTestCommissioner=True) self.step(2) From cdad862a0866d16d080ba51d3e8ee9ae7b06d9f2 Mon Sep 17 00:00:00 2001 From: Jake Ororke Date: Tue, 10 Sep 2024 15:10:56 -0700 Subject: [PATCH 04/21] Updated TC_CADMIN_1_15 test module: - Made minor linting fixes --- src/python_testing/TC_CADMIN_1_15.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/python_testing/TC_CADMIN_1_15.py b/src/python_testing/TC_CADMIN_1_15.py index 7917c55cc3cbcf..0f22d8f4be483e 100644 --- a/src/python_testing/TC_CADMIN_1_15.py +++ b/src/python_testing/TC_CADMIN_1_15.py @@ -198,7 +198,7 @@ async def test_TC_CADMIN_1_15(self): asserts.fail(f"Expected number of fabrics not correct, should show 2, but instead shows {str(len(fabrics2))}") if 2 in fabric_indexes: - asserts.fail(f"fabricIndexes should consist of indexes 1 and 3 at this point") + asserts.fail("fabricIndexes should consist of indexes 1 and 3 at this point") self.step(14) params3 = await self.OpenCommissioningWindow(self.th1, expectedErrCode=0x00) @@ -215,7 +215,7 @@ async def test_TC_CADMIN_1_15(self): asserts.fail("Expected number of fabrics not correct") if 2 in fabric_indexes2: - asserts.fail(f"fabricIndexes should consist of indexes 1, 3, and 4 at this time") + asserts.fail("fabricIndexes should consist of indexes 1, 3, and 4 at this time") self.step(17) fabric_idx_cr2_2 = await self.read_currentfabricindex(th=self.th2) From a62f7c6789bd586eb6ba439bc5af47b79005adde Mon Sep 17 00:00:00 2001 From: Jake Ororke Date: Wed, 11 Sep 2024 09:40:01 -0700 Subject: [PATCH 05/21] Updated TC_CADMIN_1_15 test module: - Updated comment verbage to correct information - Updated and removed some expected results for test steps as necessary --- src/python_testing/TC_CADMIN_1_15.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/python_testing/TC_CADMIN_1_15.py b/src/python_testing/TC_CADMIN_1_15.py index 0f22d8f4be483e..9c720205abe548 100644 --- a/src/python_testing/TC_CADMIN_1_15.py +++ b/src/python_testing/TC_CADMIN_1_15.py @@ -94,24 +94,26 @@ def steps_TC_CADMIN_1_15(self) -> list[TestStep]: TestStep(7, "TH_CR3 fully commissions DUT_CE", "DUT should fully commission to TH_CR3"), TestStep(8, "TH_CR2 reads the Fabrics attribute from the Node Operational Credentials cluster using a non-fabric-filtered read", "Verify the list shows initial_number_of_fabrics + 2 fabrics"), - TestStep(9, "Verify DUT_CE is now discoverable over DNS-SD with 3 Operational service records (_matter._tcp SRV records).", ""), - TestStep(10, "TH_CR2 reads the CurrentFabricIndex from the Node Operational Credentials cluster and saves as fabric_idx_cr2", ""), - TestStep(11, "TH_CR2 sends RemoveFabric with FabricIndex = fabric_idx_cr2 command to DUT_CE", ""), + TestStep(9, "Verify DUT_CE is now discoverable over DNS-SD with 3 Operational service records (_matter._tcp SRV records)."), + TestStep(10, "TH_CR2 reads the CurrentFabricIndex from the Node Operational Credentials cluster and saves as fabric_idx_cr2"), + TestStep(11, "TH_CR2 sends RemoveFabric with FabricIndex = fabric_idx_cr2 command to DUT_CE", + "Verify DUT_CE responses with NOCResponse with a StatusCode OK"), TestStep(12, "TH_CR2 reads the Basic Information Cluster’s NodeLabel attribute of DUT_CE", - "Verify read/write commands fail as expected since the DUT_CE is no longer on the network"), + "Verify read/write commands fail as expected since the DUT_CE is no longer on the network"), TestStep(13, "TH_CR1 reads the list of Fabrics on DUT_CE", - "Verify the list shows initial_number_of_fabrics + 1 fabrics and fabric_idx_cr2 is not included."), - TestStep(14, "TH_CR1 sends a OpenCommissioningWindow command to DUT_CE using a commissioning timeout of max_window_duration", ""), + "Verify the list shows initial_number_of_fabrics + 1 fabrics and fabric_idx_cr2 is not included."), + TestStep(14, "TH_CR1 sends a OpenCommissioningWindow command to DUT_CE using a commissioning timeout of max_window_duration"), TestStep(15, "TH_CR2 commissions DUT_CE", "Commissioning is successful"), TestStep(16, "TH_CR2 reads the Fabrics attribute from the Node Operational Credentials cluster using a non-fabric-filtered read", - "Verify the list shows initial_number_of_fabrics + 2 fabrics and fabric_idx_cr2 is not included, since a new fabric index should have been allocated."), + "Verify the list shows initial_number_of_fabrics + 2 fabrics and fabric_idx_cr2 is not included, since a new fabric index should have been allocated."), TestStep(17, "TH_CR2 reads the CurrentFabricIndex from the Node Operational Credentials cluster and saves as fabric_idx_cr2_2"), TestStep(18, "TH_CR3 reads the CurrentFabricIndex from the Node Operational Credentials cluster and saves as fabric_idx_cr3"), TestStep(19, "TH_CR1 sends RemoveFabric with FabricIndex = fabric_idx_cr2_2 command to DUT_CE", - "Verify DUT_CE responses with NOCResponse with a StatusCode OK"), + "Verify DUT_CE responses with NOCResponse with a StatusCode OK"), TestStep(20, "TH_CR1 sends RemoveFabric with FabricIndex = fabric_idx_cr3 command to DUT_CE", - "Verify DUT_CE responses with NOCResponse with a StatusCode OK"), - TestStep(21, "TH_CR1 reads the list of Fabrics on DUT_CE", "Verify the list shows initial_number_of_fabrics fabrics."), + "Verify DUT_CE responses with NOCResponse with a StatusCode OK"), + TestStep(21, "TH_CR1 reads the list of Fabrics on DUT_CE", + "Verify the list shows initial_number_of_fabrics fabrics."), ] def pics_TC_CADMIN_1_15(self) -> list[str]: @@ -194,7 +196,7 @@ async def test_TC_CADMIN_1_15(self): fabrics2 = await self.get_fabrics(th=self.th1) fabric_indexes = [fabric.fabricIndex for fabric in fabrics2] if len(fabrics2) != initial_number_of_fabrics + 1: - # len of fabrics is expected to be 3, if 3 not found then we assert failure + # len of fabrics is expected to be 2, if 2 not found then we assert failure asserts.fail(f"Expected number of fabrics not correct, should show 2, but instead shows {str(len(fabrics2))}") if 2 in fabric_indexes: From 9aa34557815c9df30af72c9346939ad9a9c8fe83 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Wed, 11 Sep 2024 16:42:10 +0000 Subject: [PATCH 06/21] Restyled by autopep8 --- src/python_testing/TC_CADMIN_1_15.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/python_testing/TC_CADMIN_1_15.py b/src/python_testing/TC_CADMIN_1_15.py index 9c720205abe548..73f0eb4dfa5874 100644 --- a/src/python_testing/TC_CADMIN_1_15.py +++ b/src/python_testing/TC_CADMIN_1_15.py @@ -96,24 +96,24 @@ def steps_TC_CADMIN_1_15(self) -> list[TestStep]: "Verify the list shows initial_number_of_fabrics + 2 fabrics"), TestStep(9, "Verify DUT_CE is now discoverable over DNS-SD with 3 Operational service records (_matter._tcp SRV records)."), TestStep(10, "TH_CR2 reads the CurrentFabricIndex from the Node Operational Credentials cluster and saves as fabric_idx_cr2"), - TestStep(11, "TH_CR2 sends RemoveFabric with FabricIndex = fabric_idx_cr2 command to DUT_CE", - "Verify DUT_CE responses with NOCResponse with a StatusCode OK"), + TestStep(11, "TH_CR2 sends RemoveFabric with FabricIndex = fabric_idx_cr2 command to DUT_CE", + "Verify DUT_CE responses with NOCResponse with a StatusCode OK"), TestStep(12, "TH_CR2 reads the Basic Information Cluster’s NodeLabel attribute of DUT_CE", - "Verify read/write commands fail as expected since the DUT_CE is no longer on the network"), + "Verify read/write commands fail as expected since the DUT_CE is no longer on the network"), TestStep(13, "TH_CR1 reads the list of Fabrics on DUT_CE", - "Verify the list shows initial_number_of_fabrics + 1 fabrics and fabric_idx_cr2 is not included."), + "Verify the list shows initial_number_of_fabrics + 1 fabrics and fabric_idx_cr2 is not included."), TestStep(14, "TH_CR1 sends a OpenCommissioningWindow command to DUT_CE using a commissioning timeout of max_window_duration"), TestStep(15, "TH_CR2 commissions DUT_CE", "Commissioning is successful"), TestStep(16, "TH_CR2 reads the Fabrics attribute from the Node Operational Credentials cluster using a non-fabric-filtered read", - "Verify the list shows initial_number_of_fabrics + 2 fabrics and fabric_idx_cr2 is not included, since a new fabric index should have been allocated."), + "Verify the list shows initial_number_of_fabrics + 2 fabrics and fabric_idx_cr2 is not included, since a new fabric index should have been allocated."), TestStep(17, "TH_CR2 reads the CurrentFabricIndex from the Node Operational Credentials cluster and saves as fabric_idx_cr2_2"), TestStep(18, "TH_CR3 reads the CurrentFabricIndex from the Node Operational Credentials cluster and saves as fabric_idx_cr3"), TestStep(19, "TH_CR1 sends RemoveFabric with FabricIndex = fabric_idx_cr2_2 command to DUT_CE", - "Verify DUT_CE responses with NOCResponse with a StatusCode OK"), + "Verify DUT_CE responses with NOCResponse with a StatusCode OK"), TestStep(20, "TH_CR1 sends RemoveFabric with FabricIndex = fabric_idx_cr3 command to DUT_CE", - "Verify DUT_CE responses with NOCResponse with a StatusCode OK"), - TestStep(21, "TH_CR1 reads the list of Fabrics on DUT_CE", - "Verify the list shows initial_number_of_fabrics fabrics."), + "Verify DUT_CE responses with NOCResponse with a StatusCode OK"), + TestStep(21, "TH_CR1 reads the list of Fabrics on DUT_CE", + "Verify the list shows initial_number_of_fabrics fabrics."), ] def pics_TC_CADMIN_1_15(self) -> list[str]: From 85944bdc74d1bc9e5df252907a341037d5515762 Mon Sep 17 00:00:00 2001 From: Jake Ororke Date: Mon, 30 Sep 2024 19:36:10 -0700 Subject: [PATCH 07/21] Apply suggestions from code review Added changes from Ceciile to this test module Co-authored-by: C Freeman --- src/python_testing/TC_CADMIN_1_15.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/python_testing/TC_CADMIN_1_15.py b/src/python_testing/TC_CADMIN_1_15.py index 73f0eb4dfa5874..ea6529cd69cd21 100644 --- a/src/python_testing/TC_CADMIN_1_15.py +++ b/src/python_testing/TC_CADMIN_1_15.py @@ -199,7 +199,7 @@ async def test_TC_CADMIN_1_15(self): # len of fabrics is expected to be 2, if 2 not found then we assert failure asserts.fail(f"Expected number of fabrics not correct, should show 2, but instead shows {str(len(fabrics2))}") - if 2 in fabric_indexes: + if fabric_idx_cr2 in fabric_indexes: asserts.fail("fabricIndexes should consist of indexes 1 and 3 at this point") self.step(14) @@ -216,7 +216,7 @@ async def test_TC_CADMIN_1_15(self): # len of fabrics is expected to be 3, if 3 not found then we assert failure asserts.fail("Expected number of fabrics not correct") - if 2 in fabric_indexes2: + if fabric_idx_cr2 in fabric_indexes2: asserts.fail("fabricIndexes should consist of indexes 1, 3, and 4 at this time") self.step(17) From 353f22b75e72b0b20d03a53de7dd1a985d354be1 Mon Sep 17 00:00:00 2001 From: Jake Ororke Date: Mon, 30 Sep 2024 19:48:04 -0700 Subject: [PATCH 08/21] Update TC_CADMIN_1_15 test module - Added type annotations for OpenCommissioningWindow function - Added None type expectedErrorCode variable - Updated test step numbering to match test plan --- src/python_testing/TC_CADMIN_1_15.py | 86 ++++++++++++++-------------- 1 file changed, 42 insertions(+), 44 deletions(-) diff --git a/src/python_testing/TC_CADMIN_1_15.py b/src/python_testing/TC_CADMIN_1_15.py index ea6529cd69cd21..c9567c09e76b2a 100644 --- a/src/python_testing/TC_CADMIN_1_15.py +++ b/src/python_testing/TC_CADMIN_1_15.py @@ -25,6 +25,7 @@ import logging import random +from typing import Optional import chip.clusters as Clusters from chip import ChipDeviceCtrl @@ -35,7 +36,7 @@ class TC_CADMIN_1_15(MatterBaseTest): - async def OpenCommissioningWindow(self, th, expectedErrCode) -> CommissioningParameters: + async def OpenCommissioningWindow(self, th: ChipDeviceCtrl, expectedErrCode: Optional[Clusters.AdministratorCommissioning.Enums.StatusCode] = None) -> CommissioningParameters: if expectedErrCode == 0x00: params = await th.OpenCommissioningWindow( nodeid=self.dut_node_id, timeout=self.max_window_duration, iteration=10000, discriminator=self.discriminator, option=1) @@ -79,40 +80,39 @@ def generate_unique_random_value(self, value): def steps_TC_CADMIN_1_15(self) -> list[TestStep]: return [ - TestStep(1, "Commissioning, already done", is_commissioning=True), TestStep( - 2, "TH_CR1 gets the MaxCumulativeFailsafeSeconds value from BasicCommissioningInfo attribute in GeneralCommissioning Cluster", + 1, "TH_CR1 gets the MaxCumulativeFailsafeSeconds value from BasicCommissioningInfo attribute in GeneralCommissioning Cluster", "Should set the MaxCumulativeFailsafeSeconds value from BasicCommissioningInfo attribute to timeout"), TestStep( - 3, "TH_CR1 reads the Fabrics attribute from the Node Operational Credentials cluster using a non-fabric-filtered read. Save the number of fabrics in the list as initial_number_of_fabrics"), + 2, "TH_CR1 reads the Fabrics attribute from the Node Operational Credentials cluster using a non-fabric-filtered read. Save the number of fabrics in the list as initial_number_of_fabrics"), TestStep( - 4, "TH_CR1 opens commissioning window on DUT with duration set to value for MaxCumulativeFailsafeSeconds", + 3, "TH_CR1 opens commissioning window on DUT with duration set to value for MaxCumulativeFailsafeSeconds", "Commissioning window should open with timeout set to MaxCumulativeFailsafeSeconds"), - TestStep(5, "TH_CR2 fully commissions DUT_CE", "DUT should fully commission"), + TestStep(4, "TH_CR2 fully commissions DUT_CE", "DUT should fully commission"), TestStep( - 6, "TH_CR1 opens commissioning window on DUT with duration set to value from BasicCommissioningInfo", "New commissioning window should open and be set to timeout"), - TestStep(7, "TH_CR3 fully commissions DUT_CE", "DUT should fully commission to TH_CR3"), - TestStep(8, "TH_CR2 reads the Fabrics attribute from the Node Operational Credentials cluster using a non-fabric-filtered read", + 5, "TH_CR1 opens commissioning window on DUT with duration set to value from BasicCommissioningInfo", "New commissioning window should open and be set to timeout"), + TestStep(6, "TH_CR3 fully commissions DUT_CE", "DUT should fully commission to TH_CR3"), + TestStep(7, "TH_CR2 reads the Fabrics attribute from the Node Operational Credentials cluster using a non-fabric-filtered read", "Verify the list shows initial_number_of_fabrics + 2 fabrics"), - TestStep(9, "Verify DUT_CE is now discoverable over DNS-SD with 3 Operational service records (_matter._tcp SRV records)."), - TestStep(10, "TH_CR2 reads the CurrentFabricIndex from the Node Operational Credentials cluster and saves as fabric_idx_cr2"), - TestStep(11, "TH_CR2 sends RemoveFabric with FabricIndex = fabric_idx_cr2 command to DUT_CE", + TestStep(8, "Verify DUT_CE is now discoverable over DNS-SD with 3 Operational service records (_matter._tcp SRV records)."), + TestStep(9, "TH_CR2 reads the CurrentFabricIndex from the Node Operational Credentials cluster and saves as fabric_idx_cr2"), + TestStep(10, "TH_CR2 sends RemoveFabric with FabricIndex = fabric_idx_cr2 command to DUT_CE", "Verify DUT_CE responses with NOCResponse with a StatusCode OK"), - TestStep(12, "TH_CR2 reads the Basic Information Cluster’s NodeLabel attribute of DUT_CE", + TestStep(11, "TH_CR2 reads the Basic Information Cluster’s NodeLabel attribute of DUT_CE", "Verify read/write commands fail as expected since the DUT_CE is no longer on the network"), - TestStep(13, "TH_CR1 reads the list of Fabrics on DUT_CE", + TestStep(12, "TH_CR1 reads the list of Fabrics on DUT_CE", "Verify the list shows initial_number_of_fabrics + 1 fabrics and fabric_idx_cr2 is not included."), - TestStep(14, "TH_CR1 sends a OpenCommissioningWindow command to DUT_CE using a commissioning timeout of max_window_duration"), - TestStep(15, "TH_CR2 commissions DUT_CE", "Commissioning is successful"), - TestStep(16, "TH_CR2 reads the Fabrics attribute from the Node Operational Credentials cluster using a non-fabric-filtered read", + TestStep(13, "TH_CR1 sends a OpenCommissioningWindow command to DUT_CE using a commissioning timeout of max_window_duration"), + TestStep(14, "TH_CR2 commissions DUT_CE", "Commissioning is successful"), + TestStep(15, "TH_CR2 reads the Fabrics attribute from the Node Operational Credentials cluster using a non-fabric-filtered read", "Verify the list shows initial_number_of_fabrics + 2 fabrics and fabric_idx_cr2 is not included, since a new fabric index should have been allocated."), - TestStep(17, "TH_CR2 reads the CurrentFabricIndex from the Node Operational Credentials cluster and saves as fabric_idx_cr2_2"), - TestStep(18, "TH_CR3 reads the CurrentFabricIndex from the Node Operational Credentials cluster and saves as fabric_idx_cr3"), - TestStep(19, "TH_CR1 sends RemoveFabric with FabricIndex = fabric_idx_cr2_2 command to DUT_CE", + TestStep(16, "TH_CR2 reads the CurrentFabricIndex from the Node Operational Credentials cluster and saves as fabric_idx_cr2_2"), + TestStep(17, "TH_CR3 reads the CurrentFabricIndex from the Node Operational Credentials cluster and saves as fabric_idx_cr3"), + TestStep(18, "TH_CR1 sends RemoveFabric with FabricIndex = fabric_idx_cr2_2 command to DUT_CE", "Verify DUT_CE responses with NOCResponse with a StatusCode OK"), - TestStep(20, "TH_CR1 sends RemoveFabric with FabricIndex = fabric_idx_cr3 command to DUT_CE", + TestStep(19, "TH_CR1 sends RemoveFabric with FabricIndex = fabric_idx_cr3 command to DUT_CE", "Verify DUT_CE responses with NOCResponse with a StatusCode OK"), - TestStep(21, "TH_CR1 reads the list of Fabrics on DUT_CE", + TestStep(20, "TH_CR1 reads the list of Fabrics on DUT_CE", "Verify the list shows initial_number_of_fabrics fabrics."), ] @@ -121,8 +121,6 @@ def pics_TC_CADMIN_1_15(self) -> list[str]: @async_test_body async def test_TC_CADMIN_1_15(self): - self.step(1) - # Establishing TH1 controller self.th1 = self.default_controller self.discriminator = random.randint(0, 4095) @@ -137,47 +135,47 @@ async def test_TC_CADMIN_1_15(self): th3_fabric_admin = th3_certificate_authority.NewFabricAdmin(vendorId=0xFFF1, fabricId=self.th2.fabricId + 1) self.th3 = th3_fabric_admin.NewController(nodeId=3, useTestCommissioner=True) - self.step(2) + self.step(1) GC_cluster = Clusters.GeneralCommissioning attribute = GC_cluster.Attributes.BasicCommissioningInfo duration = await self.read_single_attribute_check_success(endpoint=0, cluster=GC_cluster, attribute=attribute) self.max_window_duration = duration.maxCumulativeFailsafeSeconds - self.step(3) + self.step(2) fabrics = await self.get_fabrics(th=self.th1) initial_number_of_fabrics = len(fabrics) - self.step(4) + self.step(3) params = await self.OpenCommissioningWindow(th=self.th1, expectedErrCode=0x00) setupPinCode = params.setupPinCode - self.step(5) + self.step(4) await self.CommissionAttempt(setupPinCode, thnum=2, th=self.th2) - self.step(6) + self.step(5) params2 = await self.OpenCommissioningWindow(th=self.th1, expectedErrCode=0x00) setupPinCode2 = params2.setupPinCode - self.step(7) + self.step(6) await self.CommissionAttempt(setupPinCode2, thnum=3, th=self.th3) - self.step(8) + self.step(7) fabrics = await self.get_fabrics(th=self.th2) if len(fabrics) != initial_number_of_fabrics + 2: # len of fabrics is expected to be 3, if 3 not found then we assert failure here asserts.fail("Expected number of fabrics not correct") - self.step(9) + self.step(8) # TODO: Currently on hold for impl created by Raul for DNS-SD check of multiple operational service records - self.step(10) + self.step(9) fabric_idx_cr2 = await self.read_currentfabricindex(th=self.th2) - self.step(11) + self.step(10) removeFabricCmd = Clusters.OperationalCredentials.Commands.RemoveFabric(fabric_idx_cr2) await self.th2.SendCommand(nodeid=self.dut_node_id, endpoint=0, payload=removeFabricCmd) - self.step(12) + self.step(11) # Verifies TH_CR2 is unable to read the Basic Information Cluster’s NodeLabel attribute of DUT_CE as no longer on network try: await self.read_single_attribute_check_success( @@ -192,7 +190,7 @@ async def test_TC_CADMIN_1_15(self): asserts.assert_equal(e.err, 0x00000032, "Expected to timeout as DUT_CE is no longer on network") - self.step(13) + self.step(12) fabrics2 = await self.get_fabrics(th=self.th1) fabric_indexes = [fabric.fabricIndex for fabric in fabrics2] if len(fabrics2) != initial_number_of_fabrics + 1: @@ -202,14 +200,14 @@ async def test_TC_CADMIN_1_15(self): if fabric_idx_cr2 in fabric_indexes: asserts.fail("fabricIndexes should consist of indexes 1 and 3 at this point") - self.step(14) + self.step(13) params3 = await self.OpenCommissioningWindow(self.th1, expectedErrCode=0x00) setupPinCode3 = params3.setupPinCode - self.step(15) + self.step(14) await self.CommissionAttempt(setupPinCode3, thnum=2, th=self.th2) - self.step(16) + self.step(15) fabrics3 = await self.get_fabrics(th=self.th2) fabric_indexes2 = [fabric.fabricIndex for fabric in fabrics3] if len(fabrics3) != initial_number_of_fabrics + 2: @@ -219,21 +217,21 @@ async def test_TC_CADMIN_1_15(self): if fabric_idx_cr2 in fabric_indexes2: asserts.fail("fabricIndexes should consist of indexes 1, 3, and 4 at this time") - self.step(17) + self.step(16) fabric_idx_cr2_2 = await self.read_currentfabricindex(th=self.th2) - self.step(18) + self.step(17) fabric_idx_cr3 = await self.read_currentfabricindex(th=self.th3) - self.step(19) + self.step(18) removeFabricCmd2 = Clusters.OperationalCredentials.Commands.RemoveFabric(fabric_idx_cr2_2) await self.th1.SendCommand(nodeid=self.dut_node_id, endpoint=0, payload=removeFabricCmd2) - self.step(20) + self.step(19) removeFabricCmd3 = Clusters.OperationalCredentials.Commands.RemoveFabric(fabric_idx_cr3) await self.th1.SendCommand(nodeid=self.dut_node_id, endpoint=0, payload=removeFabricCmd3) - self.step(21) + self.step(20) fabrics4 = await self.get_fabrics(th=self.th1) if len(fabrics4) > initial_number_of_fabrics: asserts.fail( From ecbd5985f4f0a589a3c5ec26fb838cabbf6c798c Mon Sep 17 00:00:00 2001 From: Jake Ororke Date: Mon, 30 Sep 2024 19:51:41 -0700 Subject: [PATCH 09/21] Update TC_CADMIN_1_15 test module: - Updated test step 15 failure assertion to not start from number 1, but instead to correctly make sure that fabric_idx_cr2 does not exist in current fabric indexes list --- src/python_testing/TC_CADMIN_1_15.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python_testing/TC_CADMIN_1_15.py b/src/python_testing/TC_CADMIN_1_15.py index c9567c09e76b2a..6655d7a0ea984a 100644 --- a/src/python_testing/TC_CADMIN_1_15.py +++ b/src/python_testing/TC_CADMIN_1_15.py @@ -215,7 +215,7 @@ async def test_TC_CADMIN_1_15(self): asserts.fail("Expected number of fabrics not correct") if fabric_idx_cr2 in fabric_indexes2: - asserts.fail("fabricIndexes should consist of indexes 1, 3, and 4 at this time") + asserts.fail("fabricIndexes should not consist of fabric_idx_cr2, but it appears it was") self.step(16) fabric_idx_cr2_2 = await self.read_currentfabricindex(th=self.th2) From 89303b32c0222ccc5754b026507316bd7c7a52a3 Mon Sep 17 00:00:00 2001 From: Jake Ororke Date: Wed, 22 Jan 2025 13:45:13 -0800 Subject: [PATCH 10/21] Updating TC_CADMIN_1_15 test module: - Implementing DNS-SD feature from Raul to cover test step 8 --- src/python_testing/TC_CADMIN_1_15.py | 49 ++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/src/python_testing/TC_CADMIN_1_15.py b/src/python_testing/TC_CADMIN_1_15.py index 6655d7a0ea984a..dd8e885c5c8b70 100644 --- a/src/python_testing/TC_CADMIN_1_15.py +++ b/src/python_testing/TC_CADMIN_1_15.py @@ -15,12 +15,20 @@ # 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 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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 +# factory-reset: true +# quiet: false # === END CI TEST ARGUMENTS === import logging @@ -31,7 +39,8 @@ from chip import ChipDeviceCtrl from chip.ChipDeviceCtrl import CommissioningParameters from chip.exceptions import ChipStackError -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from mdns_discovery.mdns_discovery import DNSRecordType, MdnsDiscovery, MdnsServiceType from mobly import asserts @@ -72,12 +81,6 @@ async def CommissionAttempt( nodeId=self.dut_node_id, setupPinCode=setupPinCode, filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=self.discriminator) - def generate_unique_random_value(self, value): - while True: - random_value = random.randint(10000000, 99999999) - if random_value != value: - return random_value - def steps_TC_CADMIN_1_15(self) -> list[TestStep]: return [ TestStep( @@ -166,7 +169,25 @@ async def test_TC_CADMIN_1_15(self): asserts.fail("Expected number of fabrics not correct") self.step(8) - # TODO: Currently on hold for impl created by Raul for DNS-SD check of multiple operational service records + # Gathering instance names and servers associated in order to verify there are 3 service records for DUT. + mdns = MdnsDiscovery() + services = await MdnsDiscovery.get_all_services(mdns, log_output=True) + compressed_fabric_id = self.default_controller.GetCompressedFabricId() + instance_name = f'{compressed_fabric_id:016X}-{self.dut_node_id:016X}' + instance_qname = f"{instance_name}.{MdnsServiceType.OPERATIONAL.value}" + self.print_step("instance qname", instance_qname) + + target_server = None + instance_names = [] + for service in services['_matter._tcp.local.']: + if service.instance_name not in instance_names: + if service.instance_name in instance_qname: + target_server = service.server + + if target_server != None: + instance_names.append(service.instance_name) + + asserts.assert_equal(3, len(instance_names), f"Did not get back the expected number of instances as we expected 3, but got len(instance_names)") self.step(9) fabric_idx_cr2 = await self.read_currentfabricindex(th=self.th2) From 4fc8e508cd113f75c2fb7be449161dd4bf8cea84 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Wed, 22 Jan 2025 21:47:49 +0000 Subject: [PATCH 11/21] Restyled by autopep8 --- src/python_testing/TC_CADMIN_1_15.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/python_testing/TC_CADMIN_1_15.py b/src/python_testing/TC_CADMIN_1_15.py index dd8e885c5c8b70..d50d6ad1218631 100644 --- a/src/python_testing/TC_CADMIN_1_15.py +++ b/src/python_testing/TC_CADMIN_1_15.py @@ -186,8 +186,9 @@ async def test_TC_CADMIN_1_15(self): if target_server != None: instance_names.append(service.instance_name) - - asserts.assert_equal(3, len(instance_names), f"Did not get back the expected number of instances as we expected 3, but got len(instance_names)") + + asserts.assert_equal(3, len(instance_names), + f"Did not get back the expected number of instances as we expected 3, but got len(instance_names)") self.step(9) fabric_idx_cr2 = await self.read_currentfabricindex(th=self.th2) From e32367dd9291b8434beb81f79b2c577d28cb6831 Mon Sep 17 00:00:00 2001 From: Jake Ororke Date: Wed, 22 Jan 2025 14:10:34 -0800 Subject: [PATCH 12/21] Updating TC_CADMIN_1_15 test module: - Resolving linting errors --- src/python_testing/TC_CADMIN_1_15.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/python_testing/TC_CADMIN_1_15.py b/src/python_testing/TC_CADMIN_1_15.py index d50d6ad1218631..a18e56fd265dcd 100644 --- a/src/python_testing/TC_CADMIN_1_15.py +++ b/src/python_testing/TC_CADMIN_1_15.py @@ -40,7 +40,7 @@ from chip.ChipDeviceCtrl import CommissioningParameters from chip.exceptions import ChipStackError from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main -from mdns_discovery.mdns_discovery import DNSRecordType, MdnsDiscovery, MdnsServiceType +from mdns_discovery.mdns_discovery import MdnsDiscovery, MdnsServiceType from mobly import asserts @@ -184,11 +184,11 @@ async def test_TC_CADMIN_1_15(self): if service.instance_name in instance_qname: target_server = service.server - if target_server != None: + if target_server is not None: instance_names.append(service.instance_name) asserts.assert_equal(3, len(instance_names), - f"Did not get back the expected number of instances as we expected 3, but got len(instance_names)") + f"Did not get back the expected number of instances as we expected 3, but got {len(instance_names)}") self.step(9) fabric_idx_cr2 = await self.read_currentfabricindex(th=self.th2) From 20cdc63e672ab51831126de3bfddb700ceb09f3d Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Thu, 23 Jan 2025 17:11:51 +0000 Subject: [PATCH 13/21] Restyled by autopep8 --- src/python_testing/TC_CADMIN_1_15.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python_testing/TC_CADMIN_1_15.py b/src/python_testing/TC_CADMIN_1_15.py index a18e56fd265dcd..2e8f1a77a583ce 100644 --- a/src/python_testing/TC_CADMIN_1_15.py +++ b/src/python_testing/TC_CADMIN_1_15.py @@ -188,7 +188,7 @@ async def test_TC_CADMIN_1_15(self): instance_names.append(service.instance_name) asserts.assert_equal(3, len(instance_names), - f"Did not get back the expected number of instances as we expected 3, but got {len(instance_names)}") + f"Did not get back the expected number of instances as we expected 3, but got {len(instance_names)}") self.step(9) fabric_idx_cr2 = await self.read_currentfabricindex(th=self.th2) From 65311a246b870afd2d2ccc568d266438649f1955 Mon Sep 17 00:00:00 2001 From: Jake Ororke Date: Thu, 23 Jan 2025 13:08:51 -0800 Subject: [PATCH 14/21] Updating TC_CADMIN_1_15 test module: - Changing method for test step 8 as needed --- src/python_testing/TC_CADMIN_1_15.py | 39 ++++++++++++++-------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/src/python_testing/TC_CADMIN_1_15.py b/src/python_testing/TC_CADMIN_1_15.py index 2e8f1a77a583ce..93e12dbc4059e5 100644 --- a/src/python_testing/TC_CADMIN_1_15.py +++ b/src/python_testing/TC_CADMIN_1_15.py @@ -28,7 +28,7 @@ # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto # --PICS src/app/tests/suites/certification/ci-pics-values # factory-reset: true -# quiet: false +# quiet: true # === END CI TEST ARGUMENTS === import logging @@ -171,24 +171,25 @@ async def test_TC_CADMIN_1_15(self): self.step(8) # Gathering instance names and servers associated in order to verify there are 3 service records for DUT. mdns = MdnsDiscovery() - services = await MdnsDiscovery.get_all_services(mdns, log_output=True) - compressed_fabric_id = self.default_controller.GetCompressedFabricId() - instance_name = f'{compressed_fabric_id:016X}-{self.dut_node_id:016X}' - instance_qname = f"{instance_name}.{MdnsServiceType.OPERATIONAL.value}" - self.print_step("instance qname", instance_qname) - - target_server = None - instance_names = [] - for service in services['_matter._tcp.local.']: - if service.instance_name not in instance_names: - if service.instance_name in instance_qname: - target_server = service.server - - if target_server is not None: - instance_names.append(service.instance_name) - - asserts.assert_equal(3, len(instance_names), - f"Did not get back the expected number of instances as we expected 3, but got {len(instance_names)}") + compressed_fabric_ids = { + "th1": self.th1.GetCompressedFabricId(), + "th2": self.th2.GetCompressedFabricId(), + "th3": self.th3.GetCompressedFabricId(), + } + op_services = [] + for th, compressed_id in compressed_fabric_ids.items(): + service = await MdnsDiscovery.get_operational_service( + mdns, + node_id=self.dut_node_id, + compressed_fabric_id=compressed_id, + log_output=True + ) + op_services.append(service.instance_name) + asserts.assert_equal( + 3, + len(op_services), + f"Expected 3 instances but got {len(op_services)}" + ) self.step(9) fabric_idx_cr2 = await self.read_currentfabricindex(th=self.th2) From 6dce5224940009f8d68180cfabccbde3d05e33c5 Mon Sep 17 00:00:00 2001 From: Jake Ororke Date: Thu, 23 Jan 2025 14:12:40 -0800 Subject: [PATCH 15/21] Updating TC_CADMIN_1_15 and mdns_discovery python modules: - Changed discovery to return last entry instead of first entry when run multiple times - Updated TC_CADMIN_1_15 to include Raul's latest changes to mdns_discovery in order to complete test step 8 --- src/python_testing/TC_CADMIN_1_15.py | 6 ++++-- src/python_testing/mdns_discovery/mdns_discovery.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/python_testing/TC_CADMIN_1_15.py b/src/python_testing/TC_CADMIN_1_15.py index 93e12dbc4059e5..833f9db7a3112f 100644 --- a/src/python_testing/TC_CADMIN_1_15.py +++ b/src/python_testing/TC_CADMIN_1_15.py @@ -169,13 +169,14 @@ async def test_TC_CADMIN_1_15(self): asserts.fail("Expected number of fabrics not correct") self.step(8) - # Gathering instance names and servers associated in order to verify there are 3 service records for DUT. + # Gathering instance names associated with compressed fabrics for each TH in order to verify there are 3 operational service records for DUT. mdns = MdnsDiscovery() compressed_fabric_ids = { "th1": self.th1.GetCompressedFabricId(), "th2": self.th2.GetCompressedFabricId(), "th3": self.th3.GetCompressedFabricId(), } + op_services = [] for th, compressed_id in compressed_fabric_ids.items(): service = await MdnsDiscovery.get_operational_service( @@ -185,9 +186,10 @@ async def test_TC_CADMIN_1_15(self): log_output=True ) op_services.append(service.instance_name) + asserts.assert_equal( 3, - len(op_services), + len(set(op_services)), f"Expected 3 instances but got {len(op_services)}" ) diff --git a/src/python_testing/mdns_discovery/mdns_discovery.py b/src/python_testing/mdns_discovery/mdns_discovery.py index 2d7337b622a536..d33ed78e1e406e 100644 --- a/src/python_testing/mdns_discovery/mdns_discovery.py +++ b/src/python_testing/mdns_discovery/mdns_discovery.py @@ -515,7 +515,7 @@ async def _get_service(self, service_type: MdnsServiceType, logger.info("Getting service from discovered services: %s", self._discovered_services) if service_type.value in self._discovered_services: - return self._discovered_services[service_type.value][0] + return self._discovered_services[service_type.value][-1] else: return None From 26187af953ecc54e765e9dd365f11445c9b3736a Mon Sep 17 00:00:00 2001 From: Jake Ororke Date: Thu, 23 Jan 2025 14:32:16 -0800 Subject: [PATCH 16/21] Updating TC_CADMIN_1_15 test module: - Resolving linting error --- src/python_testing/TC_CADMIN_1_15.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python_testing/TC_CADMIN_1_15.py b/src/python_testing/TC_CADMIN_1_15.py index 833f9db7a3112f..1ee3606a9a3f0e 100644 --- a/src/python_testing/TC_CADMIN_1_15.py +++ b/src/python_testing/TC_CADMIN_1_15.py @@ -40,7 +40,7 @@ from chip.ChipDeviceCtrl import CommissioningParameters from chip.exceptions import ChipStackError from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main -from mdns_discovery.mdns_discovery import MdnsDiscovery, MdnsServiceType +from mdns_discovery.mdns_discovery import MdnsDiscovery from mobly import asserts From b75d59e48f74b83d417e525fcaf8a547494fb96a Mon Sep 17 00:00:00 2001 From: Jake Ororke Date: Fri, 24 Jan 2025 05:09:23 -0800 Subject: [PATCH 17/21] Updating mdns_discovery module: - To change to searching discovered_services dictionary values for expected mdns value instead of taking last or first value in list. --- src/python_testing/mdns_discovery/mdns_discovery.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/python_testing/mdns_discovery/mdns_discovery.py b/src/python_testing/mdns_discovery/mdns_discovery.py index d33ed78e1e406e..5bbfaa892e4f6b 100644 --- a/src/python_testing/mdns_discovery/mdns_discovery.py +++ b/src/python_testing/mdns_discovery/mdns_discovery.py @@ -191,7 +191,8 @@ async def get_operational_service(self, raise ValueError("Both node_id and compressed_fabric_id must be provided together or not at all.") self._name_filter = f'{compressed_fabric_id:016x}-{node_id:016x}.{MdnsServiceType.OPERATIONAL.value}'.upper() - return await self._get_service(MdnsServiceType.OPERATIONAL, log_output, discovery_timeout_sec) + logger.info(f"name filter {self._name_filter}") + return await self._get_service(MdnsServiceType.OPERATIONAL, log_output, discovery_timeout_sec, self._name_filter) async def get_border_router_service(self, log_output: bool = False, discovery_timeout_sec: float = DISCOVERY_TIMEOUT_SEC @@ -493,7 +494,8 @@ def _get_instance_name(self, service_info: AsyncServiceInfo) -> str: async def _get_service(self, service_type: MdnsServiceType, log_output: bool, - discovery_timeout_sec: float + discovery_timeout_sec: float, + expected_value: str = None, ) -> Optional[MdnsServiceInfo]: """ Asynchronously discovers a specific type of mDNS service within the network and returns its details. @@ -515,7 +517,12 @@ async def _get_service(self, service_type: MdnsServiceType, logger.info("Getting service from discovered services: %s", self._discovered_services) if service_type.value in self._discovered_services: - return self._discovered_services[service_type.value][-1] + if expected_value is not None: + for service in self._discovered_services[service_type.value]: + if service.service_name == expected_value.replace("._MATTER._TCP.LOCAL.","._matter._tcp.local."): + return service + else: + return self._discovered_services[service_type.value][0] else: return None From 634041a8a593f230d15a126be145272141aac661 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Fri, 24 Jan 2025 13:12:57 +0000 Subject: [PATCH 18/21] Restyled by autopep8 --- src/python_testing/mdns_discovery/mdns_discovery.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/python_testing/mdns_discovery/mdns_discovery.py b/src/python_testing/mdns_discovery/mdns_discovery.py index 5bbfaa892e4f6b..e1406978ebf862 100644 --- a/src/python_testing/mdns_discovery/mdns_discovery.py +++ b/src/python_testing/mdns_discovery/mdns_discovery.py @@ -495,7 +495,7 @@ def _get_instance_name(self, service_info: AsyncServiceInfo) -> str: async def _get_service(self, service_type: MdnsServiceType, log_output: bool, discovery_timeout_sec: float, - expected_value: str = None, + expected_value: str = None, ) -> Optional[MdnsServiceInfo]: """ Asynchronously discovers a specific type of mDNS service within the network and returns its details. @@ -519,7 +519,7 @@ async def _get_service(self, service_type: MdnsServiceType, if service_type.value in self._discovered_services: if expected_value is not None: for service in self._discovered_services[service_type.value]: - if service.service_name == expected_value.replace("._MATTER._TCP.LOCAL.","._matter._tcp.local."): + if service.service_name == expected_value.replace("._MATTER._TCP.LOCAL.", "._matter._tcp.local."): return service else: return self._discovered_services[service_type.value][0] From 2e3b540ac46b5dd9d889dd474ebac517b08d92ac Mon Sep 17 00:00:00 2001 From: Jake Ororke Date: Mon, 24 Feb 2025 10:21:07 -0800 Subject: [PATCH 19/21] Updating manualTests.json and mdns_discovery.py: - Updated manualTests.json to remove Test_TC_CADMIN_1_15 from the list of CADMIN yaml scripts - Updated mdns_discovery module to include description of "expected_value" arg. --- src/app/tests/suites/manualTests.json | 160 ++++++++++++++---- .../mdns_discovery/mdns_discovery.py | 1 + 2 files changed, 124 insertions(+), 37 deletions(-) diff --git a/src/app/tests/suites/manualTests.json b/src/app/tests/suites/manualTests.json index c63714edc4317b..574c04ba798c00 100644 --- a/src/app/tests/suites/manualTests.json +++ b/src/app/tests/suites/manualTests.json @@ -55,7 +55,12 @@ "Test_TC_BDX_2_4", "Test_TC_BDX_2_5" ], - "bridge": ["Test_TC_BR_1", "Test_TC_BR_2", "Test_TC_BR_3", "Test_TC_BR_4"], + "bridge": [ + "Test_TC_BR_1", + "Test_TC_BR_2", + "Test_TC_BR_3", + "Test_TC_BR_4" + ], "DeviceAttestation": [ "Test_TC_DA_1_1", "Test_TC_DA_1_3", @@ -108,13 +113,25 @@ "Test_TC_DLOG_2_2", "Test_TC_DLOG_3_1" ], - "Descriptor": ["Test_TC_DESC_2_1"], - "DeviceEnergyManagementMode": ["Test_TC_DEMM_1_2"], - "EnergyEVSEMode": ["Test_TC_EEVSEM_1_2"], + "Descriptor": [ + "Test_TC_DESC_2_1" + ], + "DeviceEnergyManagementMode": [ + "Test_TC_DEMM_1_2" + ], + "EnergyEVSEMode": [ + "Test_TC_EEVSEM_1_2" + ], "FanControl": [], - "GeneralCommissioning": ["Test_TC_CGEN_2_2"], - "GeneralDiagnostics": ["Test_TC_DGGEN_2_2"], - "Identify": ["Test_TC_I_3_2"], + "GeneralCommissioning": [ + "Test_TC_CGEN_2_2" + ], + "GeneralDiagnostics": [ + "Test_TC_DGGEN_2_2" + ], + "Identify": [ + "Test_TC_I_3_2" + ], "IcdManagement": [], "IlluminanceMeasurement": [], "InteractionDataModel": [ @@ -170,7 +187,6 @@ "Test_TC_CADMIN_1_8", "Test_TC_CADMIN_1_12", "Test_TC_CADMIN_1_14", - "Test_TC_CADMIN_1_15", "Test_TC_CADMIN_1_16", "Test_TC_CADMIN_1_17", "Test_TC_CADMIN_1_18", @@ -185,7 +201,11 @@ "Test_TC_CADMIN_1_25", "Test_TC_CADMIN_1_26" ], - "ModeSelect": ["Test_TC_MOD_1_2", "Test_TC_MOD_1_3", "Test_TC_MOD_2_2"], + "ModeSelect": [ + "Test_TC_MOD_1_2", + "Test_TC_MOD_1_3", + "Test_TC_MOD_2_2" + ], "OTASoftwareUpdate": [ "Test_TC_SU_1_1", "Test_TC_SU_2_1", @@ -203,7 +223,9 @@ "Test_TC_SU_4_1", "Test_TC_SU_4_2" ], - "PowerSourceConfiguration": ["Test_TC_PSCFG_2_2"], + "PowerSourceConfiguration": [ + "Test_TC_PSCFG_2_2" + ], "PressureMeasurement": [], "SecureChannel": [ "Test_TC_SC_1_1", @@ -236,13 +258,25 @@ "Test_TC_DGSW_2_3" ], "EthernetNetworkDiagnostics": [], - "WiFiNetworkDiagnostics": ["Test_TC_DGWIFI_2_2"], + "WiFiNetworkDiagnostics": [ + "Test_TC_DGWIFI_2_2" + ], "WindowCovering": [], - "FlowMeasurement": ["Test_TC_FLW_2_2"], - "GroupKeyManagement": ["Test_TC_GRPKEY_5_4"], - "OccupancySensing": ["Test_TC_OCC_3_1"], - "PowerSource": ["Test_TC_PS_2_2"], - "BooleanState": ["Test_TC_BOOL_2_2"], + "FlowMeasurement": [ + "Test_TC_FLW_2_2" + ], + "GroupKeyManagement": [ + "Test_TC_GRPKEY_5_4" + ], + "OccupancySensing": [ + "Test_TC_OCC_3_1" + ], + "PowerSource": [ + "Test_TC_PS_2_2" + ], + "BooleanState": [ + "Test_TC_BOOL_2_2" + ], "ColorControl": [ "Test_TC_CC_3_1", "Test_TC_CC_7_1", @@ -250,34 +284,74 @@ "Test_TC_CC_9_2", "Test_TC_CC_9_3" ], - "DoorLock": ["Test_TC_DRLK_2_10", "Test_TC_DRLK_3_2"], - "DeviceEnergyManagement": ["Test_TC_DEM_1_1"], + "DoorLock": [ + "Test_TC_DRLK_2_10", + "Test_TC_DRLK_3_2" + ], + "DeviceEnergyManagement": [ + "Test_TC_DEM_1_1" + ], "LocalizationConfiguration": [], "LevelControl": [], - "LaundryWasherMode": ["Test_TC_LWM_1_2"], - "OnOff": ["Test_TC_OO_2_3"], - "RelativeHumidityMeasurement": ["Test_TC_RH_2_2"], + "LaundryWasherMode": [ + "Test_TC_LWM_1_2" + ], + "OnOff": [ + "Test_TC_OO_2_3" + ], + "RelativeHumidityMeasurement": [ + "Test_TC_RH_2_2" + ], "SmokeCOAlarm": [], - "RefrigeratorAlarm": ["Test_TC_REFALM_2_2", "Test_TC_REFALM_2_3"], - "RVCCleanMode": ["Test_TC_RVCCLEANM_3_3"], - "RVCOperationalState": ["Test_TC_RVCOPSTATE_2_2"], - "RVCRunMode": ["Test_TC_RVCRUNM_3_3"], + "RefrigeratorAlarm": [ + "Test_TC_REFALM_2_2", + "Test_TC_REFALM_2_3" + ], + "RVCCleanMode": [ + "Test_TC_RVCCLEANM_3_3" + ], + "RVCOperationalState": [ + "Test_TC_RVCOPSTATE_2_2" + ], + "RVCRunMode": [ + "Test_TC_RVCRUNM_3_3" + ], "TemperatureControlledCabinetMode": [ "Test_TC_TCCM_1_2", "Test_TC_TCCM_2_1" ], - "Switch": ["Test_TC_SWTCH_3_2"], + "Switch": [ + "Test_TC_SWTCH_3_2" + ], "TemperatureControl": [], - "TemperatureMeasurement": ["Test_TC_TMP_2_2"], - "Thermostat": ["Test_TC_TSTAT_3_2"], + "TemperatureMeasurement": [ + "Test_TC_TMP_2_2" + ], + "Thermostat": [ + "Test_TC_TSTAT_3_2" + ], "ThermostatUserConfiguration": [], - "ThreadNetworkDiagnostics": ["Test_TC_DGTHREAD_2_5"], - "Actions": ["Test_TC_ACT_2_1", "Test_TC_ACT_2_2", "Test_TC_ACT_3_2"], + "ThreadNetworkDiagnostics": [ + "Test_TC_DGTHREAD_2_5" + ], + "Actions": [ + "Test_TC_ACT_2_1", + "Test_TC_ACT_2_2", + "Test_TC_ACT_3_2" + ], "TimeFormatLocalization": [], "TimeSynchronization": [], "UnitLocalization": [], - "Binding": ["Test_TC_BIND_2_1", "Test_TC_BIND_2_2", "Test_TC_BIND_2_3"], - "ScenesManagement": ["Test_TC_S_2_5", "Test_TC_S_2_6", "Test_TC_S_3_1"], + "Binding": [ + "Test_TC_BIND_2_1", + "Test_TC_BIND_2_2", + "Test_TC_BIND_2_3" + ], + "ScenesManagement": [ + "Test_TC_S_2_5", + "Test_TC_S_2_6", + "Test_TC_S_3_1" + ], "PumpConfigurationControl": [], "AccessControl": [], "UserLabel": [], @@ -286,11 +360,23 @@ "Test_TC_BRBINFO_3_1" ], "LaundryWasherControl": [], - "OvenMode": ["Test_TC_OTCCM_1_2", "Test_TC_OTCCM_3_2", "Test_TC_OTCCM_3_3"], + "OvenMode": [ + "Test_TC_OTCCM_1_2", + "Test_TC_OTCCM_3_2", + "Test_TC_OTCCM_3_3" + ], "AccessControlEnforcement": [], - "OvenMode": ["Test_TC_OTCCM_1_1", "Test_TC_OTCCM_1_2"], - "EnergyEVSE": ["Test_TC_EEVSE_1_1", "Test_TC_EEVSE_2_1"], - "PowerTopology": ["Test_TC_PWRTL_1_1"], + "OvenMode": [ + "Test_TC_OTCCM_1_1", + "Test_TC_OTCCM_1_2" + ], + "EnergyEVSE": [ + "Test_TC_EEVSE_1_1", + "Test_TC_EEVSE_2_1" + ], + "PowerTopology": [ + "Test_TC_PWRTL_1_1" + ], "collection": [ "DeviceDiscovery", "Groups", @@ -365,4 +451,4 @@ "AccessControlEnforcement", "LaundryWasherControl" ] -} +} \ No newline at end of file diff --git a/src/python_testing/mdns_discovery/mdns_discovery.py b/src/python_testing/mdns_discovery/mdns_discovery.py index 2cd56b3e3d7fb2..d36b3973b9815e 100644 --- a/src/python_testing/mdns_discovery/mdns_discovery.py +++ b/src/python_testing/mdns_discovery/mdns_discovery.py @@ -504,6 +504,7 @@ async def _get_service(self, service_type: MdnsServiceType, service_type (MdnsServiceType): The enum representing the type of mDNS service to discover. log_output (bool): Logs the discovered services to the console. Defaults to False. discovery_timeout_sec (float): Defaults to 15 seconds. + expected_value (str): Defaults to none as currently only utilized to gather specific record in multiple discovery records if available Returns: Optional[MdnsServiceInfo]: An instance of MdnsServiceInfo representing the discovered service, if From e79d4eaf723ebd4e631174eb02ba7ce9f3ddc33e Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Mon, 24 Feb 2025 18:23:45 +0000 Subject: [PATCH 20/21] Restyled by whitespace --- src/app/tests/suites/manualTests.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/tests/suites/manualTests.json b/src/app/tests/suites/manualTests.json index 574c04ba798c00..30cf70c8965c00 100644 --- a/src/app/tests/suites/manualTests.json +++ b/src/app/tests/suites/manualTests.json @@ -451,4 +451,4 @@ "AccessControlEnforcement", "LaundryWasherControl" ] -} \ No newline at end of file +} From cc24b6ad33596af422a19456cd2c3f919d0d188b Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Mon, 24 Feb 2025 18:23:50 +0000 Subject: [PATCH 21/21] Restyled by prettier-json --- src/app/tests/suites/manualTests.json | 157 ++++++-------------------- 1 file changed, 35 insertions(+), 122 deletions(-) diff --git a/src/app/tests/suites/manualTests.json b/src/app/tests/suites/manualTests.json index 30cf70c8965c00..9b7a8c747f2abe 100644 --- a/src/app/tests/suites/manualTests.json +++ b/src/app/tests/suites/manualTests.json @@ -55,12 +55,7 @@ "Test_TC_BDX_2_4", "Test_TC_BDX_2_5" ], - "bridge": [ - "Test_TC_BR_1", - "Test_TC_BR_2", - "Test_TC_BR_3", - "Test_TC_BR_4" - ], + "bridge": ["Test_TC_BR_1", "Test_TC_BR_2", "Test_TC_BR_3", "Test_TC_BR_4"], "DeviceAttestation": [ "Test_TC_DA_1_1", "Test_TC_DA_1_3", @@ -113,25 +108,13 @@ "Test_TC_DLOG_2_2", "Test_TC_DLOG_3_1" ], - "Descriptor": [ - "Test_TC_DESC_2_1" - ], - "DeviceEnergyManagementMode": [ - "Test_TC_DEMM_1_2" - ], - "EnergyEVSEMode": [ - "Test_TC_EEVSEM_1_2" - ], + "Descriptor": ["Test_TC_DESC_2_1"], + "DeviceEnergyManagementMode": ["Test_TC_DEMM_1_2"], + "EnergyEVSEMode": ["Test_TC_EEVSEM_1_2"], "FanControl": [], - "GeneralCommissioning": [ - "Test_TC_CGEN_2_2" - ], - "GeneralDiagnostics": [ - "Test_TC_DGGEN_2_2" - ], - "Identify": [ - "Test_TC_I_3_2" - ], + "GeneralCommissioning": ["Test_TC_CGEN_2_2"], + "GeneralDiagnostics": ["Test_TC_DGGEN_2_2"], + "Identify": ["Test_TC_I_3_2"], "IcdManagement": [], "IlluminanceMeasurement": [], "InteractionDataModel": [ @@ -201,11 +184,7 @@ "Test_TC_CADMIN_1_25", "Test_TC_CADMIN_1_26" ], - "ModeSelect": [ - "Test_TC_MOD_1_2", - "Test_TC_MOD_1_3", - "Test_TC_MOD_2_2" - ], + "ModeSelect": ["Test_TC_MOD_1_2", "Test_TC_MOD_1_3", "Test_TC_MOD_2_2"], "OTASoftwareUpdate": [ "Test_TC_SU_1_1", "Test_TC_SU_2_1", @@ -223,9 +202,7 @@ "Test_TC_SU_4_1", "Test_TC_SU_4_2" ], - "PowerSourceConfiguration": [ - "Test_TC_PSCFG_2_2" - ], + "PowerSourceConfiguration": ["Test_TC_PSCFG_2_2"], "PressureMeasurement": [], "SecureChannel": [ "Test_TC_SC_1_1", @@ -258,25 +235,13 @@ "Test_TC_DGSW_2_3" ], "EthernetNetworkDiagnostics": [], - "WiFiNetworkDiagnostics": [ - "Test_TC_DGWIFI_2_2" - ], + "WiFiNetworkDiagnostics": ["Test_TC_DGWIFI_2_2"], "WindowCovering": [], - "FlowMeasurement": [ - "Test_TC_FLW_2_2" - ], - "GroupKeyManagement": [ - "Test_TC_GRPKEY_5_4" - ], - "OccupancySensing": [ - "Test_TC_OCC_3_1" - ], - "PowerSource": [ - "Test_TC_PS_2_2" - ], - "BooleanState": [ - "Test_TC_BOOL_2_2" - ], + "FlowMeasurement": ["Test_TC_FLW_2_2"], + "GroupKeyManagement": ["Test_TC_GRPKEY_5_4"], + "OccupancySensing": ["Test_TC_OCC_3_1"], + "PowerSource": ["Test_TC_PS_2_2"], + "BooleanState": ["Test_TC_BOOL_2_2"], "ColorControl": [ "Test_TC_CC_3_1", "Test_TC_CC_7_1", @@ -284,74 +249,34 @@ "Test_TC_CC_9_2", "Test_TC_CC_9_3" ], - "DoorLock": [ - "Test_TC_DRLK_2_10", - "Test_TC_DRLK_3_2" - ], - "DeviceEnergyManagement": [ - "Test_TC_DEM_1_1" - ], + "DoorLock": ["Test_TC_DRLK_2_10", "Test_TC_DRLK_3_2"], + "DeviceEnergyManagement": ["Test_TC_DEM_1_1"], "LocalizationConfiguration": [], "LevelControl": [], - "LaundryWasherMode": [ - "Test_TC_LWM_1_2" - ], - "OnOff": [ - "Test_TC_OO_2_3" - ], - "RelativeHumidityMeasurement": [ - "Test_TC_RH_2_2" - ], + "LaundryWasherMode": ["Test_TC_LWM_1_2"], + "OnOff": ["Test_TC_OO_2_3"], + "RelativeHumidityMeasurement": ["Test_TC_RH_2_2"], "SmokeCOAlarm": [], - "RefrigeratorAlarm": [ - "Test_TC_REFALM_2_2", - "Test_TC_REFALM_2_3" - ], - "RVCCleanMode": [ - "Test_TC_RVCCLEANM_3_3" - ], - "RVCOperationalState": [ - "Test_TC_RVCOPSTATE_2_2" - ], - "RVCRunMode": [ - "Test_TC_RVCRUNM_3_3" - ], + "RefrigeratorAlarm": ["Test_TC_REFALM_2_2", "Test_TC_REFALM_2_3"], + "RVCCleanMode": ["Test_TC_RVCCLEANM_3_3"], + "RVCOperationalState": ["Test_TC_RVCOPSTATE_2_2"], + "RVCRunMode": ["Test_TC_RVCRUNM_3_3"], "TemperatureControlledCabinetMode": [ "Test_TC_TCCM_1_2", "Test_TC_TCCM_2_1" ], - "Switch": [ - "Test_TC_SWTCH_3_2" - ], + "Switch": ["Test_TC_SWTCH_3_2"], "TemperatureControl": [], - "TemperatureMeasurement": [ - "Test_TC_TMP_2_2" - ], - "Thermostat": [ - "Test_TC_TSTAT_3_2" - ], + "TemperatureMeasurement": ["Test_TC_TMP_2_2"], + "Thermostat": ["Test_TC_TSTAT_3_2"], "ThermostatUserConfiguration": [], - "ThreadNetworkDiagnostics": [ - "Test_TC_DGTHREAD_2_5" - ], - "Actions": [ - "Test_TC_ACT_2_1", - "Test_TC_ACT_2_2", - "Test_TC_ACT_3_2" - ], + "ThreadNetworkDiagnostics": ["Test_TC_DGTHREAD_2_5"], + "Actions": ["Test_TC_ACT_2_1", "Test_TC_ACT_2_2", "Test_TC_ACT_3_2"], "TimeFormatLocalization": [], "TimeSynchronization": [], "UnitLocalization": [], - "Binding": [ - "Test_TC_BIND_2_1", - "Test_TC_BIND_2_2", - "Test_TC_BIND_2_3" - ], - "ScenesManagement": [ - "Test_TC_S_2_5", - "Test_TC_S_2_6", - "Test_TC_S_3_1" - ], + "Binding": ["Test_TC_BIND_2_1", "Test_TC_BIND_2_2", "Test_TC_BIND_2_3"], + "ScenesManagement": ["Test_TC_S_2_5", "Test_TC_S_2_6", "Test_TC_S_3_1"], "PumpConfigurationControl": [], "AccessControl": [], "UserLabel": [], @@ -360,23 +285,11 @@ "Test_TC_BRBINFO_3_1" ], "LaundryWasherControl": [], - "OvenMode": [ - "Test_TC_OTCCM_1_2", - "Test_TC_OTCCM_3_2", - "Test_TC_OTCCM_3_3" - ], + "OvenMode": ["Test_TC_OTCCM_1_2", "Test_TC_OTCCM_3_2", "Test_TC_OTCCM_3_3"], "AccessControlEnforcement": [], - "OvenMode": [ - "Test_TC_OTCCM_1_1", - "Test_TC_OTCCM_1_2" - ], - "EnergyEVSE": [ - "Test_TC_EEVSE_1_1", - "Test_TC_EEVSE_2_1" - ], - "PowerTopology": [ - "Test_TC_PWRTL_1_1" - ], + "OvenMode": ["Test_TC_OTCCM_1_1", "Test_TC_OTCCM_1_2"], + "EnergyEVSE": ["Test_TC_EEVSE_1_1", "Test_TC_EEVSE_2_1"], + "PowerTopology": ["Test_TC_PWRTL_1_1"], "collection": [ "DeviceDiscovery", "Groups",