From 8a214b5871094d6a2e7932d560ae4209609ce928 Mon Sep 17 00:00:00 2001 From: Jake Ororke Date: Mon, 25 Nov 2024 14:16:57 -0800 Subject: [PATCH] [Implementation] Adding get_endpoint functionality to matter_testing support module (#36568) * Incorporating new get_endpoint functionality in matter_testing support module: - Added prior previous get_endpoint functionality from Cecille back to matter_testing support module. - Updating test modules to use new get_endpoint functionality mentioned in issue: https://github.com/project-chip/matter-test-scripts/issues/416 * Restyled by autopep8 * Updated TC_OCC_3_2 to resolve linting errors --------- Co-authored-by: Restyled.io --- src/python_testing/TC_BOOLCFG_2_1.py | 2 +- src/python_testing/TC_BOOLCFG_3_1.py | 2 +- src/python_testing/TC_BOOLCFG_4_1.py | 2 +- src/python_testing/TC_BOOLCFG_4_2.py | 2 +- src/python_testing/TC_BOOLCFG_4_3.py | 2 +- src/python_testing/TC_BOOLCFG_4_4.py | 2 +- src/python_testing/TC_BOOLCFG_5_1.py | 2 +- src/python_testing/TC_BOOLCFG_5_2.py | 2 +- src/python_testing/TC_CADMIN_1_11.py | 2 +- src/python_testing/TC_DEM_2_10.py | 2 +- src/python_testing/TC_DEM_2_2.py | 2 +- src/python_testing/TC_DEM_2_4.py | 2 +- src/python_testing/TC_DGSW_2_1.py | 2 +- src/python_testing/TC_DRLK_2_13.py | 2 +- src/python_testing/TC_DRLK_2_9.py | 2 +- src/python_testing/TC_EEVSE_2_2.py | 2 +- src/python_testing/TC_EEVSE_2_3.py | 2 +- src/python_testing/TC_EEVSE_2_4.py | 2 +- src/python_testing/TC_EEVSE_2_5.py | 2 +- src/python_testing/TC_EEVSE_2_6.py | 2 +- src/python_testing/TC_EEVSE_Utils.py | 2 +- src/python_testing/TC_EWATERHTR_2_2.py | 2 +- src/python_testing/TC_EWATERHTR_2_3.py | 2 +- src/python_testing/TC_FAN_3_1.py | 2 +- src/python_testing/TC_FAN_3_2.py | 3 +-- src/python_testing/TC_FAN_3_3.py | 2 +- src/python_testing/TC_FAN_3_4.py | 2 +- src/python_testing/TC_FAN_3_5.py | 2 +- src/python_testing/TC_LVL_2_3.py | 2 +- src/python_testing/TC_MWOCTRL_2_1.py | 2 +- src/python_testing/TC_MWOCTRL_2_2.py | 2 +- src/python_testing/TC_MWOCTRL_2_4.py | 2 +- src/python_testing/TC_MWOM_1_2.py | 2 +- src/python_testing/TC_OCC_2_1.py | 2 +- src/python_testing/TC_OCC_2_2.py | 2 +- src/python_testing/TC_OCC_2_3.py | 2 +- src/python_testing/TC_OCC_3_1.py | 6 +++--- src/python_testing/TC_OCC_3_2.py | 4 ++-- src/python_testing/TC_OPSTATE_2_1.py | 2 +- src/python_testing/TC_OPSTATE_2_2.py | 2 +- src/python_testing/TC_OPSTATE_2_3.py | 2 +- src/python_testing/TC_OPSTATE_2_4.py | 2 +- src/python_testing/TC_OPSTATE_2_5.py | 2 +- src/python_testing/TC_OPSTATE_2_6.py | 2 +- src/python_testing/TC_OVENOPSTATE_2_1.py | 2 +- src/python_testing/TC_OVENOPSTATE_2_2.py | 2 +- src/python_testing/TC_OVENOPSTATE_2_3.py | 2 +- src/python_testing/TC_OVENOPSTATE_2_4.py | 2 +- src/python_testing/TC_OVENOPSTATE_2_5.py | 2 +- src/python_testing/TC_PS_2_3.py | 2 +- src/python_testing/TC_PWRTL_2_1.py | 2 +- src/python_testing/TC_RVCCLEANM_1_2.py | 2 +- src/python_testing/TC_RVCCLEANM_2_1.py | 2 +- src/python_testing/TC_RVCCLEANM_2_2.py | 2 +- src/python_testing/TC_RVCOPSTATE_2_1.py | 2 +- src/python_testing/TC_RVCOPSTATE_2_3.py | 2 +- src/python_testing/TC_RVCOPSTATE_2_4.py | 2 +- src/python_testing/TC_RVCRUNM_1_2.py | 2 +- src/python_testing/TC_RVCRUNM_2_1.py | 2 +- src/python_testing/TC_RVCRUNM_2_2.py | 2 +- src/python_testing/TC_SEAR_1_2.py | 2 +- src/python_testing/TC_SEAR_1_3.py | 2 +- src/python_testing/TC_SEAR_1_4.py | 2 +- src/python_testing/TC_SEAR_1_5.py | 2 +- src/python_testing/TC_SEAR_1_6.py | 2 +- src/python_testing/TC_SWTCH.py | 10 +++++----- src/python_testing/TC_TSTAT_4_2.py | 2 +- src/python_testing/TC_VALCC_2_1.py | 3 ++- src/python_testing/TC_VALCC_3_1.py | 3 ++- src/python_testing/TC_VALCC_3_2.py | 3 ++- src/python_testing/TC_VALCC_3_3.py | 3 ++- src/python_testing/TC_VALCC_3_4.py | 3 ++- src/python_testing/TC_VALCC_4_1.py | 3 ++- src/python_testing/TC_VALCC_4_2.py | 3 ++- src/python_testing/TC_VALCC_4_3.py | 3 ++- src/python_testing/TC_VALCC_4_4.py | 3 ++- src/python_testing/TC_VALCC_4_5.py | 3 ++- src/python_testing/TC_WHM_1_2.py | 2 +- src/python_testing/TC_WHM_2_1.py | 2 +- .../chip/testing/matter_testing.py | 15 +++++++++++---- 80 files changed, 107 insertions(+), 91 deletions(-) diff --git a/src/python_testing/TC_BOOLCFG_2_1.py b/src/python_testing/TC_BOOLCFG_2_1.py index 2456457ce26ae7..6f7090c0d8a821 100644 --- a/src/python_testing/TC_BOOLCFG_2_1.py +++ b/src/python_testing/TC_BOOLCFG_2_1.py @@ -72,7 +72,7 @@ def pics_TC_BOOLCFG_2_1(self) -> list[str]: @async_test_body async def test_TC_BOOLCFG_2_1(self): - endpoint = self.user_params.get("endpoint", 1) + endpoint = self.get_endpoint(default=1) all_alarm_mode_bitmap_bits = functools.reduce( ior, [b.value for b in Clusters.BooleanStateConfiguration.Bitmaps.AlarmModeBitmap]) all_sensor_fault_bitmap_bits = functools.reduce( diff --git a/src/python_testing/TC_BOOLCFG_3_1.py b/src/python_testing/TC_BOOLCFG_3_1.py index 8ed77f6ba812e5..e305c4a7c8d78e 100644 --- a/src/python_testing/TC_BOOLCFG_3_1.py +++ b/src/python_testing/TC_BOOLCFG_3_1.py @@ -75,7 +75,7 @@ def pics_TC_BOOLCFG_3_1(self) -> list[str]: @async_test_body async def test_TC_BOOLCFG_3_1(self): - endpoint = self.user_params.get("endpoint", 1) + endpoint = self.get_endpoint(default=1) self.step(1) attributes = Clusters.BooleanStateConfiguration.Attributes diff --git a/src/python_testing/TC_BOOLCFG_4_1.py b/src/python_testing/TC_BOOLCFG_4_1.py index dfe6aac340269c..9d7a259547614d 100644 --- a/src/python_testing/TC_BOOLCFG_4_1.py +++ b/src/python_testing/TC_BOOLCFG_4_1.py @@ -67,7 +67,7 @@ def pics_TC_BOOLCFG_4_1(self) -> list[str]: @async_test_body async def test_TC_BOOLCFG_4_1(self): - endpoint = self.user_params.get("endpoint", 1) + endpoint = self.get_endpoint(default=1) self.step(1) attributes = Clusters.BooleanStateConfiguration.Attributes diff --git a/src/python_testing/TC_BOOLCFG_4_2.py b/src/python_testing/TC_BOOLCFG_4_2.py index 093e389dcf41db..53ebb9cbad31e8 100644 --- a/src/python_testing/TC_BOOLCFG_4_2.py +++ b/src/python_testing/TC_BOOLCFG_4_2.py @@ -89,7 +89,7 @@ async def test_TC_BOOLCFG_4_2(self): "the --hex-arg flag as PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY:, " "e.g. --hex-arg PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY:000102030405060708090a0b0c0d0e0f") - endpoint = self.user_params.get("endpoint", 1) + endpoint = self.get_endpoint(default=1) enableKey = self.matter_test_config.global_test_params['PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY'] self.step(1) diff --git a/src/python_testing/TC_BOOLCFG_4_3.py b/src/python_testing/TC_BOOLCFG_4_3.py index 845d8e9d4a9e3f..f487326c774ee3 100644 --- a/src/python_testing/TC_BOOLCFG_4_3.py +++ b/src/python_testing/TC_BOOLCFG_4_3.py @@ -101,7 +101,7 @@ async def test_TC_BOOLCFG_4_3(self): "the --hex-arg flag as PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY:, " "e.g. --hex-arg PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY:000102030405060708090a0b0c0d0e0f") - endpoint = self.user_params.get("endpoint", 1) + endpoint = self.get_endpoint(default=1) enableKey = self.matter_test_config.global_test_params['PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY'] self.step(1) diff --git a/src/python_testing/TC_BOOLCFG_4_4.py b/src/python_testing/TC_BOOLCFG_4_4.py index c585b14a8477b7..eef4b7d21cb8c3 100644 --- a/src/python_testing/TC_BOOLCFG_4_4.py +++ b/src/python_testing/TC_BOOLCFG_4_4.py @@ -93,7 +93,7 @@ async def test_TC_BOOLCFG_4_4(self): "the --hex-arg flag as PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY:, " "e.g. --hex-arg PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY:000102030405060708090a0b0c0d0e0f") - endpoint = self.user_params.get("endpoint", 1) + endpoint = self.get_endpoint(default=1) enableKey = self.matter_test_config.global_test_params['PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY'] self.step(1) diff --git a/src/python_testing/TC_BOOLCFG_5_1.py b/src/python_testing/TC_BOOLCFG_5_1.py index ec31d8341b388c..fcb23017f8f807 100644 --- a/src/python_testing/TC_BOOLCFG_5_1.py +++ b/src/python_testing/TC_BOOLCFG_5_1.py @@ -88,7 +88,7 @@ async def test_TC_BOOLCFG_5_1(self): "the --hex-arg flag as PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY:, " "e.g. --hex-arg PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY:000102030405060708090a0b0c0d0e0f") - endpoint = self.user_params.get("endpoint", 1) + endpoint = self.get_endpoint(default=1) enableKey = self.matter_test_config.global_test_params['PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY'] self.step(1) diff --git a/src/python_testing/TC_BOOLCFG_5_2.py b/src/python_testing/TC_BOOLCFG_5_2.py index fd6b88370d1c41..b790e006c74c7f 100644 --- a/src/python_testing/TC_BOOLCFG_5_2.py +++ b/src/python_testing/TC_BOOLCFG_5_2.py @@ -87,7 +87,7 @@ async def test_TC_BOOLCFG_5_2(self): "the --hex-arg flag as PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY:, " "e.g. --hex-arg PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY:000102030405060708090a0b0c0d0e0f") - endpoint = self.user_params.get("endpoint", 1) + endpoint = self.get_endpoint(default=1) enableKey = self.matter_test_config.global_test_params['PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY'] self.step(1) diff --git a/src/python_testing/TC_CADMIN_1_11.py b/src/python_testing/TC_CADMIN_1_11.py index cefd8b44a785f4..3c818bd3be9926 100644 --- a/src/python_testing/TC_CADMIN_1_11.py +++ b/src/python_testing/TC_CADMIN_1_11.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 === diff --git a/src/python_testing/TC_DEM_2_10.py b/src/python_testing/TC_DEM_2_10.py index 810efdbfa25362..40f44d571ead2d 100644 --- a/src/python_testing/TC_DEM_2_10.py +++ b/src/python_testing/TC_DEM_2_10.py @@ -162,7 +162,7 @@ async def test_TC_DEM_2_10(self): self.step("4") sub_handler = ClusterAttributeChangeAccumulator(Clusters.DeviceEnergyManagement) await sub_handler.start(self.default_controller, self.dut_node_id, - self.matter_test_config.endpoint, + self.get_endpoint(), min_interval_sec=0, max_interval_sec=10, keepSubscriptions=False) diff --git a/src/python_testing/TC_DEM_2_2.py b/src/python_testing/TC_DEM_2_2.py index 168417dd984856..390a7e8b304ad0 100644 --- a/src/python_testing/TC_DEM_2_2.py +++ b/src/python_testing/TC_DEM_2_2.py @@ -181,7 +181,7 @@ async def test_TC_DEM_2_2(self): events_callback = EventChangeCallback(Clusters.DeviceEnergyManagement) await events_callback.start(self.default_controller, self.dut_node_id, - self.matter_test_config.endpoint) + self.get_endpoint(default=1)) self.step("4") await self.check_test_event_triggers_enabled() diff --git a/src/python_testing/TC_DEM_2_4.py b/src/python_testing/TC_DEM_2_4.py index 1b591cd438c3fc..6fc5178ee2e11e 100644 --- a/src/python_testing/TC_DEM_2_4.py +++ b/src/python_testing/TC_DEM_2_4.py @@ -186,7 +186,7 @@ async def test_TC_DEM_2_4(self): events_callback = EventChangeCallback(Clusters.DeviceEnergyManagement) await events_callback.start(self.default_controller, self.dut_node_id, - self.matter_test_config.endpoint) + self.get_endpoint()) self.step("4") await self.check_test_event_triggers_enabled() diff --git a/src/python_testing/TC_DGSW_2_1.py b/src/python_testing/TC_DGSW_2_1.py index 633893272598d5..efc2df95fb24b4 100644 --- a/src/python_testing/TC_DGSW_2_1.py +++ b/src/python_testing/TC_DGSW_2_1.py @@ -74,7 +74,7 @@ def steps_TC_DGSW_2_1(self) -> list[TestStep]: @async_test_body async def test_TC_DGSW_2_1(self): - endpoint = self.user_params.get("endpoint", 0) + endpoint = self.get_endpoint(default=0) # STEP 1: Commission DUT (already done) self.step(1) diff --git a/src/python_testing/TC_DRLK_2_13.py b/src/python_testing/TC_DRLK_2_13.py index 809e2785170ab2..66c6b3313dbece 100644 --- a/src/python_testing/TC_DRLK_2_13.py +++ b/src/python_testing/TC_DRLK_2_13.py @@ -368,7 +368,7 @@ async def test_TC_DRLK_2_13(self): self.groupIdentifier = bytes.fromhex("89d085fc302ca53e279bfcdecdf3c4ad") self.groupResolvingKey = bytes.fromhex("89d0859bfcdecdf3c4adfc302ca53e27") self.common_cluster_endpoint = 0 - self.app_cluster_endpoint = self.matter_test_config.endpoint + self.app_cluster_endpoint = self.get_endpoint(default=1) self.alirouser = "AliroUser" self.alirocredentialissuerkey = bytes.fromhex( "047a4c882d753924cdf3779a3c84fec2debaa6f0b3084450878acc7ddcce7856ae57b1ebbe2561015103dd7474c2a183675378ec55f1e465ac3436bf3dd5ca54d4") diff --git a/src/python_testing/TC_DRLK_2_9.py b/src/python_testing/TC_DRLK_2_9.py index fb294b724f9e82..904d844a3e9917 100644 --- a/src/python_testing/TC_DRLK_2_9.py +++ b/src/python_testing/TC_DRLK_2_9.py @@ -379,7 +379,7 @@ async def test_TC_DRLK_2_9(self): self.maxrfidcodelength = None self.minrfidcodelength = None - self.endpoint = self.user_params.get("endpoint", 1) + self.endpoint = self.get_endpoint(default=1) print("endpoint", self.endpoint) # Aliro Keys for setting Aliro configuration and credential diff --git a/src/python_testing/TC_EEVSE_2_2.py b/src/python_testing/TC_EEVSE_2_2.py index 144bfd82d38037..f51ea308a1fd10 100644 --- a/src/python_testing/TC_EEVSE_2_2.py +++ b/src/python_testing/TC_EEVSE_2_2.py @@ -172,7 +172,7 @@ async def test_TC_EEVSE_2_2(self): events_callback = EventChangeCallback(Clusters.EnergyEvse) await events_callback.start(self.default_controller, self.dut_node_id, - self.matter_test_config.endpoint) + self.get_endpoint()) self.step("2") await self.check_test_event_triggers_enabled() diff --git a/src/python_testing/TC_EEVSE_2_3.py b/src/python_testing/TC_EEVSE_2_3.py index 54c5baa1a7ddff..31083109e9833b 100644 --- a/src/python_testing/TC_EEVSE_2_3.py +++ b/src/python_testing/TC_EEVSE_2_3.py @@ -211,7 +211,7 @@ async def test_TC_EEVSE_2_3(self): events_callback = EventChangeCallback(Clusters.EnergyEvse) await events_callback.start(self.default_controller, self.dut_node_id, - self.matter_test_config.endpoint) + self.get_endpoint()) self.step("2") await self.check_test_event_triggers_enabled() diff --git a/src/python_testing/TC_EEVSE_2_4.py b/src/python_testing/TC_EEVSE_2_4.py index 10355debd0543b..eb5c4a2babafbb 100644 --- a/src/python_testing/TC_EEVSE_2_4.py +++ b/src/python_testing/TC_EEVSE_2_4.py @@ -127,7 +127,7 @@ async def test_TC_EEVSE_2_4(self): events_callback = EventChangeCallback(Clusters.EnergyEvse) await events_callback.start(self.default_controller, self.dut_node_id, - self.matter_test_config.endpoint) + self.get_endpoint()) self.step("2") await self.check_test_event_triggers_enabled() diff --git a/src/python_testing/TC_EEVSE_2_5.py b/src/python_testing/TC_EEVSE_2_5.py index 4571cfb36305f2..aa415a98587e21 100644 --- a/src/python_testing/TC_EEVSE_2_5.py +++ b/src/python_testing/TC_EEVSE_2_5.py @@ -119,7 +119,7 @@ async def test_TC_EEVSE_2_5(self): events_callback = EventChangeCallback(Clusters.EnergyEvse) await events_callback.start(self.default_controller, self.dut_node_id, - self.matter_test_config.endpoint) + self.get_endpoint()) self.step("2") await self.check_test_event_triggers_enabled() diff --git a/src/python_testing/TC_EEVSE_2_6.py b/src/python_testing/TC_EEVSE_2_6.py index d66ff60bf6304b..ec93eceef0e6ae 100644 --- a/src/python_testing/TC_EEVSE_2_6.py +++ b/src/python_testing/TC_EEVSE_2_6.py @@ -149,7 +149,7 @@ async def test_TC_EEVSE_2_6(self): events_callback = EventChangeCallback(Clusters.EnergyEvse) await events_callback.start(self.default_controller, self.dut_node_id, - self.matter_test_config.endpoint) + self.get_endpoint()) self.step("4") await self.check_test_event_triggers_enabled() diff --git a/src/python_testing/TC_EEVSE_Utils.py b/src/python_testing/TC_EEVSE_Utils.py index 244d2e5730f28d..733dfc3b3626ed 100644 --- a/src/python_testing/TC_EEVSE_Utils.py +++ b/src/python_testing/TC_EEVSE_Utils.py @@ -59,7 +59,7 @@ async def get_supported_energy_evse_attributes(self, endpoint: int = None): async def write_user_max_charge(self, endpoint: int = None, user_max_charge: int = 0): if endpoint is None: - endpoint = self.matter_test_config.endpoint + endpoint = self.get_endpoint() result = await self.default_controller.WriteAttribute(self.dut_node_id, [(endpoint, Clusters.EnergyEvse.Attributes.UserMaximumChargeCurrent(user_max_charge))]) diff --git a/src/python_testing/TC_EWATERHTR_2_2.py b/src/python_testing/TC_EWATERHTR_2_2.py index 1bd7185b1f6e60..2c639a7c710d69 100644 --- a/src/python_testing/TC_EWATERHTR_2_2.py +++ b/src/python_testing/TC_EWATERHTR_2_2.py @@ -213,7 +213,7 @@ async def test_TC_EWATERHTR_2_2(self): events_callback = EventChangeCallback(Clusters.WaterHeaterManagement) await events_callback.start(self.default_controller, self.dut_node_id, - self.matter_test_config.endpoint) + self.get_endpoint()) self.step("3") await self.check_test_event_triggers_enabled() diff --git a/src/python_testing/TC_EWATERHTR_2_3.py b/src/python_testing/TC_EWATERHTR_2_3.py index 0f1c3deae690f3..8833a3c58a223d 100644 --- a/src/python_testing/TC_EWATERHTR_2_3.py +++ b/src/python_testing/TC_EWATERHTR_2_3.py @@ -166,7 +166,7 @@ async def test_TC_EWATERHTR_2_3(self): events_callback = EventChangeCallback(Clusters.WaterHeaterManagement) await events_callback.start(self.default_controller, self.dut_node_id, - self.matter_test_config.endpoint) + self.get_endpoint()) self.step("3") await self.check_test_event_triggers_enabled() diff --git a/src/python_testing/TC_FAN_3_1.py b/src/python_testing/TC_FAN_3_1.py index 483be894ba11ed..cc1f28b788a348 100644 --- a/src/python_testing/TC_FAN_3_1.py +++ b/src/python_testing/TC_FAN_3_1.py @@ -73,7 +73,7 @@ def pics_TC_FAN_3_1(self) -> list[str]: @async_test_body async def test_TC_FAN_3_1(self): - endpoint = self.user_params.get("endpoint", 1) + endpoint = self.get_endpoint(default=1) self.print_step(1, "Commissioning, already done") diff --git a/src/python_testing/TC_FAN_3_2.py b/src/python_testing/TC_FAN_3_2.py index 799510eeeadf32..2966e62f120994 100644 --- a/src/python_testing/TC_FAN_3_2.py +++ b/src/python_testing/TC_FAN_3_2.py @@ -72,8 +72,7 @@ async def test_TC_FAN_3_2(self): logger.info("Test skipped because PICS FAN.S.F00 is not set") return - endpoint = self.user_params.get("endpoint", 1) - + endpoint = self.get_endpoint(default=1) self.print_step(1, "Commissioning, already done") self.print_step(2, "Read from the DUT the SpeedSetting attribute and store") diff --git a/src/python_testing/TC_FAN_3_3.py b/src/python_testing/TC_FAN_3_3.py index 7a4dde3f6cb983..055b7db0f0defa 100644 --- a/src/python_testing/TC_FAN_3_3.py +++ b/src/python_testing/TC_FAN_3_3.py @@ -94,7 +94,7 @@ async def test_TC_FAN_3_3(self): self.skip_all_remaining_steps(1) return - endpoint = self.user_params.get("endpoint", 1) + endpoint = self.get_endpoint(default=1) self.step(1) diff --git a/src/python_testing/TC_FAN_3_4.py b/src/python_testing/TC_FAN_3_4.py index 989680ed6b8e0a..168314e6829b7b 100644 --- a/src/python_testing/TC_FAN_3_4.py +++ b/src/python_testing/TC_FAN_3_4.py @@ -94,7 +94,7 @@ async def test_TC_FAN_3_4(self): logger.info("Test skipped because PICS FAN.S.F03 is not set") return - endpoint = self.user_params.get("endpoint", 1) + endpoint = self.get_endpoint(default=1) self.step(1) diff --git a/src/python_testing/TC_FAN_3_5.py b/src/python_testing/TC_FAN_3_5.py index 26dfc3e52f8f22..8c75d7e22c8593 100644 --- a/src/python_testing/TC_FAN_3_5.py +++ b/src/python_testing/TC_FAN_3_5.py @@ -86,7 +86,7 @@ async def test_TC_FAN_3_5(self): logger.info("Test skipped because PICS FAN.S.F04 is not set") return - endpoint = self.user_params.get("endpoint", 1) + endpoint = self.get_endpoint(default=1) # Part 1 diff --git a/src/python_testing/TC_LVL_2_3.py b/src/python_testing/TC_LVL_2_3.py index d120bb7169c17d..9f223677796751 100644 --- a/src/python_testing/TC_LVL_2_3.py +++ b/src/python_testing/TC_LVL_2_3.py @@ -131,7 +131,7 @@ async def test_TC_LVL_2_3(self): self.step(6) sub_handler = ClusterAttributeChangeAccumulator(lvl) - await sub_handler.start(self.default_controller, self.dut_node_id, self.matter_test_config.endpoint) + await sub_handler.start(self.default_controller, self.dut_node_id, self.get_endpoint()) self.step(7) cmd = lvl.Commands.MoveToLevelWithOnOff(level=max_level, transitionTime=100, optionsMask=0, optionsOverride=0) diff --git a/src/python_testing/TC_MWOCTRL_2_1.py b/src/python_testing/TC_MWOCTRL_2_1.py index 6f913578cbcb9a..ed72806dc10ac8 100644 --- a/src/python_testing/TC_MWOCTRL_2_1.py +++ b/src/python_testing/TC_MWOCTRL_2_1.py @@ -107,7 +107,7 @@ def pics_TC_MWOCTRL_2_1(self) -> list[str]: @async_test_body async def test_TC_MWOCTRL_2_1(self): - endpoint = self.user_params.get("endpoint", 1) + endpoint = self.get_endpoint(default=1) self.step(1) attributes = Clusters.MicrowaveOvenControl.Attributes diff --git a/src/python_testing/TC_MWOCTRL_2_2.py b/src/python_testing/TC_MWOCTRL_2_2.py index 45596896405b98..626cecd5cba492 100644 --- a/src/python_testing/TC_MWOCTRL_2_2.py +++ b/src/python_testing/TC_MWOCTRL_2_2.py @@ -106,7 +106,7 @@ def pics_TC_MWOCTRL_2_2(self) -> list[str]: @async_test_body async def test_TC_MWOCTRL_2_2(self): - endpoint = self.user_params.get("endpoint", 1) + endpoint = self.get_endpoint(default=1) self.step(1) attributes = Clusters.MicrowaveOvenControl.Attributes diff --git a/src/python_testing/TC_MWOCTRL_2_4.py b/src/python_testing/TC_MWOCTRL_2_4.py index e05c4a5bd5056c..feadc2621ef211 100644 --- a/src/python_testing/TC_MWOCTRL_2_4.py +++ b/src/python_testing/TC_MWOCTRL_2_4.py @@ -75,7 +75,7 @@ def pics_TC_MWOCTRL_2_4(self) -> list[str]: @async_test_body async def test_TC_MWOCTRL_2_4(self): - endpoint = self.user_params.get("endpoint", 1) + endpoint = self.get_endpoint(default=1) self.step(1) attributes = Clusters.MicrowaveOvenControl.Attributes diff --git a/src/python_testing/TC_MWOM_1_2.py b/src/python_testing/TC_MWOM_1_2.py index 5cad6ce013fed6..c24398eda2ed7b 100644 --- a/src/python_testing/TC_MWOM_1_2.py +++ b/src/python_testing/TC_MWOM_1_2.py @@ -67,7 +67,7 @@ def pics_TC_MWOM_1_2(self) -> list[str]: @async_test_body async def test_TC_MWOM_1_2(self): - endpoint = self.user_params.get("endpoint", 1) + endpoint = self.get_endpoint(default=1) attributes = Clusters.MicrowaveOvenMode.Attributes diff --git a/src/python_testing/TC_OCC_2_1.py b/src/python_testing/TC_OCC_2_1.py index d831d486d27bd2..e1d47e8e5f58ce 100644 --- a/src/python_testing/TC_OCC_2_1.py +++ b/src/python_testing/TC_OCC_2_1.py @@ -83,7 +83,7 @@ def pics_TC_OCC_2_1(self) -> list[str]: @async_test_body async def test_TC_OCC_2_1(self): - endpoint = self.matter_test_config.endpoint + endpoint = self.get_endpoint() cluster = Clusters.Objects.OccupancySensing attributes = cluster.Attributes diff --git a/src/python_testing/TC_OCC_2_2.py b/src/python_testing/TC_OCC_2_2.py index afa2e3cd615031..1ea03896f756df 100644 --- a/src/python_testing/TC_OCC_2_2.py +++ b/src/python_testing/TC_OCC_2_2.py @@ -65,7 +65,7 @@ def pics_TC_OCC_2_2(self) -> list[str]: @async_test_body async def test_TC_OCC_2_2(self): - endpoint = self.matter_test_config.endpoint + endpoint = self.get_endpoint() self.step(1) # Already done, immediately go to step 2 diff --git a/src/python_testing/TC_OCC_2_3.py b/src/python_testing/TC_OCC_2_3.py index 8d4b53f4292c24..0f90c809c3fd3a 100644 --- a/src/python_testing/TC_OCC_2_3.py +++ b/src/python_testing/TC_OCC_2_3.py @@ -46,7 +46,7 @@ class TC_OCC_2_3(MatterBaseTest): async def read_occ_attribute_expect_success(self, attribute): cluster = Clusters.Objects.OccupancySensing - endpoint_id = self.matter_test_config.endpoint + endpoint_id = self.get_endpoint() return await self.read_single_attribute_check_success(endpoint=endpoint_id, cluster=cluster, attribute=attribute) def desc_TC_OCC_2_3(self) -> str: diff --git a/src/python_testing/TC_OCC_3_1.py b/src/python_testing/TC_OCC_3_1.py index cce0a2f697a8d7..2d7fb0e2de05e6 100644 --- a/src/python_testing/TC_OCC_3_1.py +++ b/src/python_testing/TC_OCC_3_1.py @@ -55,13 +55,13 @@ def setup_test(self): async def read_occ_attribute_expect_success(self, attribute): cluster = Clusters.Objects.OccupancySensing - endpoint = self.matter_test_config.endpoint + endpoint = self.get_endpoint() return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attribute) async def write_hold_time(self, hold_time: Optional[Any]) -> Status: dev_ctrl = self.default_controller node_id = self.dut_node_id - endpoint = self.matter_test_config.endpoint + endpoint = self.get_endpoint() cluster = Clusters.OccupancySensing write_result = await dev_ctrl.WriteAttribute(node_id, [(endpoint, cluster.Attributes.HoldTime(hold_time))]) @@ -144,7 +144,7 @@ async def test_TC_OCC_3_1(self): self.step(4) # Setup Occupancy attribute subscription here - endpoint_id = self.matter_test_config.endpoint + endpoint_id = self.get_endpoint() node_id = self.dut_node_id dev_ctrl = self.default_controller attrib_listener = ClusterAttributeChangeAccumulator(cluster) diff --git a/src/python_testing/TC_OCC_3_2.py b/src/python_testing/TC_OCC_3_2.py index 3a5ca170694138..9f41bd69bbad2a 100644 --- a/src/python_testing/TC_OCC_3_2.py +++ b/src/python_testing/TC_OCC_3_2.py @@ -56,7 +56,7 @@ def setup_test(self): async def read_occ_attribute_expect_success(self, attribute): cluster = Clusters.Objects.OccupancySensing - endpoint_id = self.matter_test_config.endpoint + endpoint_id = self.get_endpoint() return await self.read_single_attribute_check_success(endpoint=endpoint_id, cluster=cluster, attribute=attribute) def desc_TC_OCC_3_2(self) -> str: @@ -100,7 +100,7 @@ def write_to_app_pipe(self, command): @async_test_body async def test_TC_OCC_3_2(self): - endpoint_id = self.matter_test_config.endpoint + endpoint_id = self.get_endpoint() node_id = self.dut_node_id dev_ctrl = self.default_controller diff --git a/src/python_testing/TC_OPSTATE_2_1.py b/src/python_testing/TC_OPSTATE_2_1.py index 060b71d85ee550..272f9fa9c48595 100644 --- a/src/python_testing/TC_OPSTATE_2_1.py +++ b/src/python_testing/TC_OPSTATE_2_1.py @@ -60,7 +60,7 @@ def pics_TC_OPSTATE_2_1(self) -> list[str]: @async_test_body async def test_TC_OPSTATE_2_1(self): - endpoint = self.matter_test_config.endpoint + endpoint = self.get_endpoint(default=1) await self.TEST_TC_OPSTATE_BASE_2_1(endpoint) diff --git a/src/python_testing/TC_OPSTATE_2_2.py b/src/python_testing/TC_OPSTATE_2_2.py index f0ed8f214d421a..b3e426ada5a205 100644 --- a/src/python_testing/TC_OPSTATE_2_2.py +++ b/src/python_testing/TC_OPSTATE_2_2.py @@ -62,7 +62,7 @@ def pics_TC_OPSTATE_2_2(self) -> list[str]: @async_test_body async def test_TC_OPSTATE_2_2(self): - endpoint = self.matter_test_config.endpoint + endpoint = self.get_endpoint(default=1) await self.TEST_TC_OPSTATE_BASE_2_2(endpoint=endpoint) diff --git a/src/python_testing/TC_OPSTATE_2_3.py b/src/python_testing/TC_OPSTATE_2_3.py index d35aa6e61e4af7..53d79eaa10d11f 100644 --- a/src/python_testing/TC_OPSTATE_2_3.py +++ b/src/python_testing/TC_OPSTATE_2_3.py @@ -62,7 +62,7 @@ def pics_TC_OPSTATE_2_3(self) -> list[str]: @async_test_body async def test_TC_OPSTATE_2_3(self): - endpoint = self.matter_test_config.endpoint + endpoint = self.get_endpoint(default=1) await self.TEST_TC_OPSTATE_BASE_2_3(endpoint=endpoint) diff --git a/src/python_testing/TC_OPSTATE_2_4.py b/src/python_testing/TC_OPSTATE_2_4.py index ec2c7c17daf098..24f1ee50eb9d47 100644 --- a/src/python_testing/TC_OPSTATE_2_4.py +++ b/src/python_testing/TC_OPSTATE_2_4.py @@ -62,7 +62,7 @@ def pics_TC_OPSTATE_2_4(self) -> list[str]: @async_test_body async def test_TC_OPSTATE_2_4(self): - endpoint = self.matter_test_config.endpoint + endpoint = self.get_endpoint(default=1) await self.TEST_TC_OPSTATE_BASE_2_4(endpoint=endpoint) diff --git a/src/python_testing/TC_OPSTATE_2_5.py b/src/python_testing/TC_OPSTATE_2_5.py index 89a2462a2bf917..3327ca42c38373 100644 --- a/src/python_testing/TC_OPSTATE_2_5.py +++ b/src/python_testing/TC_OPSTATE_2_5.py @@ -62,7 +62,7 @@ def pics_TC_OPSTATE_2_5(self) -> list[str]: @async_test_body async def test_TC_OPSTATE_2_5(self): - endpoint = self.matter_test_config.endpoint + endpoint = self.get_endpoint(default=1) await self.TEST_TC_OPSTATE_BASE_2_5(endpoint=endpoint) diff --git a/src/python_testing/TC_OPSTATE_2_6.py b/src/python_testing/TC_OPSTATE_2_6.py index 0b9e1ec3bb067a..c024ad9c089238 100644 --- a/src/python_testing/TC_OPSTATE_2_6.py +++ b/src/python_testing/TC_OPSTATE_2_6.py @@ -62,7 +62,7 @@ def pics_TC_OPSTATE_2_6(self) -> list[str]: @async_test_body async def test_TC_OPSTATE_2_6(self): - endpoint = self.matter_test_config.endpoint + endpoint = self.get_endpoint(default=1) await self.TEST_TC_OPSTATE_BASE_2_6(endpoint=endpoint) diff --git a/src/python_testing/TC_OVENOPSTATE_2_1.py b/src/python_testing/TC_OVENOPSTATE_2_1.py index d830a416c0911a..9d0eb4a98c3f4b 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_1.py +++ b/src/python_testing/TC_OVENOPSTATE_2_1.py @@ -61,7 +61,7 @@ def pics_TC_OVENOPSTATE_2_1(self) -> list[str]: @async_test_body async def test_TC_OVENOPSTATE_2_1(self): - endpoint = self.matter_test_config.endpoint + endpoint = self.get_endpoint(default=1) await self.TEST_TC_OPSTATE_BASE_2_1(endpoint) diff --git a/src/python_testing/TC_OVENOPSTATE_2_2.py b/src/python_testing/TC_OVENOPSTATE_2_2.py index 55afad11bebe88..7cf1049bad56cc 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_2.py +++ b/src/python_testing/TC_OVENOPSTATE_2_2.py @@ -62,7 +62,7 @@ def pics_TC_OVENOPSTATE_2_2(self) -> list[str]: @async_test_body async def test_TC_OVENOPSTATE_2_2(self): - endpoint = self.matter_test_config.endpoint + endpoint = self.get_endpoint(default=1) await self.TEST_TC_OPSTATE_BASE_2_2(endpoint=endpoint) diff --git a/src/python_testing/TC_OVENOPSTATE_2_3.py b/src/python_testing/TC_OVENOPSTATE_2_3.py index 329bceb1fb1cb5..2b9a77e9ddea29 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_3.py +++ b/src/python_testing/TC_OVENOPSTATE_2_3.py @@ -61,7 +61,7 @@ def pics_TC_OVENOPSTATE_2_3(self) -> list[str]: @async_test_body async def test_TC_OVENOPSTATE_2_3(self): - endpoint = self.matter_test_config.endpoint + endpoint = self.get_endpoint(default=1) await self.TEST_TC_OPSTATE_BASE_2_3(endpoint=endpoint) diff --git a/src/python_testing/TC_OVENOPSTATE_2_4.py b/src/python_testing/TC_OVENOPSTATE_2_4.py index ffc639390ee3de..667b9c734e1a3a 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_4.py +++ b/src/python_testing/TC_OVENOPSTATE_2_4.py @@ -61,7 +61,7 @@ def pics_TC_OVENOPSTATE_2_4(self) -> list[str]: @async_test_body async def test_TC_OVENOPSTATE_2_4(self): - endpoint = self.matter_test_config.endpoint + endpoint = self.get_endpoint(default=1) await self.TEST_TC_OPSTATE_BASE_2_4(endpoint=endpoint) diff --git a/src/python_testing/TC_OVENOPSTATE_2_5.py b/src/python_testing/TC_OVENOPSTATE_2_5.py index 42edca72f39515..cd52469c55827f 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_5.py +++ b/src/python_testing/TC_OVENOPSTATE_2_5.py @@ -62,7 +62,7 @@ def pics_TC_OVENOPSTATE_2_5(self) -> list[str]: @async_test_body async def test_TC_OVENOPSTATE_2_5(self): - endpoint = self.matter_test_config.endpoint + endpoint = self.get_endpoint(default=1) await self.TEST_TC_OPSTATE_BASE_2_5(endpoint=endpoint) diff --git a/src/python_testing/TC_PS_2_3.py b/src/python_testing/TC_PS_2_3.py index 13f4420b0a24ad..1ba65b47d6f47d 100644 --- a/src/python_testing/TC_PS_2_3.py +++ b/src/python_testing/TC_PS_2_3.py @@ -62,7 +62,7 @@ async def test_TC_PS_2_3(self): self.step(2) ps = Clusters.PowerSource sub_handler = ClusterAttributeChangeAccumulator(ps) - await sub_handler.start(self.default_controller, self.dut_node_id, self.matter_test_config.endpoint) + await sub_handler.start(self.default_controller, self.dut_node_id, self.get_endpoint()) self.step(3) logging.info("This test will now wait for 30 seconds.") diff --git a/src/python_testing/TC_PWRTL_2_1.py b/src/python_testing/TC_PWRTL_2_1.py index 9d4b3de97704d5..ff3a66a88631c4 100644 --- a/src/python_testing/TC_PWRTL_2_1.py +++ b/src/python_testing/TC_PWRTL_2_1.py @@ -51,7 +51,7 @@ async def test_TC_PWRTL_2_1(self): attributes = Clusters.PowerTopology.Attributes - endpoint = self.user_params.get("endpoint", 1) + endpoint = self.get_endpoint(default=1) powertop_attr_list = Clusters.Objects.PowerTopology.Attributes.AttributeList powertop_cluster = Clusters.Objects.PowerTopology diff --git a/src/python_testing/TC_RVCCLEANM_1_2.py b/src/python_testing/TC_RVCCLEANM_1_2.py index 3dfd75f4f43897..b755d727561c71 100644 --- a/src/python_testing/TC_RVCCLEANM_1_2.py +++ b/src/python_testing/TC_RVCCLEANM_1_2.py @@ -69,7 +69,7 @@ def pics_TC_RVCCLEANM_1_2(self) -> list[str]: @async_test_body async def test_TC_RVCCLEANM_1_2(self): - self.endpoint = self.matter_test_config.endpoint + self.endpoint = self.get_endpoint() attributes = Clusters.RvcCleanMode.Attributes diff --git a/src/python_testing/TC_RVCCLEANM_2_1.py b/src/python_testing/TC_RVCCLEANM_2_1.py index 5234a74685c34e..5c5271e0be01ae 100644 --- a/src/python_testing/TC_RVCCLEANM_2_1.py +++ b/src/python_testing/TC_RVCCLEANM_2_1.py @@ -88,7 +88,7 @@ async def test_TC_RVCCLEANM_2_1(self): "PIXIT.RVCCLEANM.MODE_CHANGE_FAIL must be included on the command line in " "the --int-arg flag as PIXIT.RVCCLEANM.MODE_CHANGE_FAIL:") - self.endpoint = self.matter_test_config.endpoint + self.endpoint = self.get_endpoint() self.mode_ok = self.matter_test_config.global_test_params['PIXIT.RVCCLEANM.MODE_CHANGE_OK'] self.mode_fail = self.matter_test_config.global_test_params['PIXIT.RVCCLEANM.MODE_CHANGE_FAIL'] self.is_ci = self.check_pics("PICS_SDK_CI_ONLY") diff --git a/src/python_testing/TC_RVCCLEANM_2_2.py b/src/python_testing/TC_RVCCLEANM_2_2.py index 7352d03e241a91..a34d0cda2a12a5 100644 --- a/src/python_testing/TC_RVCCLEANM_2_2.py +++ b/src/python_testing/TC_RVCCLEANM_2_2.py @@ -105,7 +105,7 @@ def pics_TC_RVCCLEANM_2_2(self) -> list[str]: @async_test_body async def test_TC_RVCCLEANM_2_2(self): self.directmodech_bit_mask = Clusters.RvcCleanMode.Bitmaps.Feature.kDirectModeChange - self.endpoint = self.matter_test_config.endpoint + self.endpoint = self.get_endpoint() self.is_ci = self.check_pics("PICS_SDK_CI_ONLY") if self.is_ci: app_pid = self.matter_test_config.app_pid diff --git a/src/python_testing/TC_RVCOPSTATE_2_1.py b/src/python_testing/TC_RVCOPSTATE_2_1.py index 48715c3b7a5aa9..428aa9a5ab14fd 100644 --- a/src/python_testing/TC_RVCOPSTATE_2_1.py +++ b/src/python_testing/TC_RVCOPSTATE_2_1.py @@ -85,7 +85,7 @@ def TC_RVCOPSTATE_2_1(self) -> list[str]: @async_test_body async def test_TC_RVCOPSTATE_2_1(self): - self.endpoint = self.matter_test_config.endpoint + self.endpoint = self.get_endpoint() asserts.assert_false(self.endpoint is None, "--endpoint must be included on the command line in.") self.is_ci = self.check_pics("PICS_SDK_CI_ONLY") if self.is_ci: diff --git a/src/python_testing/TC_RVCOPSTATE_2_3.py b/src/python_testing/TC_RVCOPSTATE_2_3.py index 1b522117b9ea6f..ce583a7f527e90 100644 --- a/src/python_testing/TC_RVCOPSTATE_2_3.py +++ b/src/python_testing/TC_RVCOPSTATE_2_3.py @@ -158,7 +158,7 @@ def pics_TC_RVCOPSTATE_2_3(self) -> list[str]: @async_test_body async def test_TC_RVCOPSTATE_2_3(self): - self.endpoint = self.matter_test_config.endpoint + self.endpoint = self.get_endpoint() asserts.assert_false(self.endpoint is None, "--endpoint must be included on the command line in.") self.is_ci = self.check_pics("PICS_SDK_CI_ONLY") if self.is_ci: diff --git a/src/python_testing/TC_RVCOPSTATE_2_4.py b/src/python_testing/TC_RVCOPSTATE_2_4.py index ad515dbff1983a..c1bbb5509c8f8d 100644 --- a/src/python_testing/TC_RVCOPSTATE_2_4.py +++ b/src/python_testing/TC_RVCOPSTATE_2_4.py @@ -103,7 +103,7 @@ def pics_TC_RVCOPSTATE_2_4(self) -> list[str]: @async_test_body async def test_TC_RVCOPSTATE_2_4(self): - self.endpoint = self.matter_test_config.endpoint + self.endpoint = self.get_endpoint() asserts.assert_false(self.endpoint is None, "--endpoint must be included on the command line in.") self.is_ci = self.check_pics("PICS_SDK_CI_ONLY") if self.is_ci: diff --git a/src/python_testing/TC_RVCRUNM_1_2.py b/src/python_testing/TC_RVCRUNM_1_2.py index 90db1601b1375a..369df1ddc6424f 100644 --- a/src/python_testing/TC_RVCRUNM_1_2.py +++ b/src/python_testing/TC_RVCRUNM_1_2.py @@ -69,7 +69,7 @@ def pics_TC_RVCRUNM_1_2(self) -> list[str]: @async_test_body async def test_TC_RVCRUNM_1_2(self): - self.endpoint = self.matter_test_config.endpoint + self.endpoint = self.get_endpoint() attributes = Clusters.RvcRunMode.Attributes diff --git a/src/python_testing/TC_RVCRUNM_2_1.py b/src/python_testing/TC_RVCRUNM_2_1.py index 55c37c70945571..802c87fad52f0f 100644 --- a/src/python_testing/TC_RVCRUNM_2_1.py +++ b/src/python_testing/TC_RVCRUNM_2_1.py @@ -83,7 +83,7 @@ async def test_TC_RVCRUNM_2_1(self): "PIXIT.RVCRUNM.MODE_CHANGE_FAIL must be included on the command line in " "the --int-arg flag as PIXIT.RVCRUNM.MODE_CHANGE_FAIL:") - self.endpoint = self.matter_test_config.endpoint + self.endpoint = self.get_endpoint() self.mode_ok = self.matter_test_config.global_test_params['PIXIT.RVCRUNM.MODE_CHANGE_OK'] self.mode_fail = self.matter_test_config.global_test_params['PIXIT.RVCRUNM.MODE_CHANGE_FAIL'] self.is_ci = self.check_pics("PICS_SDK_CI_ONLY") diff --git a/src/python_testing/TC_RVCRUNM_2_2.py b/src/python_testing/TC_RVCRUNM_2_2.py index e78d6d7f427c7e..55c5a6ef17d61c 100644 --- a/src/python_testing/TC_RVCRUNM_2_2.py +++ b/src/python_testing/TC_RVCRUNM_2_2.py @@ -134,7 +134,7 @@ async def test_TC_RVCRUNM_2_2(self): "PIXIT.RVCRUNM.MODE_B:") self.directmodech_bit_mask = Clusters.RvcRunMode.Bitmaps.Feature.kDirectModeChange - self.endpoint = self.matter_test_config.endpoint + self.endpoint = self.get_endpoint() self.is_ci = self.check_pics("PICS_SDK_CI_ONLY") self.mode_a = self.matter_test_config.global_test_params['PIXIT.RVCRUNM.MODE_A'] self.mode_b = self.matter_test_config.global_test_params['PIXIT.RVCRUNM.MODE_B'] diff --git a/src/python_testing/TC_SEAR_1_2.py b/src/python_testing/TC_SEAR_1_2.py index 41773804e45d75..039a2ff9d071af 100644 --- a/src/python_testing/TC_SEAR_1_2.py +++ b/src/python_testing/TC_SEAR_1_2.py @@ -204,7 +204,7 @@ def TC_SEAR_1_2(self) -> list[str]: @async_test_body async def test_TC_SEAR_1_2(self): - self.endpoint = self.matter_test_config.endpoint + self.endpoint = self.get_endpoint(default=1) asserts.assert_false(self.endpoint is None, "--endpoint must be included on the command line in.") self.is_ci = self.check_pics("PICS_SDK_CI_ONLY") if self.is_ci: diff --git a/src/python_testing/TC_SEAR_1_3.py b/src/python_testing/TC_SEAR_1_3.py index 2c2b85a13c61eb..50818c3c6033fb 100644 --- a/src/python_testing/TC_SEAR_1_3.py +++ b/src/python_testing/TC_SEAR_1_3.py @@ -88,7 +88,7 @@ def TC_SEAR_1_3(self) -> list[str]: @async_test_body async def test_TC_SEAR_1_3(self): - self.endpoint = self.matter_test_config.endpoint + self.endpoint = self.get_endpoint() asserts.assert_false(self.endpoint is None, "--endpoint must be included on the command line in.") self.is_ci = self.check_pics("PICS_SDK_CI_ONLY") if self.is_ci: diff --git a/src/python_testing/TC_SEAR_1_4.py b/src/python_testing/TC_SEAR_1_4.py index cf53f446f903c8..704fd97a543b5c 100644 --- a/src/python_testing/TC_SEAR_1_4.py +++ b/src/python_testing/TC_SEAR_1_4.py @@ -60,7 +60,7 @@ def TC_SEAR_1_4(self) -> list[str]: @async_test_body async def test_TC_SEAR_1_4(self): - self.endpoint = self.matter_test_config.endpoint + self.endpoint = self.get_endpoint() asserts.assert_false(self.endpoint is None, "--endpoint must be included on the command line in.") self.is_ci = self.check_pics("PICS_SDK_CI_ONLY") if self.is_ci: diff --git a/src/python_testing/TC_SEAR_1_5.py b/src/python_testing/TC_SEAR_1_5.py index 130ccb8d59fa3d..96209191e6458b 100644 --- a/src/python_testing/TC_SEAR_1_5.py +++ b/src/python_testing/TC_SEAR_1_5.py @@ -102,7 +102,7 @@ def TC_SEAR_1_5(self) -> list[str]: @async_test_body async def test_TC_SEAR_1_5(self): - self.endpoint = self.matter_test_config.endpoint + self.endpoint = self.get_endpoint() asserts.assert_false(self.endpoint is None, "--endpoint must be included on the command line in.") self.is_ci = self.check_pics("PICS_SDK_CI_ONLY") if self.is_ci: diff --git a/src/python_testing/TC_SEAR_1_6.py b/src/python_testing/TC_SEAR_1_6.py index dc6188a14e92fa..6e5c2157d0b35e 100644 --- a/src/python_testing/TC_SEAR_1_6.py +++ b/src/python_testing/TC_SEAR_1_6.py @@ -85,7 +85,7 @@ def TC_SEAR_1_6(self) -> list[str]: @async_test_body async def test_TC_SEAR_1_6(self): - self.endpoint = self.matter_test_config.endpoint + self.endpoint = self.get_endpoint() asserts.assert_false(self.endpoint is None, "--endpoint must be included on the command line in.") self.is_ci = self.check_pics("PICS_SDK_CI_ONLY") if self.is_ci: diff --git a/src/python_testing/TC_SWTCH.py b/src/python_testing/TC_SWTCH.py index fe550134526cac..e59842b056d5bc 100644 --- a/src/python_testing/TC_SWTCH.py +++ b/src/python_testing/TC_SWTCH.py @@ -335,7 +335,7 @@ def steps_TC_SWTCH_2_2(self): async def test_TC_SWTCH_2_2(self): post_prompt_settle_delay_seconds = 10.0 cluster = Clusters.Switch - endpoint_id = self.matter_test_config.endpoint + endpoint_id = self.get_endpoint() # Step 1: Commissioning - already done self.step(1) @@ -452,7 +452,7 @@ async def test_TC_SWTCH_2_3(self): has_msl_feature = (feature_map & cluster.Bitmaps.Feature.kMomentarySwitchLongPress) != 0 has_as_feature = (feature_map & cluster.Bitmaps.Feature.kActionSwitch) != 0 - endpoint_id = self.matter_test_config.endpoint + endpoint_id = self.get_endpoint() self.step(2) event_listener = EventChangeCallback(cluster) @@ -524,7 +524,7 @@ async def test_TC_SWTCH_2_4(self): switch_pressed_position = self._default_pressed_position post_prompt_settle_delay_seconds = 10.0 - endpoint_id = self.matter_test_config.endpoint + endpoint_id = self.get_endpoint() cluster = Clusters.Objects.Switch # Step 1: Commission DUT - already done @@ -704,7 +704,7 @@ async def test_TC_SWTCH_2_5(self): has_msr_feature = (feature_map & cluster.Bitmaps.Feature.kMomentarySwitchRelease) multi_press_max = await self.read_single_attribute_check_success(cluster, attribute=cluster.Attributes.MultiPressMax) - endpoint_id = self.matter_test_config.endpoint + endpoint_id = self.get_endpoint() pressed_position = self._default_pressed_position self.step(2) @@ -882,7 +882,7 @@ async def test_TC_SWTCH_2_6(self): has_msl_feature = (feature_map & cluster.Bitmaps.Feature.kMomentarySwitchLongPress) multi_press_max = await self.read_single_attribute_check_success(cluster, attribute=cluster.Attributes.MultiPressMax) - endpoint_id = self.matter_test_config.endpoint + endpoint_id = self.get_endpoint() pressed_position = self._default_pressed_position self.step(2) diff --git a/src/python_testing/TC_TSTAT_4_2.py b/src/python_testing/TC_TSTAT_4_2.py index 85ff487a9dc639..1cdc54923e24cd 100644 --- a/src/python_testing/TC_TSTAT_4_2.py +++ b/src/python_testing/TC_TSTAT_4_2.py @@ -253,7 +253,7 @@ def steps_TC_TSTAT_4_2(self) -> list[TestStep]: @ async_test_body async def test_TC_TSTAT_4_2(self): - endpoint = self.matter_test_config.endpoint if self.matter_test_config.endpoint is not None else 1 + endpoint = self.get_endpoint() self.step("1") # Commission DUT - already done diff --git a/src/python_testing/TC_VALCC_2_1.py b/src/python_testing/TC_VALCC_2_1.py index d6f00b00a6c13b..c01d801b2274ae 100644 --- a/src/python_testing/TC_VALCC_2_1.py +++ b/src/python_testing/TC_VALCC_2_1.py @@ -27,6 +27,7 @@ # --passcode 20202021 # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# --endpoint 1 # factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === @@ -74,7 +75,7 @@ def pics_TC_VALCC_2_1(self) -> list[str]: @async_test_body async def test_TC_VALCC_2_1(self): - endpoint = self.user_params.get("endpoint", 1) + endpoint = self.get_endpoint(default=1) self.step(1) attributes = Clusters.ValveConfigurationAndControl.Attributes diff --git a/src/python_testing/TC_VALCC_3_1.py b/src/python_testing/TC_VALCC_3_1.py index 4b53ab032cc668..5f3c58d0b96cf9 100644 --- a/src/python_testing/TC_VALCC_3_1.py +++ b/src/python_testing/TC_VALCC_3_1.py @@ -27,6 +27,7 @@ # --passcode 20202021 # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# --endpoint 1 # factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === @@ -69,7 +70,7 @@ def pics_TC_VALCC_3_1(self) -> list[str]: @async_test_body async def test_TC_VALCC_3_1(self): - endpoint = self.user_params.get("endpoint", 1) + endpoint = self.get_endpoint(default=1) self.step(1) attributes = Clusters.ValveConfigurationAndControl.Attributes diff --git a/src/python_testing/TC_VALCC_3_2.py b/src/python_testing/TC_VALCC_3_2.py index 6905e3bde8096f..44dc320c0a8f33 100644 --- a/src/python_testing/TC_VALCC_3_2.py +++ b/src/python_testing/TC_VALCC_3_2.py @@ -27,6 +27,7 @@ # --passcode 20202021 # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# --endpoint 1 # factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === @@ -71,7 +72,7 @@ def pics_TC_VALCC_3_2(self) -> list[str]: @async_test_body async def test_TC_VALCC_3_2(self): - endpoint = self.user_params.get("endpoint", 1) + endpoint = self.get_endpoint(default=1) self.step(1) attributes = Clusters.ValveConfigurationAndControl.Attributes diff --git a/src/python_testing/TC_VALCC_3_3.py b/src/python_testing/TC_VALCC_3_3.py index a63053cf346ea8..97e29f9b1a82d1 100644 --- a/src/python_testing/TC_VALCC_3_3.py +++ b/src/python_testing/TC_VALCC_3_3.py @@ -27,6 +27,7 @@ # --passcode 20202021 # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# --endpoint 1 # factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === @@ -72,7 +73,7 @@ def pics_TC_VALCC_3_3(self) -> list[str]: @async_test_body async def test_TC_VALCC_3_3(self): - endpoint = self.user_params.get("endpoint", 1) + endpoint = self.get_endpoint(default=1) self.step(1) attributes = Clusters.ValveConfigurationAndControl.Attributes diff --git a/src/python_testing/TC_VALCC_3_4.py b/src/python_testing/TC_VALCC_3_4.py index 30c57dcb3fa6dc..05782fabed4115 100644 --- a/src/python_testing/TC_VALCC_3_4.py +++ b/src/python_testing/TC_VALCC_3_4.py @@ -27,6 +27,7 @@ # --passcode 20202021 # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# --endpoint 1 # factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === @@ -67,7 +68,7 @@ def pics_TC_VALCC_3_4(self) -> list[str]: @async_test_body async def test_TC_VALCC_3_4(self): - endpoint = self.user_params.get("endpoint", 1) + endpoint = self.get_endpoint(default=1) self.step(1) attributes = Clusters.ValveConfigurationAndControl.Attributes diff --git a/src/python_testing/TC_VALCC_4_1.py b/src/python_testing/TC_VALCC_4_1.py index 9af428d103674c..f30df68d79950a 100644 --- a/src/python_testing/TC_VALCC_4_1.py +++ b/src/python_testing/TC_VALCC_4_1.py @@ -27,6 +27,7 @@ # --passcode 20202021 # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# --endpoint 1 # factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === @@ -71,7 +72,7 @@ def pics_TC_VALCC_4_1(self) -> list[str]: @async_test_body async def test_TC_VALCC_4_1(self): - endpoint = self.user_params.get("endpoint", 1) + endpoint = self.get_endpoint(default=1) self.step(1) attributes = Clusters.ValveConfigurationAndControl.Attributes diff --git a/src/python_testing/TC_VALCC_4_2.py b/src/python_testing/TC_VALCC_4_2.py index 9365e5bc780520..3394df61bad885 100644 --- a/src/python_testing/TC_VALCC_4_2.py +++ b/src/python_testing/TC_VALCC_4_2.py @@ -27,6 +27,7 @@ # --passcode 20202021 # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# --endpoint 1 # factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === @@ -74,7 +75,7 @@ def pics_TC_VALCC_4_2(self) -> list[str]: @async_test_body async def test_TC_VALCC_4_2(self): - endpoint = self.user_params.get("endpoint", 1) + endpoint = self.get_endpoint(default=1) self.step(1) attributes = Clusters.ValveConfigurationAndControl.Attributes diff --git a/src/python_testing/TC_VALCC_4_3.py b/src/python_testing/TC_VALCC_4_3.py index b0762d0d88169c..c43f9303d2da7b 100644 --- a/src/python_testing/TC_VALCC_4_3.py +++ b/src/python_testing/TC_VALCC_4_3.py @@ -27,6 +27,7 @@ # --passcode 20202021 # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# --endpoint 1 # factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === @@ -71,7 +72,7 @@ def pics_TC_VALCC_4_3(self) -> list[str]: @async_test_body async def test_TC_VALCC_4_3(self): - endpoint = self.user_params.get("endpoint", 1) + endpoint = self.get_endpoint(default=1) self.step(1) attributes = Clusters.ValveConfigurationAndControl.Attributes diff --git a/src/python_testing/TC_VALCC_4_4.py b/src/python_testing/TC_VALCC_4_4.py index 63cc6170ab5888..8915bd9044734e 100644 --- a/src/python_testing/TC_VALCC_4_4.py +++ b/src/python_testing/TC_VALCC_4_4.py @@ -27,6 +27,7 @@ # --passcode 20202021 # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# --endpoint 1 # factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === @@ -80,7 +81,7 @@ def pics_TC_VALCC_4_4(self) -> list[str]: @async_test_body async def test_TC_VALCC_4_4(self): - endpoint = self.user_params.get("endpoint", 1) + endpoint = self.get_endpoint(default=1) self.step(1) attributes = Clusters.ValveConfigurationAndControl.Attributes diff --git a/src/python_testing/TC_VALCC_4_5.py b/src/python_testing/TC_VALCC_4_5.py index c6b7674c6c7f60..052e424529ca19 100644 --- a/src/python_testing/TC_VALCC_4_5.py +++ b/src/python_testing/TC_VALCC_4_5.py @@ -27,6 +27,7 @@ # --passcode 20202021 # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# --endpoint 1 # factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === @@ -71,7 +72,7 @@ def pics_TC_VALCC_4_5(self) -> list[str]: @async_test_body async def test_TC_VALCC_4_5(self): - endpoint = self.user_params.get("endpoint", 1) + endpoint = self.get_endpoint(default=1) self.step(1) attributes = Clusters.ValveConfigurationAndControl.Attributes diff --git a/src/python_testing/TC_WHM_1_2.py b/src/python_testing/TC_WHM_1_2.py index 2bbcdd5108b03f..0ce34ee83119be 100644 --- a/src/python_testing/TC_WHM_1_2.py +++ b/src/python_testing/TC_WHM_1_2.py @@ -71,7 +71,7 @@ def pics_TC_WHM_1_2(self) -> list[str]: @async_test_body async def test_TC_WHM_1_2(self): - endpoint = self.user_params.get("endpoint", 1) + endpoint = self.get_endpoint(default=1) attributes = Clusters.WaterHeaterMode.Attributes diff --git a/src/python_testing/TC_WHM_2_1.py b/src/python_testing/TC_WHM_2_1.py index 538450e5986c1c..7380c7a862aa80 100644 --- a/src/python_testing/TC_WHM_2_1.py +++ b/src/python_testing/TC_WHM_2_1.py @@ -93,7 +93,7 @@ async def test_TC_WHM_2_1(self): ModeManual = 1 # ModeTimed = 2 - self.endpoint = self.matter_test_config.endpoint + self.endpoint = self.get_endpoint() attributes = Clusters.WaterHeaterMode.Attributes diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py b/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py index 053fa575c6452d..bb3666f551e4a2 100644 --- a/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py +++ b/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py @@ -1087,6 +1087,9 @@ def certificate_authority_manager(self) -> chip.CertificateAuthority.Certificate def dut_node_id(self) -> int: return self.matter_test_config.dut_node_ids[0] + def get_endpoint(self, default: Optional[int] = 0) -> int: + return self.matter_test_config.endpoint if self.matter_test_config.endpoint is not None else default + def setup_class(self): super().setup_class() @@ -1163,7 +1166,8 @@ async def read_single_attribute_check_success( if node_id is None: node_id = self.dut_node_id if endpoint is None: - endpoint = 0 if self.matter_test_config.endpoint is None else self.matter_test_config.endpoint + #endpoint = 0 if self.matter_test_config.endpoint is None else self.matter_test_config.endpoint + endpoint = self.get_endpoint() result = await dev_ctrl.ReadAttribute(node_id, [(endpoint, attribute)], fabricFiltered=fabric_filtered) attr_ret = result[endpoint][cluster][attribute] @@ -1195,7 +1199,8 @@ async def read_single_attribute_expect_error( if node_id is None: node_id = self.dut_node_id if endpoint is None: - endpoint = 0 if self.matter_test_config.endpoint is None else self.matter_test_config.endpoint + #endpoint = 0 if self.matter_test_config.endpoint is None else self.matter_test_config.endpoint + endpoint = self.get_endpoint() result = await dev_ctrl.ReadAttribute(node_id, [(endpoint, attribute)], fabricFiltered=fabric_filtered) attr_ret = result[endpoint][cluster][attribute] @@ -1243,7 +1248,8 @@ async def send_single_cmd( if node_id is None: node_id = self.dut_node_id if endpoint is None: - endpoint = 0 if self.matter_test_config.endpoint is None else self.matter_test_config.endpoint + #endpoint = 0 if self.matter_test_config.endpoint is None else self.matter_test_config.endpoint + endpoint = self.get_endpoint() result = await dev_ctrl.SendCommand(nodeid=node_id, endpoint=endpoint, payload=cmd, timedRequestTimeoutMs=timedRequestTimeoutMs, payloadCapability=payloadCapability) @@ -1836,7 +1842,8 @@ def convert_args_to_matter_config(args: argparse.Namespace) -> MatterTestConfig: config.pics = {} if args.PICS is None else read_pics_from_file(args.PICS) config.tests = [] if args.tests is None else args.tests config.timeout = args.timeout # This can be none, we pull the default from the test if it's unspecified - config.endpoint = args.endpoint + #config.endpoint = args.endpoint + config.endpoint = args.endpoint # This can be None, the get_endpoint function allows the tests to supply a default config.app_pid = 0 if args.app_pid is None else args.app_pid config.controller_node_id = args.controller_node_id