From 9b96ff7329ba59f2bda59236f8e3ee13813fabcd Mon Sep 17 00:00:00 2001 From: jtrejoespinoza-grid Date: Fri, 14 Feb 2025 16:21:33 -0700 Subject: [PATCH 01/12] Proposal update for write_to_app_pipe for MatterBaseTest. Added parameter app-pid to function. Added log info, added fail when app-pid is not present. Updated doc string. Naming fix --- .../chip/testing/matter_testing.py | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) 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 4625f9ca3b32b3..9c53bd767835e7 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 @@ -1034,10 +1034,17 @@ def get_test_desc(self, test: str) -> str: def get_default_app_pipe_name(self) -> str: return self.app_pipe - def write_to_app_pipe(self, command_dict: dict, app_pipe_name: Optional[str] = None): + def write_to_app_pipe(self, command_dict: dict, app_pipe_name: Optional[str] = None, app_pid: Optional[int] = None): """ - Sends an out-of-band command to a Matter app. + Send an out-of-band command to a Matter app. + Args: + command_dict (dict): dictionary with the command and data + app_pipe_name (Optional[str], optional): Name of the cluster pipe file (i.e. /tmp/chip_all_clusters_fifo_ or /tmp/chip_rvc_fifo_). Defaults to None. + app_pid (Optional[uint], optional): pid of the process for app_pipe_name. Defaults to None. + Extra: + Using parameter app_pipe_name replaces self.app_app_pipe_name. + Using parameter app-pid replaces self.app_pid. Use the following environment variables: - LINUX_DUT_IP @@ -1045,22 +1052,24 @@ def write_to_app_pipe(self, command_dict: dict, app_pipe_name: Optional[str] = N such as during CI, and the commands are sent to it using a local named pipe * if provided, the commands for writing to the named pipe are forwarded to the DUT - LINUX_DUT_USER - * if LINUX_DUT_IP is provided, use this for the DUT user name * If a remote password is needed, set up ssh keys to ensure that this script can log in to the DUT without a password: + Step 1: If you do not have a key, create one using ssh-keygen + Step 2: Authorize this key on the remote host: run ssh-copy-id user@ip once, using your password + Step 3: From now on ssh user@ip will no longer ask for your password + """ if app_pipe_name is None: app_pipe_name = self.get_default_app_pipe_name() + if app_pid is None: + app_pid = self.matter_test_config.app_pid if not isinstance(app_pipe_name, str): - raise TypeError("the named pipe must be provided as a string value") + raise TypeError("The named pipe must be provided as a string value") if not isinstance(command_dict, dict): - raise TypeError("the command must be passed as a dictionary value") + raise TypeError("The command must be passed as a dictionary value") import json command = json.dumps(command_dict) @@ -1069,12 +1078,19 @@ def write_to_app_pipe(self, command_dict: dict, app_pipe_name: Optional[str] = N dut_ip = os.getenv('LINUX_DUT_IP') if dut_ip is None: + if not isinstance(app_pid, int): + raise TypeError("The app_pid flag is not instance of int") + # Verify we have a valid app-id + if app_pid == 0: + asserts.fail("app_pid is 0 , is the flag --app-pid set?. app-id flag must be set in order to write to pipe.") + app_pipe_name = app_pipe_name + str(app_pid) if not os.path.exists(app_pipe_name): # Named pipes are unique, so we MUST have consistent PID/paths - # set up for them to work. + # Set up for them to work. logging.error("Named pipe %r does NOT exist" % app_pipe_name) raise FileNotFoundError("CANNOT FIND %r" % app_pipe_name) with open(app_pipe_name, "w") as app_pipe: + logger.info(f"Sending out-of-band command: {command} to file: {app_pipe_name}") app_pipe.write(command + "\n") # TODO(#31239): remove the need for sleep sleep(0.001) From 58a8823167bbecc616c5a6525e8c4e85c1365309 Mon Sep 17 00:00:00 2001 From: jtrejoespinoza-grid Date: Mon, 17 Feb 2025 13:29:58 -0700 Subject: [PATCH 02/12] Removed need to use self.matter_test_config.app_pid in the base class. Moved pid definition into derived class. --- .../chip/testing/matter_testing.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 9c53bd767835e7..5a74a87e7b778f 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 @@ -968,6 +968,8 @@ def __init__(self, *args): self.is_commissioning = False # The named pipe name must be set in the derived classes self.app_pipe = None + # The app_pipe_pid pid must be set in the derived class + self.app_pipe_pid = None def get_test_steps(self, test: str) -> list[TestStep]: ''' Retrieves the test step list for the given test @@ -1034,6 +1036,9 @@ def get_test_desc(self, test: str) -> str: def get_default_app_pipe_name(self) -> str: return self.app_pipe + def get_default_app_pipe_pid(self) -> int: + return self.app_pipe_pid + def write_to_app_pipe(self, command_dict: dict, app_pipe_name: Optional[str] = None, app_pid: Optional[int] = None): """ Send an out-of-band command to a Matter app. @@ -1063,7 +1068,7 @@ def write_to_app_pipe(self, command_dict: dict, app_pipe_name: Optional[str] = N if app_pipe_name is None: app_pipe_name = self.get_default_app_pipe_name() if app_pid is None: - app_pid = self.matter_test_config.app_pid + app_pid = self.get_default_app_pipe_pid() if not isinstance(app_pipe_name, str): raise TypeError("The named pipe must be provided as a string value") From 755d5ef2fa605cddd90cccfe44497499690d4734 Mon Sep 17 00:00:00 2001 From: jtrejoespinoza-grid Date: Mon, 17 Feb 2025 15:01:06 -0700 Subject: [PATCH 03/12] Updated TC_SEAR test cases with new write_to_app_pipe from Matternase test --- src/python_testing/TC_SEAR_1_2.py | 7 +------ src/python_testing/TC_SEAR_1_5.py | 6 +----- src/python_testing/TC_SEAR_1_6.py | 6 +----- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/src/python_testing/TC_SEAR_1_2.py b/src/python_testing/TC_SEAR_1_2.py index 039a2ff9d071af..bc233408ee7116 100644 --- a/src/python_testing/TC_SEAR_1_2.py +++ b/src/python_testing/TC_SEAR_1_2.py @@ -207,12 +207,7 @@ async def test_TC_SEAR_1_2(self): 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: - app_pid = self.matter_test_config.app_pid - if app_pid == 0: - asserts.fail("The --app-pid flag must be set when PICS_SDK_CI_ONLY is set") - self.app_pipe = self.app_pipe + str(app_pid) - + self.app_pipe_pid = self.matter_test_config.app_pid self.print_step(1, "Commissioning, already done") # Ensure that the device is in the correct state diff --git a/src/python_testing/TC_SEAR_1_5.py b/src/python_testing/TC_SEAR_1_5.py index 96209191e6458b..473c2dbb95095e 100644 --- a/src/python_testing/TC_SEAR_1_5.py +++ b/src/python_testing/TC_SEAR_1_5.py @@ -105,11 +105,7 @@ async def test_TC_SEAR_1_5(self): 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: - app_pid = self.matter_test_config.app_pid - if app_pid == 0: - asserts.fail("The --app-pid flag must be set when PICS_SDK_CI_ONLY is set") - self.app_pipe = self.app_pipe + str(app_pid) + self.app_pipe_pid = self.matter_test_config.app_pid self.print_step(1, "Commissioning, already done") diff --git a/src/python_testing/TC_SEAR_1_6.py b/src/python_testing/TC_SEAR_1_6.py index 6e5c2157d0b35e..a2dbe4a4284cbe 100644 --- a/src/python_testing/TC_SEAR_1_6.py +++ b/src/python_testing/TC_SEAR_1_6.py @@ -88,11 +88,7 @@ async def test_TC_SEAR_1_6(self): 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: - app_pid = self.matter_test_config.app_pid - if app_pid == 0: - asserts.fail("The --app-pid flag must be set when PICS_SDK_CI_ONLY is set") - self.app_pipe = self.app_pipe + str(app_pid) + self.app_pipe_pid = self.matter_test_config.app_pid self.print_step(1, "Commissioning, already done") From ec3ad8c5cd3c799414708db9736eaa498bf8ee88 Mon Sep 17 00:00:00 2001 From: jtrejoespinoza-grid Date: Mon, 17 Feb 2025 16:51:28 -0700 Subject: [PATCH 04/12] Refactor for write_to_pipe-app on TC_OCC Test cases --- src/python_testing/TC_OCC_3_1.py | 18 ++---------------- src/python_testing/TC_OCC_3_2.py | 21 ++++----------------- 2 files changed, 6 insertions(+), 33 deletions(-) diff --git a/src/python_testing/TC_OCC_3_1.py b/src/python_testing/TC_OCC_3_1.py index 2d7fb0e2de05e6..ae65ffa671c1ea 100644 --- a/src/python_testing/TC_OCC_3_1.py +++ b/src/python_testing/TC_OCC_3_1.py @@ -91,25 +91,11 @@ def pics_TC_OCC_3_1(self) -> list[str]: ] return pics - # Sends and out-of-band command to the all-clusters-app - def write_to_app_pipe(self, command): - # CI app pipe id creation - self.app_pipe = "/tmp/chip_all_clusters_fifo_" - if self.is_ci: - app_pid = self.matter_test_config.app_pid - if app_pid == 0: - asserts.fail("The --app-pid flag must be set when using named pipe") - self.app_pipe = self.app_pipe + str(app_pid) - - with open(self.app_pipe, "w") as app_pipe: - app_pipe.write(command + "\n") - # Delay for pipe command to be processed (otherwise tests are flaky) - time.sleep(0.001) - @async_test_body async def test_TC_OCC_3_1(self): hold_time = 10 if not self.is_ci else 1.0 # 10 seconds for occupancy state hold time - + self.app_pipe = "/tmp/chip_all_clusters_fifo_" + self.app_pipe_pid = self.matter_test_config.app_pid self.step(1) # Commissioning already done self.step(2) diff --git a/src/python_testing/TC_OCC_3_2.py b/src/python_testing/TC_OCC_3_2.py index 10051631436efd..01b7efc171ad03 100644 --- a/src/python_testing/TC_OCC_3_2.py +++ b/src/python_testing/TC_OCC_3_2.py @@ -83,26 +83,13 @@ def pics_TC_OCC_3_2(self) -> list[str]: ] return pics - # Sends and out-of-band command to the all-clusters-app - def write_to_app_pipe(self, command): - # CI app pipe id creation - self.app_pipe = "/tmp/chip_all_clusters_fifo_" - if self.is_ci: - app_pid = self.matter_test_config.app_pid - if app_pid == 0: - asserts.fail("The --app-pid flag must be set when using named pipe") - self.app_pipe = self.app_pipe + str(app_pid) - - with open(self.app_pipe, "w") as app_pipe: - app_pipe.write(command + "\n") - # Delay for pipe command to be processed (otherwise tests are flaky) - time.sleep(0.001) - @async_test_body async def test_TC_OCC_3_2(self): endpoint_id = self.get_endpoint() node_id = self.dut_node_id dev_ctrl = self.default_controller + self.app_pipe = "/tmp/chip_all_clusters_fifo_" + self.app_pipe_pid = self.matter_test_config.app_pid post_prompt_settle_delay_seconds = 10.0 cluster = Clusters.Objects.OccupancySensing @@ -136,7 +123,7 @@ async def test_TC_OCC_3_2(self): self.step("3a") # CI call to trigger off if self.is_ci: - self.write_to_app_pipe('{"Name":"SetOccupancy", "EndpointId": 1, "Occupancy": 0}') + self.write_to_app_pipe({"Name": "SetOccupancy", "EndpointId": 1, "Occupancy": 0}) else: self.wait_for_user_input(prompt_msg="Type any letter and press ENTER after DUT goes back to unoccupied state.") @@ -150,7 +137,7 @@ async def test_TC_OCC_3_2(self): # CI call to trigger on if self.is_ci: - self.write_to_app_pipe('{"Name":"SetOccupancy", "EndpointId": 1, "Occupancy": 1}') + self.write_to_app_pipe({"Name": "SetOccupancy", "EndpointId": 1, "Occupancy": 1}) else: self.wait_for_user_input( prompt_msg="Type any letter and press ENTER after the sensor occupancy is triggered and its occupancy state changed.") From a92b7d4d8b61782bf6054d5ac2451be5b527d80c Mon Sep 17 00:00:00 2001 From: jtrejoespinoza-grid Date: Mon, 17 Feb 2025 16:51:56 -0700 Subject: [PATCH 05/12] Refactor for write_to_pipe-app on TC_TVCCLEANM Test cases --- src/python_testing/TC_RVCCLEANM_2_1.py | 7 ++----- src/python_testing/TC_RVCCLEANM_2_2.py | 6 +----- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/python_testing/TC_RVCCLEANM_2_1.py b/src/python_testing/TC_RVCCLEANM_2_1.py index 5c5271e0be01ae..6e6b137cc6d06e 100644 --- a/src/python_testing/TC_RVCCLEANM_2_1.py +++ b/src/python_testing/TC_RVCCLEANM_2_1.py @@ -58,6 +58,7 @@ def __init__(self, *args): self.mode_fail = 0 self.is_ci = False self.app_pipe = "/tmp/chip_rvc_fifo_" + self.app_pipe_pid = self.matter_test_config.app_pid async def read_mod_attribute_expect_success(self, endpoint, attribute): cluster = Clusters.Objects.RvcCleanMode @@ -92,11 +93,7 @@ async def test_TC_RVCCLEANM_2_1(self): 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") - if self.is_ci: - app_pid = self.matter_test_config.app_pid - if app_pid == 0: - asserts.fail("The --app-pid flag must be set when PICS_SDK_CI_ONLY is set") - self.app_pipe = self.app_pipe + str(app_pid) + self.app_pipe_pid = self.matter_test_config.app_pid asserts.assert_true(self.check_pics("RVCCLEANM.S.A0000"), "RVCCLEANM.S.A0000 must be supported") asserts.assert_true(self.check_pics("RVCCLEANM.S.A0001"), "RVCCLEANM.S.A0001 must be supported") diff --git a/src/python_testing/TC_RVCCLEANM_2_2.py b/src/python_testing/TC_RVCCLEANM_2_2.py index a34d0cda2a12a5..a04f40195b90c8 100644 --- a/src/python_testing/TC_RVCCLEANM_2_2.py +++ b/src/python_testing/TC_RVCCLEANM_2_2.py @@ -107,11 +107,7 @@ async def test_TC_RVCCLEANM_2_2(self): self.directmodech_bit_mask = Clusters.RvcCleanMode.Bitmaps.Feature.kDirectModeChange 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 - if app_pid == 0: - asserts.fail("The --app-pid flag must be set when PICS_SDK_CI_ONLY is set.c") - self.app_pipe = self.app_pipe + str(app_pid) + self.app_pipe_pid = self.matter_test_config.app_pid asserts.assert_true(self.check_pics("RVCCLEANM.S"), "RVCCLEANM.S must be supported") asserts.assert_true(self.check_pics("RVCRUNM.S.A0000"), "RVCRUNM.S.A0000 must be supported") From 432a99497d610728671cebae962e95a5fe499855 Mon Sep 17 00:00:00 2001 From: jtrejoespinoza-grid Date: Mon, 17 Feb 2025 16:52:35 -0700 Subject: [PATCH 06/12] Refactor for write_to_pipe_app on TC_TVCOPSTATE --- src/python_testing/TC_RVCOPSTATE_2_1.py | 6 +----- src/python_testing/TC_RVCOPSTATE_2_3.py | 6 +----- src/python_testing/TC_RVCOPSTATE_2_4.py | 6 +----- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/python_testing/TC_RVCOPSTATE_2_1.py b/src/python_testing/TC_RVCOPSTATE_2_1.py index 4fc63fbe236632..c71dfa5eadcce9 100644 --- a/src/python_testing/TC_RVCOPSTATE_2_1.py +++ b/src/python_testing/TC_RVCOPSTATE_2_1.py @@ -90,11 +90,7 @@ async def test_TC_RVCOPSTATE_2_1(self): 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: - app_pid = self.matter_test_config.app_pid - if app_pid == 0: - asserts.fail("The --app-pid flag must be set when PICS_SDK_CI_ONLY is set") - self.app_pipe = self.app_pipe + str(app_pid) + self.app_pipe_pid = self.matter_test_config.app_pid cluster = Clusters.RvcOperationalState attributes = cluster.Attributes diff --git a/src/python_testing/TC_RVCOPSTATE_2_3.py b/src/python_testing/TC_RVCOPSTATE_2_3.py index ce583a7f527e90..879e6f93775d6e 100644 --- a/src/python_testing/TC_RVCOPSTATE_2_3.py +++ b/src/python_testing/TC_RVCOPSTATE_2_3.py @@ -161,11 +161,7 @@ async def test_TC_RVCOPSTATE_2_3(self): 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: - app_pid = self.matter_test_config.app_pid - if app_pid == 0: - asserts.fail("The --app-pid flag must be set when PICS_SDK_CI_ONLY is set.c") - self.app_pipe = self.app_pipe + str(app_pid) + self.app_pipe_pid = self.matter_test_config.app_pid asserts.assert_true(self.check_pics("RVCOPSTATE.S.A0003"), "RVCOPSTATE.S.A0003 must be supported") asserts.assert_true(self.check_pics("RVCOPSTATE.S.A0004"), "RVCOPSTATE.S.A0004 must be supported") diff --git a/src/python_testing/TC_RVCOPSTATE_2_4.py b/src/python_testing/TC_RVCOPSTATE_2_4.py index c1bbb5509c8f8d..a6db99ea79f6a7 100644 --- a/src/python_testing/TC_RVCOPSTATE_2_4.py +++ b/src/python_testing/TC_RVCOPSTATE_2_4.py @@ -106,11 +106,7 @@ async def test_TC_RVCOPSTATE_2_4(self): 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: - app_pid = self.matter_test_config.app_pid - if app_pid == 0: - asserts.fail("The --app-pid flag must be set when PICS_SDK_CI_ONLY is set.c") - self.app_pipe = self.app_pipe + str(app_pid) + self.app_pipe_pid = self.matter_test_config.app_pid asserts.assert_true(self.check_pics("RVCOPSTATE.S.A0004"), "RVCOPSTATE.S.A0004 must be supported") asserts.assert_true(self.check_pics("RVCOPSTATE.S.C04.Tx"), "RVCOPSTATE.S.C04.Tx must be supported") From 847360e36b587d7537bfdebdaad8f1c307b39a77 Mon Sep 17 00:00:00 2001 From: jtrejoespinoza-grid Date: Mon, 17 Feb 2025 16:53:11 -0700 Subject: [PATCH 07/12] Refactor for write_to_pipe_app on TC_RVCRUNM --- src/python_testing/TC_RVCRUNM_2_1.py | 6 +----- src/python_testing/TC_RVCRUNM_2_2.py | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/python_testing/TC_RVCRUNM_2_1.py b/src/python_testing/TC_RVCRUNM_2_1.py index 802c87fad52f0f..39d2a2f058da03 100644 --- a/src/python_testing/TC_RVCRUNM_2_1.py +++ b/src/python_testing/TC_RVCRUNM_2_1.py @@ -87,11 +87,7 @@ async def test_TC_RVCRUNM_2_1(self): 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") - if self.is_ci: - app_pid = self.matter_test_config.app_pid - if app_pid == 0: - asserts.fail("The --app-pid flag must be set when PICS_SDK_CI_ONLY is set.c") - self.app_pipe = self.app_pipe + str(app_pid) + self.app_pipe_pid = self.matter_test_config.app_pid asserts.assert_true(self.check_pics("RVCRUNM.S.A0000"), "RVCRUNM.S.A0000 must be supported") asserts.assert_true(self.check_pics("RVCRUNM.S.A0001"), "RVCRUNM.S.A0001 must be supported") diff --git a/src/python_testing/TC_RVCRUNM_2_2.py b/src/python_testing/TC_RVCRUNM_2_2.py index 55c5a6ef17d61c..cd3da9564ff4f4 100644 --- a/src/python_testing/TC_RVCRUNM_2_2.py +++ b/src/python_testing/TC_RVCRUNM_2_2.py @@ -138,11 +138,7 @@ async def test_TC_RVCRUNM_2_2(self): 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'] - if self.is_ci: - app_pid = self.matter_test_config.app_pid - if app_pid == 0: - asserts.fail("The --app-pid flag must be set when PICS_SDK_CI_ONLY is set.c") - self.app_pipe = self.app_pipe + str(app_pid) + self.app_pipe_pid = self.matter_test_config.app_pid asserts.assert_true(self.check_pics("RVCRUNM.S"), "RVCRUNM.S must be supported") # I think that the following PICS should be listed in the preconditions section in the test plan as if either From 6b17a4decda0e5a05ef83405890790a8dea0ffae Mon Sep 17 00:00:00 2001 From: jtrejoespinoza-grid Date: Tue, 18 Feb 2025 09:22:30 -0700 Subject: [PATCH 08/12] Missing test case to add. --- src/python_testing/TC_SEAR_1_3.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/python_testing/TC_SEAR_1_3.py b/src/python_testing/TC_SEAR_1_3.py index 50818c3c6033fb..fe105e87f8e979 100644 --- a/src/python_testing/TC_SEAR_1_3.py +++ b/src/python_testing/TC_SEAR_1_3.py @@ -91,12 +91,7 @@ async def test_TC_SEAR_1_3(self): 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: - app_pid = self.matter_test_config.app_pid - if app_pid == 0: - asserts.fail("The --app-pid flag must be set when PICS_SDK_CI_ONLY is set") - self.app_pipe = self.app_pipe + str(app_pid) - + self.app_pipe_pid = self.matter_test_config.app_pid self.print_step(1, "Commissioning, already done") # Ensure that the device is in the correct state From b1f6b8c7386be15dbdd0a97fbcf588db729b91fb Mon Sep 17 00:00:00 2001 From: jtrejoespinoza-grid Date: Wed, 19 Feb 2025 16:55:21 -0700 Subject: [PATCH 09/12] Refactored to use by default the args --app-pipe and --app-pid from the command line to build the app file to send the out of band command. Implemetation the same for CI and SSH --- .../chip/testing/matter_testing.py | 38 +++++++++---------- 1 file changed, 17 insertions(+), 21 deletions(-) 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 5a74a87e7b778f..39a8cfcea3f987 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 @@ -653,6 +653,7 @@ class MatterTestConfig: timeout: typing.Union[int, None] = None endpoint: typing.Union[int, None] = 0 app_pid: int = 0 + pipe_name: typing.Union[str, None] = None fail_on_skipped_tests: bool = False commissioning_method: Optional[str] = None @@ -966,10 +967,6 @@ def __init__(self, *args): # List of accumulated problems across all tests self.problems = [] self.is_commissioning = False - # The named pipe name must be set in the derived classes - self.app_pipe = None - # The app_pipe_pid pid must be set in the derived class - self.app_pipe_pid = None def get_test_steps(self, test: str) -> list[TestStep]: ''' Retrieves the test step list for the given test @@ -1033,12 +1030,6 @@ def get_test_desc(self, test: str) -> str: except AttributeError: return test - def get_default_app_pipe_name(self) -> str: - return self.app_pipe - - def get_default_app_pipe_pid(self) -> int: - return self.app_pipe_pid - def write_to_app_pipe(self, command_dict: dict, app_pipe_name: Optional[str] = None, app_pid: Optional[int] = None): """ Send an out-of-band command to a Matter app. @@ -1048,9 +1039,10 @@ def write_to_app_pipe(self, command_dict: dict, app_pipe_name: Optional[str] = N app_pid (Optional[uint], optional): pid of the process for app_pipe_name. Defaults to None. Extra: - Using parameter app_pipe_name replaces self.app_app_pipe_name. - Using parameter app-pid replaces self.app_pid. - Use the following environment variables: + By default app_pipe_name is taken from CI argument --app_pipe. Parameter (app_pipe_name) overwrites this value. + By default app_pid is taken from CI argument --app-pid. Parameter (app_pid) overwrites this value. + + This method use the following environment variables: - LINUX_DUT_IP * if not provided, the Matter app is assumed to run on the same machine as the test, @@ -1066,9 +1058,9 @@ def write_to_app_pipe(self, command_dict: dict, app_pipe_name: Optional[str] = N """ if app_pipe_name is None: - app_pipe_name = self.get_default_app_pipe_name() + app_pipe_name = self.matter_test_config.app_pipe if app_pid is None: - app_pid = self.get_default_app_pipe_pid() + app_pid = self.matter_test_config.app_pid if not isinstance(app_pipe_name, str): raise TypeError("The named pipe must be provided as a string value") @@ -1082,13 +1074,15 @@ def write_to_app_pipe(self, command_dict: dict, app_pipe_name: Optional[str] = N import os dut_ip = os.getenv('LINUX_DUT_IP') + # Checks for concatenate app_pipe and app_pid + if not isinstance(app_pid, int): + raise TypeError("The --app-pid flag is not instance of int") + # Verify we have a valid app-id + if app_pid == 0: + asserts.fail("app_pid is 0 , is the flag --app-pid set?. app-id flag must be set in order to write to pipe.") + app_pipe_name = app_pipe_name + str(app_pid) + if dut_ip is None: - if not isinstance(app_pid, int): - raise TypeError("The app_pid flag is not instance of int") - # Verify we have a valid app-id - if app_pid == 0: - asserts.fail("app_pid is 0 , is the flag --app-pid set?. app-id flag must be set in order to write to pipe.") - app_pipe_name = app_pipe_name + str(app_pid) if not os.path.exists(app_pipe_name): # Named pipes are unique, so we MUST have consistent PID/paths # Set up for them to work. @@ -1981,6 +1975,7 @@ def convert_args_to_matter_config(args: argparse.Namespace) -> MatterTestConfig: config.timeout = args.timeout # This can be none, we pull the default from the test if it's unspecified 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.app_pipe = args.app_pipe config.fail_on_skipped_tests = args.fail_on_skipped config.controller_node_id = args.controller_node_id @@ -2038,6 +2033,7 @@ def parse_matter_test_args(argv: Optional[List[str]] = None) -> MatterTestConfig 'and NodeID to assign if commissioning (default: %d)' % _DEFAULT_DUT_NODE_ID, nargs="+") basic_group.add_argument('--endpoint', type=int, default=None, help="Endpoint under test") basic_group.add_argument('--app-pid', type=int, default=0, help="The PID of the app against which the test is going to run") + basic_group.add_argument('--app-pipe', type=str, default=None, help="The path of the app to send an out-of-band command") basic_group.add_argument('--timeout', type=int, help="Test timeout in seconds") basic_group.add_argument("--PICS", help="PICS file path", type=str) From 4a48823a57b3518cbb443feeae373b442630016a Mon Sep 17 00:00:00 2001 From: jtrejoespinoza-grid Date: Wed, 19 Feb 2025 16:57:34 -0700 Subject: [PATCH 10/12] Add ci-arg --app-pipe with pipe name. Removed self.pid and self.pipe_name to use the values from arguments while on CI --- src/python_testing/TC_OCC_3_1.py | 9 ++++----- src/python_testing/TC_OCC_3_2.py | 5 +---- src/python_testing/TC_RVCCLEANM_2_1.py | 4 +--- src/python_testing/TC_RVCCLEANM_2_2.py | 3 +-- src/python_testing/TC_RVCOPSTATE_2_1.py | 3 +-- src/python_testing/TC_RVCOPSTATE_2_3.py | 3 +-- src/python_testing/TC_RVCOPSTATE_2_4.py | 3 +-- src/python_testing/TC_RVCRUNM_2_1.py | 3 +-- src/python_testing/TC_RVCRUNM_2_2.py | 3 +-- src/python_testing/TC_SEAR_1_2.py | 3 +-- src/python_testing/TC_SEAR_1_3.py | 3 +-- src/python_testing/TC_SEAR_1_5.py | 3 +-- src/python_testing/TC_SEAR_1_6.py | 3 +-- 13 files changed, 16 insertions(+), 32 deletions(-) diff --git a/src/python_testing/TC_OCC_3_1.py b/src/python_testing/TC_OCC_3_1.py index ae65ffa671c1ea..9fa5f144b5d430 100644 --- a/src/python_testing/TC_OCC_3_1.py +++ b/src/python_testing/TC_OCC_3_1.py @@ -27,6 +27,7 @@ # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto # --endpoint 1 +# --app-pipe /tmp/chip_all_clusters_fifo_ # --bool-arg simulate_occupancy:true # factory-reset: true # quiet: true @@ -94,8 +95,6 @@ def pics_TC_OCC_3_1(self) -> list[str]: @async_test_body async def test_TC_OCC_3_1(self): hold_time = 10 if not self.is_ci else 1.0 # 10 seconds for occupancy state hold time - self.app_pipe = "/tmp/chip_all_clusters_fifo_" - self.app_pipe_pid = self.matter_test_config.app_pid self.step(1) # Commissioning already done self.step(2) @@ -119,7 +118,7 @@ async def test_TC_OCC_3_1(self): if self.is_ci: # CI call to trigger unoccupied. - self.write_to_app_pipe('{"Name":"SetOccupancy", "EndpointId": 1, "Occupancy": 0}') + self.write_to_app_pipe({"Name": "SetOccupancy", "EndpointId": 1, "Occupancy": 0}) else: self.wait_for_user_input( prompt_msg="Type any letter and press ENTER after the sensor occupancy is unoccupied state (occupancy attribute = 0)") @@ -143,7 +142,7 @@ async def test_TC_OCC_3_1(self): self.step("5a") # CI call to trigger on if self.is_ci: - self.write_to_app_pipe('{"Name":"SetOccupancy", "EndpointId": 1, "Occupancy": 1}') + self.write_to_app_pipe({"Name": "SetOccupancy", "EndpointId": 1, "Occupancy": 1}) else: # Trigger occupancy sensor to change Occupancy attribute value to 1 => TESTER ACTION on DUT self.wait_for_user_input(prompt_msg="Type any letter and press ENTER after a sensor occupancy is triggered.") @@ -169,7 +168,7 @@ async def test_TC_OCC_3_1(self): self.step(6) if self.is_ci: # CI call to trigger unoccupied. - self.write_to_app_pipe('{"Name":"SetOccupancy", "EndpointId": 1, "Occupancy": 0}') + self.write_to_app_pipe({"Name": "SetOccupancy", "EndpointId": 1, "Occupancy": 0}) if has_hold_time: time.sleep(hold_time + 2.0) # add some extra 2 seconds to ensure hold time has passed. diff --git a/src/python_testing/TC_OCC_3_2.py b/src/python_testing/TC_OCC_3_2.py index 01b7efc171ad03..b5c6e1e5938ebf 100644 --- a/src/python_testing/TC_OCC_3_2.py +++ b/src/python_testing/TC_OCC_3_2.py @@ -29,6 +29,7 @@ # --passcode 20202021 # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# --app-pipe /tmp/chip_all_clusters_fifo_ # --endpoint 1 # --bool-arg simulate_occupancy:true # factory-reset: true @@ -41,8 +42,6 @@ # [TC-OCC-3.2] test precedure step 3a, 3c import logging -import time - import chip.clusters as Clusters from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, async_test_body, await_sequence_of_reports, default_matter_test_main) @@ -88,8 +87,6 @@ async def test_TC_OCC_3_2(self): endpoint_id = self.get_endpoint() node_id = self.dut_node_id dev_ctrl = self.default_controller - self.app_pipe = "/tmp/chip_all_clusters_fifo_" - self.app_pipe_pid = self.matter_test_config.app_pid post_prompt_settle_delay_seconds = 10.0 cluster = Clusters.Objects.OccupancySensing diff --git a/src/python_testing/TC_RVCCLEANM_2_1.py b/src/python_testing/TC_RVCCLEANM_2_1.py index 6e6b137cc6d06e..eae59b6a30926d 100644 --- a/src/python_testing/TC_RVCCLEANM_2_1.py +++ b/src/python_testing/TC_RVCCLEANM_2_1.py @@ -32,6 +32,7 @@ # --int-arg PIXIT.RVCCLEANM.MODE_CHANGE_FAIL:1 # --int-arg PIXIT.RVCCLEANM.MODE_CHANGE_OK:2 # --endpoint 1 +# --app-pipe /tmp/chip_rvc_fifo_ # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto # factory-reset: true @@ -57,8 +58,6 @@ def __init__(self, *args): self.mode_ok = 0 self.mode_fail = 0 self.is_ci = False - self.app_pipe = "/tmp/chip_rvc_fifo_" - self.app_pipe_pid = self.matter_test_config.app_pid async def read_mod_attribute_expect_success(self, endpoint, attribute): cluster = Clusters.Objects.RvcCleanMode @@ -93,7 +92,6 @@ async def test_TC_RVCCLEANM_2_1(self): 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") - self.app_pipe_pid = self.matter_test_config.app_pid asserts.assert_true(self.check_pics("RVCCLEANM.S.A0000"), "RVCCLEANM.S.A0000 must be supported") asserts.assert_true(self.check_pics("RVCCLEANM.S.A0001"), "RVCCLEANM.S.A0001 must be supported") diff --git a/src/python_testing/TC_RVCCLEANM_2_2.py b/src/python_testing/TC_RVCCLEANM_2_2.py index a04f40195b90c8..1bfe8ea37365a1 100644 --- a/src/python_testing/TC_RVCCLEANM_2_2.py +++ b/src/python_testing/TC_RVCCLEANM_2_2.py @@ -29,6 +29,7 @@ # --discriminator 1234 # --passcode 20202021 # --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values +# --app-pipe /tmp/chip_rvc_fifo_ # --endpoint 1 # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto @@ -63,7 +64,6 @@ def __init__(self, *args): self.old_clean_mode_dut = 0 self.new_clean_mode_th = 0 self.is_ci = False - self.app_pipe = "/tmp/chip_rvc_fifo_" async def read_mod_attribute_expect_success(self, cluster, attribute): return await self.read_single_attribute_check_success( @@ -107,7 +107,6 @@ async def test_TC_RVCCLEANM_2_2(self): self.directmodech_bit_mask = Clusters.RvcCleanMode.Bitmaps.Feature.kDirectModeChange self.endpoint = self.get_endpoint() self.is_ci = self.check_pics("PICS_SDK_CI_ONLY") - self.app_pipe_pid = self.matter_test_config.app_pid asserts.assert_true(self.check_pics("RVCCLEANM.S"), "RVCCLEANM.S must be supported") asserts.assert_true(self.check_pics("RVCRUNM.S.A0000"), "RVCRUNM.S.A0000 must be supported") diff --git a/src/python_testing/TC_RVCOPSTATE_2_1.py b/src/python_testing/TC_RVCOPSTATE_2_1.py index c71dfa5eadcce9..f90f90e8d4d572 100644 --- a/src/python_testing/TC_RVCOPSTATE_2_1.py +++ b/src/python_testing/TC_RVCOPSTATE_2_1.py @@ -30,6 +30,7 @@ # --passcode 20202021 # --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values # --endpoint 1 +# --app-pipe /tmp/chip_rvc_fifo_ # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto # factory-reset: true @@ -49,7 +50,6 @@ def __init__(self, *args): super().__init__(*args) self.endpoint = None self.is_ci = False - self.app_pipe = "/tmp/chip_rvc_fifo_" async def read_mod_attribute_expect_success(self, endpoint, attribute): cluster = Clusters.Objects.RvcOperationalState @@ -90,7 +90,6 @@ async def test_TC_RVCOPSTATE_2_1(self): 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") - self.app_pipe_pid = self.matter_test_config.app_pid cluster = Clusters.RvcOperationalState attributes = cluster.Attributes diff --git a/src/python_testing/TC_RVCOPSTATE_2_3.py b/src/python_testing/TC_RVCOPSTATE_2_3.py index 879e6f93775d6e..ecab70d255b145 100644 --- a/src/python_testing/TC_RVCOPSTATE_2_3.py +++ b/src/python_testing/TC_RVCOPSTATE_2_3.py @@ -30,6 +30,7 @@ # --passcode 20202021 # --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values # --endpoint 1 +# --app-pipe /tmp/chip_rvc_fifo_ # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto # factory-reset: true @@ -99,7 +100,6 @@ def __init__(self, *args): super().__init__(*args) self.endpoint = None self.is_ci = False - self.app_pipe = "/tmp/chip_rvc_fifo_" async def read_mod_attribute_expect_success(self, endpoint, attribute): cluster = Clusters.Objects.RvcOperationalState @@ -161,7 +161,6 @@ async def test_TC_RVCOPSTATE_2_3(self): 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") - self.app_pipe_pid = self.matter_test_config.app_pid asserts.assert_true(self.check_pics("RVCOPSTATE.S.A0003"), "RVCOPSTATE.S.A0003 must be supported") asserts.assert_true(self.check_pics("RVCOPSTATE.S.A0004"), "RVCOPSTATE.S.A0004 must be supported") diff --git a/src/python_testing/TC_RVCOPSTATE_2_4.py b/src/python_testing/TC_RVCOPSTATE_2_4.py index a6db99ea79f6a7..1ce70cc9d2bbd6 100644 --- a/src/python_testing/TC_RVCOPSTATE_2_4.py +++ b/src/python_testing/TC_RVCOPSTATE_2_4.py @@ -30,6 +30,7 @@ # --passcode 20202021 # --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values # --endpoint 1 +# --app-pipe /tmp/chip_rvc_fifo_ # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto # factory-reset: true @@ -64,7 +65,6 @@ def __init__(self, *args): super().__init__(*args) self.endpoint = None self.is_ci = False - self.app_pipe = "/tmp/chip_rvc_fifo_" async def read_mod_attribute_expect_success(self, endpoint, attribute): cluster = Clusters.Objects.RvcOperationalState @@ -106,7 +106,6 @@ async def test_TC_RVCOPSTATE_2_4(self): 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") - self.app_pipe_pid = self.matter_test_config.app_pid asserts.assert_true(self.check_pics("RVCOPSTATE.S.A0004"), "RVCOPSTATE.S.A0004 must be supported") asserts.assert_true(self.check_pics("RVCOPSTATE.S.C04.Tx"), "RVCOPSTATE.S.C04.Tx must be supported") diff --git a/src/python_testing/TC_RVCRUNM_2_1.py b/src/python_testing/TC_RVCRUNM_2_1.py index 39d2a2f058da03..71ef7cd920fd37 100644 --- a/src/python_testing/TC_RVCRUNM_2_1.py +++ b/src/python_testing/TC_RVCRUNM_2_1.py @@ -32,6 +32,7 @@ # --endpoint 1 # --int-arg PIXIT.RVCRUNM.MODE_CHANGE_OK:0 # --int-arg PIXIT.RVCRUNM.MODE_CHANGE_FAIL:2 +# --app-pipe /tmp/chip_rvc_fifo_ # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto # factory-reset: true @@ -58,7 +59,6 @@ def __init__(self, *args): self.mode_ok = 0 self.mode_fail = 0 self.is_ci = False - self.app_pipe = "/tmp/chip_rvc_fifo_" async def read_mod_attribute_expect_success(self, endpoint, attribute): cluster = Clusters.Objects.RvcRunMode @@ -87,7 +87,6 @@ async def test_TC_RVCRUNM_2_1(self): 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") - self.app_pipe_pid = self.matter_test_config.app_pid asserts.assert_true(self.check_pics("RVCRUNM.S.A0000"), "RVCRUNM.S.A0000 must be supported") asserts.assert_true(self.check_pics("RVCRUNM.S.A0001"), "RVCRUNM.S.A0001 must be supported") diff --git a/src/python_testing/TC_RVCRUNM_2_2.py b/src/python_testing/TC_RVCRUNM_2_2.py index cd3da9564ff4f4..c88f7c8bbc3d86 100644 --- a/src/python_testing/TC_RVCRUNM_2_2.py +++ b/src/python_testing/TC_RVCRUNM_2_2.py @@ -30,6 +30,7 @@ # --discriminator 1234 # --passcode 20202021 # --endpoint 1 +# --app-pipe /tmp/chip_rvc_fifo_ # --int-arg PIXIT.RVCRUNM.MODE_A:1 # --int-arg PIXIT.RVCRUNM.MODE_B:2 # --trace-to json:${TRACE_TEST_JSON}.json @@ -84,7 +85,6 @@ def __init__(self, *args): self.supported_run_modes_dut = [] self.idle_mode_dut = 0 self.is_ci = False - self.app_pipe = "/tmp/chip_rvc_fifo_" async def read_mod_attribute_expect_success(self, cluster, attribute): return await self.read_single_attribute_check_success( @@ -138,7 +138,6 @@ async def test_TC_RVCRUNM_2_2(self): 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'] - self.app_pipe_pid = self.matter_test_config.app_pid asserts.assert_true(self.check_pics("RVCRUNM.S"), "RVCRUNM.S must be supported") # I think that the following PICS should be listed in the preconditions section in the test plan as if either diff --git a/src/python_testing/TC_SEAR_1_2.py b/src/python_testing/TC_SEAR_1_2.py index bc233408ee7116..9670a4231fff70 100644 --- a/src/python_testing/TC_SEAR_1_2.py +++ b/src/python_testing/TC_SEAR_1_2.py @@ -31,6 +31,7 @@ # --passcode 20202021 # --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values # --endpoint 1 +# --app-pipe /tmp/chip_rvc_fifo_ # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto # factory-reset: true @@ -50,7 +51,6 @@ def __init__(self, *args): super().__init__(*args) self.endpoint = None self.is_ci = False - self.app_pipe = "/tmp/chip_rvc_fifo_" self.mapid_list = [] # this must be kept in sync with the definitions from the Common Landmark Semantic Tag Namespace @@ -207,7 +207,6 @@ async def test_TC_SEAR_1_2(self): 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") - self.app_pipe_pid = self.matter_test_config.app_pid self.print_step(1, "Commissioning, already done") # Ensure that the device is in the correct state diff --git a/src/python_testing/TC_SEAR_1_3.py b/src/python_testing/TC_SEAR_1_3.py index fe105e87f8e979..ccd5998233921d 100644 --- a/src/python_testing/TC_SEAR_1_3.py +++ b/src/python_testing/TC_SEAR_1_3.py @@ -31,6 +31,7 @@ # --passcode 20202021 # --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values # --endpoint 1 +# --app-pipe /tmp/chip_rvc_fifo_ # --json-arg PIXIT.SEAR.VALID_AREAS:'[7, 1234567]' # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto @@ -50,7 +51,6 @@ def __init__(self, *args): super().__init__(*args) self.endpoint = None self.is_ci = False - self.app_pipe = "/tmp/chip_rvc_fifo_" async def read_sear_attribute_expect_success(self, endpoint, attribute): cluster = Clusters.Objects.ServiceArea @@ -91,7 +91,6 @@ async def test_TC_SEAR_1_3(self): 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") - self.app_pipe_pid = self.matter_test_config.app_pid self.print_step(1, "Commissioning, already done") # Ensure that the device is in the correct state diff --git a/src/python_testing/TC_SEAR_1_5.py b/src/python_testing/TC_SEAR_1_5.py index 473c2dbb95095e..f39908a29994fa 100644 --- a/src/python_testing/TC_SEAR_1_5.py +++ b/src/python_testing/TC_SEAR_1_5.py @@ -31,6 +31,7 @@ # --passcode 20202021 # --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values # --endpoint 1 +# --app-pipe /tmp/chip_rvc_fifo_ # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto # factory-reset: true @@ -50,7 +51,6 @@ def __init__(self, *args): super().__init__(*args) self.endpoint = None self.is_ci = False - self.app_pipe = "/tmp/chip_rvc_fifo_" async def read_sear_attribute_expect_success(self, endpoint, attribute): cluster = Clusters.Objects.ServiceArea @@ -105,7 +105,6 @@ async def test_TC_SEAR_1_5(self): 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") - self.app_pipe_pid = self.matter_test_config.app_pid self.print_step(1, "Commissioning, already done") diff --git a/src/python_testing/TC_SEAR_1_6.py b/src/python_testing/TC_SEAR_1_6.py index a2dbe4a4284cbe..88e380fab228ed 100644 --- a/src/python_testing/TC_SEAR_1_6.py +++ b/src/python_testing/TC_SEAR_1_6.py @@ -31,6 +31,7 @@ # --passcode 20202021 # --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values # --endpoint 1 +# --app-pipe /tmp/chip_rvc_fifo_ # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto # factory-reset: true @@ -50,7 +51,6 @@ def __init__(self, *args): super().__init__(*args) self.endpoint = None self.is_ci = False - self.app_pipe = "/tmp/chip_rvc_fifo_" async def read_sear_attribute_expect_success(self, endpoint, attribute): cluster = Clusters.Objects.ServiceArea @@ -88,7 +88,6 @@ async def test_TC_SEAR_1_6(self): 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") - self.app_pipe_pid = self.matter_test_config.app_pid self.print_step(1, "Commissioning, already done") From ede6435df9d99afd850e62e00cfeaa8b4d9c1e85 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Thu, 20 Feb 2025 00:02:19 +0000 Subject: [PATCH 11/12] Restyled by isort --- src/python_testing/TC_OCC_3_2.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/python_testing/TC_OCC_3_2.py b/src/python_testing/TC_OCC_3_2.py index b5c6e1e5938ebf..0eb7c907aa16ff 100644 --- a/src/python_testing/TC_OCC_3_2.py +++ b/src/python_testing/TC_OCC_3_2.py @@ -42,6 +42,7 @@ # [TC-OCC-3.2] test precedure step 3a, 3c import logging + import chip.clusters as Clusters from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, async_test_body, await_sequence_of_reports, default_matter_test_main) From f753533f16d30b4e664069f607e1f3286ba82004 Mon Sep 17 00:00:00 2001 From: jtrejoespinoza-grid Date: Thu, 20 Feb 2025 11:00:43 -0700 Subject: [PATCH 12/12] Opstate fixes. Uses the param implementation as I dont want to modify all this code. --- src/python_testing/TC_OpstateCommon.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/python_testing/TC_OpstateCommon.py b/src/python_testing/TC_OpstateCommon.py index 1a4cfbe7150e30..81147c3e3db6ee 100644 --- a/src/python_testing/TC_OpstateCommon.py +++ b/src/python_testing/TC_OpstateCommon.py @@ -109,11 +109,11 @@ def init_test(self): app_pid = get_pid("chip-all-clusters-app") if app_pid is None: asserts.fail("The --app-pid flag must be set when PICS_SDK_CI_ONLY is set") - self.app_pipe = self.app_pipe + str(app_pid) + self.app_pid = app_pid def send_raw_manual_or_pipe_command(self, command: dict, msg: str): if self.is_ci: - self.write_to_app_pipe(command) + self.write_to_app_pipe(command, app_pipe_name=self.app_pipe, app_pid=self.app_pid) time.sleep(0.1) else: prompt = msg if msg is not None else "Press Enter when ready."