From 504855223bbc51ed270638c902cc7a01ee400599 Mon Sep 17 00:00:00 2001 From: Jake Ororke Date: Wed, 3 Jul 2024 10:43:46 -0700 Subject: [PATCH 01/16] Possible fix for mts issue #228: - Removed PICS from python RVC Clean and RVC Run tests - Replaced with commands and attributes gathered from DUT. --- src/python_testing/TC_RVCCLEANM_1_2.py | 14 +++++--- src/python_testing/TC_RVCCLEANM_2_1.py | 43 +++++++++++++++++------ src/python_testing/TC_RVCCLEANM_2_2.py | 28 ++++++++++----- src/python_testing/TC_RVCRUNM_1_2.py | 9 +++-- src/python_testing/TC_RVCRUNM_2_1.py | 41 +++++++++++++++------- src/python_testing/TC_RVCRUNM_2_2.py | 48 +++++++++++++++++++------- 6 files changed, 132 insertions(+), 51 deletions(-) diff --git a/src/python_testing/TC_RVCCLEANM_1_2.py b/src/python_testing/TC_RVCCLEANM_1_2.py index a0b5fa4b6fb551..a13bff242c4374 100644 --- a/src/python_testing/TC_RVCCLEANM_1_2.py +++ b/src/python_testing/TC_RVCCLEANM_1_2.py @@ -47,7 +47,7 @@ def __init__(self, *args): self.supported_modes_dut = [] async def read_mod_attribute_expect_success(self, endpoint, attribute): - cluster = Clusters.Objects.RvcCleanMode + cluster = Clusters.RvcCleanMode return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attribute) def pics_TC_RVCCLEANM_1_2(self) -> list[str]: @@ -57,11 +57,16 @@ def pics_TC_RVCCLEANM_1_2(self) -> list[str]: async def test_TC_RVCCLEANM_1_2(self): self.endpoint = self.matter_test_config.endpoint - attributes = Clusters.RvcCleanMode.Attributes + RVCClean_cluster = Clusters.RvcCleanMode + attributes = RVCClean_cluster.Attributes + RVCClean_attr_list = attributes.AttributeList + attribute_list = await self.read_single_attribute_check_success(endpoint=self.endpoint, cluster=RVCClean_cluster, attribute=RVCClean_attr_list) + supported_modes_attr_id = attributes.SupportedModes.attribute_id + current_mode_attr_id = attributes.CurrentMode.attribute_id self.print_step(1, "Commissioning, already done") - if self.check_pics("RVCCLEANM.S.A0000"): + if supported_modes_attr_id in attribute_list: self.print_step(2, "Read SupportedModes attribute") supported_modes = await self.read_mod_attribute_expect_success(endpoint=self.endpoint, attribute=attributes.SupportedModes) @@ -124,13 +129,12 @@ async def test_TC_RVCCLEANM_1_2(self): asserts.assert_true(has_vacuum_or_mop_mode_tag, "At least one ModeOptionsStruct entry must include either the Vacuum or Mop mode tag") - if self.check_pics("RVCCLEANM.S.A0001"): + if current_mode_attr_id in attribute_list: self.print_step(3, "Read CurrentMode attribute") current_mode = await self.read_mod_attribute_expect_success(endpoint=self.endpoint, attribute=attributes.CurrentMode) logging.info("CurrentMode: %s" % (current_mode)) asserts.assert_true(current_mode in self.supported_modes_dut, "CurrentMode is not a supported mode!") - if __name__ == "__main__": default_matter_test_main() diff --git a/src/python_testing/TC_RVCCLEANM_2_1.py b/src/python_testing/TC_RVCCLEANM_2_1.py index 0a6e72b30cf283..05224cd15542a6 100644 --- a/src/python_testing/TC_RVCCLEANM_2_1.py +++ b/src/python_testing/TC_RVCCLEANM_2_1.py @@ -84,19 +84,40 @@ async def test_TC_RVCCLEANM_2_1(self): self.endpoint = self.matter_test_config.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") - 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") + app_pid = self.matter_test_config.app_pid + if app_pid != 0: + self.is_ci = True self.app_pipe = self.app_pipe + str(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") - asserts.assert_true(self.check_pics("RVCCLEANM.S.C00.Rsp"), "RVCCLEANM.S.C00.Rsp must be supported") - asserts.assert_true(self.check_pics("RVCCLEANM.S.C01.Tx"), "RVCCLEANM.S.C01.Tx must be supported") - - attributes = Clusters.RvcCleanMode.Attributes + RVCClean_cluster = Clusters.RvcCleanMode + + # Gathering Available Attributes and associated ids + attributes = RVCClean_cluster.Attributes + RVCClean_attr_list = attributes.AttributeList + attribute_list = await self.read_single_attribute_check_success(endpoint=self.endpoint, cluster=RVCClean_cluster, attribute=RVCClean_attr_list) + supported_modes_attr_id = attributes.SupportedModes.attribute_id + current_mode_attr_id = attributes.CurrentMode.attribute_id + + # Gathering Accepted and Generated Commands and associated ids + commands = RVCClean_cluster.Commands + RVCClean_accptcmd_list = attributes.AcceptedCommandList + RVCClean_gencmd_list = attributes.GeneratedCommandList + accepted_cmd_list = await self.read_single_attribute_check_success(endpoint=self.endpoint, cluster=RVCClean_cluster, attribute=RVCClean_accptcmd_list) + generated_cmd_list = await self.read_single_attribute_check_success(endpoint=self.endpoint, cluster=RVCClean_cluster, attribute=RVCClean_gencmd_list) + chg_mode_cmd_id = commands.ChangeToMode.command_id + chg_rsp_cmd_id = commands.ChangeToModeResponse.command_id + + if supported_modes_attr_id not in attribute_list: + asserts.fail("supported modes needs to be supported attribute") + + if current_mode_attr_id not in attribute_list: + asserts.fail("Current mode needs to be supported attribute") + + if chg_mode_cmd_id not in accepted_cmd_list: + asserts.fail("Change To Mode receiving commands needs to be supported") + + if chg_rsp_cmd_id not in generated_cmd_list: + asserts.fail("Change To Mode Response to transmit commands needs to be supported") self.print_step(1, "Commissioning, already done") diff --git a/src/python_testing/TC_RVCCLEANM_2_2.py b/src/python_testing/TC_RVCCLEANM_2_2.py index b5f9a108a944f4..6fa7ebc755e906 100644 --- a/src/python_testing/TC_RVCCLEANM_2_2.py +++ b/src/python_testing/TC_RVCCLEANM_2_2.py @@ -75,7 +75,7 @@ def print_instruction(self, step_number, instruction): def pics_TC_RVCCLEANM_2_2(self) -> list[str]: return ["RVCCLEANM.S"] - # Sends and out-of-band command to the rvc-app + # Sends an out-of-band command to the rvc-app def write_to_app_pipe(self, command): with open(self.app_pipe, "w") as app_pipe: app_pipe.write(command + "\n") @@ -86,16 +86,24 @@ def write_to_app_pipe(self, command): @async_test_body async def test_TC_RVCCLEANM_2_2(self): self.endpoint = self.matter_test_config.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") + app_pid = self.matter_test_config.app_pid + if app_pid != 0: + self.is_ci = True self.app_pipe = self.app_pipe + str(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") - asserts.assert_true(self.check_pics("RVCRUNM.S.A0001"), "RVCRUNM.S.A0001 must be supported") + # replaces the RVCRUNM attributes from PICS file + RVCRun_cluster = Clusters.RvcRunMode + attributes = Clusters.RvcRunMode.Attributes + RVCRun_attr_list = attributes.AttributeList + attribute_list = await self.read_single_attribute_check_success(endpoint=self.endpoint, cluster=RVCRun_cluster, attribute=RVCRun_attr_list) + supported_modes_attr_id = attributes.SupportedModes.attribute_id + current_mode_attr_id = attributes.CurrentMode.attribute_id + + if supported_modes_attr_id not in attribute_list: + asserts.fail("Supported modes needs to be supported attribute") + + if current_mode_attr_id not in attribute_list: + asserts.fail("Current mode needs to be supported attribute") self.print_step(1, "Commissioning, already done") @@ -105,8 +113,10 @@ async def test_TC_RVCCLEANM_2_2(self): self.print_step( 2, "Manually put the device in a state in which the RVC Run Mode cluster’s CurrentMode attribute is set to a mode without the Idle mode tag.") + if self.is_ci: await self.send_run_change_to_mode_cmd(1) + else: self.wait_for_user_input( prompt_msg="Manually put the device in a state in which the RVC Run Mode cluster’s CurrentMode attribute is set to a mode without the Idle mode tag, and press Enter when done.") diff --git a/src/python_testing/TC_RVCRUNM_1_2.py b/src/python_testing/TC_RVCRUNM_1_2.py index e3e55ddcd07fa4..c696af369dfffa 100644 --- a/src/python_testing/TC_RVCRUNM_1_2.py +++ b/src/python_testing/TC_RVCRUNM_1_2.py @@ -57,11 +57,16 @@ def pics_TC_RVCRUNM_1_2(self) -> list[str]: async def test_TC_RVCRUNM_1_2(self): self.endpoint = self.matter_test_config.endpoint + RVCRun_cluster = Clusters.RvcRunMode attributes = Clusters.RvcRunMode.Attributes + RVCRun_attr_list = attributes.AttributeList + attribute_list = await self.read_single_attribute_check_success(endpoint=self.endpoint, cluster=RVCRun_cluster, attribute=RVCRun_attr_list) + supported_modes_attr_id = attributes.SupportedModes.attribute_id + current_mode_attr_id = attributes.CurrentMode.attribute_id self.print_step(1, "Commissioning, already done") - if self.check_pics("RVCRUNM.S.A0000"): + if supported_modes_attr_id in attribute_list: self.print_step(2, "Read SupportedModes attribute") supported_modes = await self.read_mod_attribute_expect_success(endpoint=self.endpoint, attribute=attributes.SupportedModes) @@ -143,7 +148,7 @@ async def test_TC_RVCRUNM_1_2(self): asserts.assert_true(at_least_one_cleaning_mode_tag, "The Supported Modes does not have an entry of Cleaning(0x4001)") - if self.check_pics("RVCRUNM.S.A0001"): + if current_mode_attr_id in attribute_list: self.print_step(3, "Read CurrentMode attribute") current_mode = await self.read_mod_attribute_expect_success(endpoint=self.endpoint, attribute=attributes.CurrentMode) diff --git a/src/python_testing/TC_RVCRUNM_2_1.py b/src/python_testing/TC_RVCRUNM_2_1.py index ca6986dcbb5840..a2c1516607fba0 100644 --- a/src/python_testing/TC_RVCRUNM_2_1.py +++ b/src/python_testing/TC_RVCRUNM_2_1.py @@ -79,19 +79,36 @@ async def test_TC_RVCRUNM_2_1(self): self.endpoint = self.matter_test_config.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") - 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) - - 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") - asserts.assert_true(self.check_pics("RVCRUNM.S.C00.Rsp"), "RVCRUNM.S.C00.Rsp must be supported") - asserts.assert_true(self.check_pics("RVCRUNM.S.C01.Tx"), "RVCRUNM.S.C01.Tx must be supported") - attributes = Clusters.RvcRunMode.Attributes + RVCRun_cluster = Clusters.RvcRunMode + + # Gathering Available Attributes and associated ids + attributes = RVCRun_cluster.Attributes + RVCRun_attr_list = attributes.AttributeList + attribute_list = await self.read_single_attribute_check_success(endpoint=self.endpoint, cluster=RVCRun_cluster, attribute=RVCRun_attr_list) + supported_modes_attr_id = attributes.SupportedModes.attribute_id + current_mode_attr_id = attributes.CurrentMode.attribute_id + + # Gathering Accepted and Generated Commands and associated ids + commands = RVCRun_cluster.Commands + RVCRun_accptcmd_list = attributes.AcceptedCommandList + RVCRun_gencmd_list = attributes.GeneratedCommandList + accepted_cmd_list = await self.read_single_attribute_check_success(endpoint=self.endpoint, cluster=RVCRun_cluster, attribute=RVCRun_accptcmd_list) + generated_cmd_list = await self.read_single_attribute_check_success(endpoint=self.endpoint, cluster=RVCRun_cluster, attribute=RVCRun_gencmd_list) + chg_mode_cmd_id = commands.ChangeToMode.command_id + chg_rsp_cmd_id = commands.ChangeToModeResponse.command_id + + if supported_modes_attr_id not in attribute_list: + asserts.fail("supported modes needs to be supported attribute") + + if current_mode_attr_id not in attribute_list: + asserts.fail("Current mode needs to be supported attribute") + + if chg_mode_cmd_id not in accepted_cmd_list: + asserts.fail("Change To Mode receiving commands needs to be supported") + + if chg_rsp_cmd_id not in generated_cmd_list: + asserts.fail("Change To Mode Response to send commands needs to be supported") self.print_step(1, "Commissioning, already done") diff --git a/src/python_testing/TC_RVCRUNM_2_2.py b/src/python_testing/TC_RVCRUNM_2_2.py index 5723e1ec2f6fb8..7a35373d57d9ed 100644 --- a/src/python_testing/TC_RVCRUNM_2_2.py +++ b/src/python_testing/TC_RVCRUNM_2_2.py @@ -118,23 +118,47 @@ async def test_TC_RVCRUNM_2_2(self): "PIXIT.RVCRUNM.MODE_B:") self.endpoint = self.matter_test_config.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'] - 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") + app_pid = self.matter_test_config.app_pid + if app_pid != 0: + self.is_ci = True + self.app_pipe = self.app_pipe + str(app_pid) + + + app_pid = self.matter_test_config.app_pid + if app_pid != 0: + self.is_ci = True self.app_pipe = self.app_pipe + str(app_pid) + + RVCRun_cluster = Clusters.RvcRunMode + + # Gathering Available Attributes and associated ids + attributes = RVCRun_cluster.Attributes + RVCRun_attr_list = attributes.AttributeList + attribute_list = await self.read_single_attribute_check_success(endpoint=self.endpoint, cluster=RVCRun_cluster, attribute=RVCRun_attr_list) + supported_modes_attr_id = attributes.SupportedModes.attribute_id + current_mode_attr_id = attributes.CurrentMode.attribute_id + + # Gathering Accepted and Generated Commands and associated ids + commands = RVCRun_cluster.Commands + RVCRun_accptcmd_list = attributes.AcceptedCommandList + RVCRun_gencmd_list = attributes.GeneratedCommandList + accepted_cmd_list = await self.read_single_attribute_check_success(endpoint=self.endpoint, cluster=RVCRun_cluster, attribute=RVCRun_accptcmd_list) + generated_cmd_list = await self.read_single_attribute_check_success(endpoint=self.endpoint, cluster=RVCRun_cluster, attribute=RVCRun_gencmd_list) + chg_mode_cmd_id = commands.ChangeToMode.command_id + + if supported_modes_attr_id not in attribute_list: + asserts.fail("Supported modes needs to be supported attribute") + + if current_mode_attr_id not in attribute_list: + asserts.fail("Current mode needs to be supported attribute") + + if chg_mode_cmd_id not in accepted_cmd_list: + asserts.fail("Change To Mode receiving commands needs to be supported") - 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 - # of these PICS is not supported, this test would not be useful. - 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") - asserts.assert_true(self.check_pics("RVCRUNM.S.C00.Rsp"), "RVCRUNM.S.C00.Rsp must be supported") asserts.assert_true(self.check_pics("RVCRUNM.S.M.CAN_MANUALLY_CONTROLLED"), - "RVCRUNM.S.M.CAN_MANUALLY_CONTROLLED must be supported") + "RVCRUNM.S.M.CAN_MANUALLY_CONTROLLED must be supported") # Starting the test steps self.print_step(1, "Commissioning, already done") From fd9f5587448f44402c7b6ebc32448d8be10e6f74 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Wed, 3 Jul 2024 18:55:31 +0000 Subject: [PATCH 02/16] Restyled by autopep8 --- src/python_testing/TC_RVCCLEANM_1_2.py | 1 + src/python_testing/TC_RVCCLEANM_2_1.py | 4 ++-- src/python_testing/TC_RVCCLEANM_2_2.py | 8 ++++---- src/python_testing/TC_RVCRUNM_2_1.py | 2 +- src/python_testing/TC_RVCRUNM_2_2.py | 13 ++++++------- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/python_testing/TC_RVCCLEANM_1_2.py b/src/python_testing/TC_RVCCLEANM_1_2.py index a13bff242c4374..9e571195adec35 100644 --- a/src/python_testing/TC_RVCCLEANM_1_2.py +++ b/src/python_testing/TC_RVCCLEANM_1_2.py @@ -136,5 +136,6 @@ async def test_TC_RVCCLEANM_1_2(self): logging.info("CurrentMode: %s" % (current_mode)) asserts.assert_true(current_mode in self.supported_modes_dut, "CurrentMode is not a supported mode!") + if __name__ == "__main__": default_matter_test_main() diff --git a/src/python_testing/TC_RVCCLEANM_2_1.py b/src/python_testing/TC_RVCCLEANM_2_1.py index 05224cd15542a6..688847cc5b3f08 100644 --- a/src/python_testing/TC_RVCCLEANM_2_1.py +++ b/src/python_testing/TC_RVCCLEANM_2_1.py @@ -86,7 +86,7 @@ async def test_TC_RVCCLEANM_2_1(self): self.mode_fail = self.matter_test_config.global_test_params['PIXIT.RVCCLEANM.MODE_CHANGE_FAIL'] app_pid = self.matter_test_config.app_pid if app_pid != 0: - self.is_ci = True + self.is_ci = True self.app_pipe = self.app_pipe + str(app_pid) RVCClean_cluster = Clusters.RvcCleanMode @@ -109,7 +109,7 @@ async def test_TC_RVCCLEANM_2_1(self): if supported_modes_attr_id not in attribute_list: asserts.fail("supported modes needs to be supported attribute") - + if current_mode_attr_id not in attribute_list: asserts.fail("Current mode needs to be supported attribute") diff --git a/src/python_testing/TC_RVCCLEANM_2_2.py b/src/python_testing/TC_RVCCLEANM_2_2.py index 6fa7ebc755e906..1ff909133e3635 100644 --- a/src/python_testing/TC_RVCCLEANM_2_2.py +++ b/src/python_testing/TC_RVCCLEANM_2_2.py @@ -88,7 +88,7 @@ async def test_TC_RVCCLEANM_2_2(self): self.endpoint = self.matter_test_config.endpoint app_pid = self.matter_test_config.app_pid if app_pid != 0: - self.is_ci = True + self.is_ci = True self.app_pipe = self.app_pipe + str(app_pid) # replaces the RVCRUNM attributes from PICS file @@ -101,7 +101,7 @@ async def test_TC_RVCCLEANM_2_2(self): if supported_modes_attr_id not in attribute_list: asserts.fail("Supported modes needs to be supported attribute") - + if current_mode_attr_id not in attribute_list: asserts.fail("Current mode needs to be supported attribute") @@ -113,10 +113,10 @@ async def test_TC_RVCCLEANM_2_2(self): self.print_step( 2, "Manually put the device in a state in which the RVC Run Mode cluster’s CurrentMode attribute is set to a mode without the Idle mode tag.") - + if self.is_ci: await self.send_run_change_to_mode_cmd(1) - + else: self.wait_for_user_input( prompt_msg="Manually put the device in a state in which the RVC Run Mode cluster’s CurrentMode attribute is set to a mode without the Idle mode tag, and press Enter when done.") diff --git a/src/python_testing/TC_RVCRUNM_2_1.py b/src/python_testing/TC_RVCRUNM_2_1.py index a2c1516607fba0..a9561647ea1ac2 100644 --- a/src/python_testing/TC_RVCRUNM_2_1.py +++ b/src/python_testing/TC_RVCRUNM_2_1.py @@ -100,7 +100,7 @@ async def test_TC_RVCRUNM_2_1(self): if supported_modes_attr_id not in attribute_list: asserts.fail("supported modes needs to be supported attribute") - + if current_mode_attr_id not in attribute_list: asserts.fail("Current mode needs to be supported attribute") diff --git a/src/python_testing/TC_RVCRUNM_2_2.py b/src/python_testing/TC_RVCRUNM_2_2.py index 7a35373d57d9ed..710360d68dbbba 100644 --- a/src/python_testing/TC_RVCRUNM_2_2.py +++ b/src/python_testing/TC_RVCRUNM_2_2.py @@ -120,17 +120,16 @@ async def test_TC_RVCRUNM_2_2(self): self.endpoint = self.matter_test_config.endpoint 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'] - app_pid = self.matter_test_config.app_pid + app_pid = self.matter_test_config.app_pid if app_pid != 0: - self.is_ci = True + self.is_ci = True self.app_pipe = self.app_pipe + str(app_pid) - app_pid = self.matter_test_config.app_pid if app_pid != 0: - self.is_ci = True + self.is_ci = True self.app_pipe = self.app_pipe + str(app_pid) - + RVCRun_cluster = Clusters.RvcRunMode # Gathering Available Attributes and associated ids @@ -150,7 +149,7 @@ async def test_TC_RVCRUNM_2_2(self): if supported_modes_attr_id not in attribute_list: asserts.fail("Supported modes needs to be supported attribute") - + if current_mode_attr_id not in attribute_list: asserts.fail("Current mode needs to be supported attribute") @@ -158,7 +157,7 @@ async def test_TC_RVCRUNM_2_2(self): asserts.fail("Change To Mode receiving commands needs to be supported") asserts.assert_true(self.check_pics("RVCRUNM.S.M.CAN_MANUALLY_CONTROLLED"), - "RVCRUNM.S.M.CAN_MANUALLY_CONTROLLED must be supported") + "RVCRUNM.S.M.CAN_MANUALLY_CONTROLLED must be supported") # Starting the test steps self.print_step(1, "Commissioning, already done") From 3881efe70c5ac848e11f807e701c23a6e7cc427d Mon Sep 17 00:00:00 2001 From: Jake Ororke Date: Wed, 3 Jul 2024 12:42:06 -0700 Subject: [PATCH 03/16] Removed unused variable as no longer needed: - Removed "generated_command_list" variable as not needed in TC_RVCRUNM_2_2 test module --- src/python_testing/TC_RVCRUNM_2_2.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/python_testing/TC_RVCRUNM_2_2.py b/src/python_testing/TC_RVCRUNM_2_2.py index 710360d68dbbba..c8d94465596dd8 100644 --- a/src/python_testing/TC_RVCRUNM_2_2.py +++ b/src/python_testing/TC_RVCRUNM_2_2.py @@ -144,7 +144,6 @@ async def test_TC_RVCRUNM_2_2(self): RVCRun_accptcmd_list = attributes.AcceptedCommandList RVCRun_gencmd_list = attributes.GeneratedCommandList accepted_cmd_list = await self.read_single_attribute_check_success(endpoint=self.endpoint, cluster=RVCRun_cluster, attribute=RVCRun_accptcmd_list) - generated_cmd_list = await self.read_single_attribute_check_success(endpoint=self.endpoint, cluster=RVCRun_cluster, attribute=RVCRun_gencmd_list) chg_mode_cmd_id = commands.ChangeToMode.command_id if supported_modes_attr_id not in attribute_list: From f871894c2723fc7fe986ca211d25e6bb269756d6 Mon Sep 17 00:00:00 2001 From: Jake Ororke Date: Wed, 3 Jul 2024 13:53:21 -0700 Subject: [PATCH 04/16] Removed unused variable: - Removed unused variable "RVCRun_gencmd_list" --- src/python_testing/TC_RVCRUNM_2_2.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/python_testing/TC_RVCRUNM_2_2.py b/src/python_testing/TC_RVCRUNM_2_2.py index c8d94465596dd8..7c00c9b63290f7 100644 --- a/src/python_testing/TC_RVCRUNM_2_2.py +++ b/src/python_testing/TC_RVCRUNM_2_2.py @@ -142,7 +142,6 @@ async def test_TC_RVCRUNM_2_2(self): # Gathering Accepted and Generated Commands and associated ids commands = RVCRun_cluster.Commands RVCRun_accptcmd_list = attributes.AcceptedCommandList - RVCRun_gencmd_list = attributes.GeneratedCommandList accepted_cmd_list = await self.read_single_attribute_check_success(endpoint=self.endpoint, cluster=RVCRun_cluster, attribute=RVCRun_accptcmd_list) chg_mode_cmd_id = commands.ChangeToMode.command_id From a9b96f77d3c62db9b114704e5468e94b6f750f0b Mon Sep 17 00:00:00 2001 From: Jake Ororke Date: Thu, 4 Jul 2024 10:20:54 -0700 Subject: [PATCH 05/16] Reverted changes to self.is_ci check: - Reverted the changes done to the self.is_ci if check block that was made as it was not passing through CI/CD tests. --- src/python_testing/TC_RVCCLEANM_2_1.py | 10 ++++++---- src/python_testing/TC_RVCCLEANM_2_2.py | 10 ++++++---- src/python_testing/TC_RVCRUNM_2_1.py | 6 ++++++ src/python_testing/TC_RVCRUNM_2_2.py | 15 ++++++--------- 4 files changed, 24 insertions(+), 17 deletions(-) diff --git a/src/python_testing/TC_RVCCLEANM_2_1.py b/src/python_testing/TC_RVCCLEANM_2_1.py index 688847cc5b3f08..7ec8fd9b9812ec 100644 --- a/src/python_testing/TC_RVCCLEANM_2_1.py +++ b/src/python_testing/TC_RVCCLEANM_2_1.py @@ -84,10 +84,12 @@ async def test_TC_RVCCLEANM_2_1(self): self.endpoint = self.matter_test_config.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'] - app_pid = self.matter_test_config.app_pid - if app_pid != 0: - self.is_ci = True - self.app_pipe = self.app_pipe + str(app_pid) + 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: + self.is_ci = True + self.app_pipe = self.app_pipe + str(app_pid) RVCClean_cluster = Clusters.RvcCleanMode diff --git a/src/python_testing/TC_RVCCLEANM_2_2.py b/src/python_testing/TC_RVCCLEANM_2_2.py index 1ff909133e3635..02d193978d05e7 100644 --- a/src/python_testing/TC_RVCCLEANM_2_2.py +++ b/src/python_testing/TC_RVCCLEANM_2_2.py @@ -86,10 +86,12 @@ def write_to_app_pipe(self, command): @async_test_body async def test_TC_RVCCLEANM_2_2(self): self.endpoint = self.matter_test_config.endpoint - app_pid = self.matter_test_config.app_pid - if app_pid != 0: - self.is_ci = True - self.app_pipe = self.app_pipe + str(app_pid) + 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: + self.is_ci = True + self.app_pipe = self.app_pipe + str(app_pid) # replaces the RVCRUNM attributes from PICS file RVCRun_cluster = Clusters.RvcRunMode diff --git a/src/python_testing/TC_RVCRUNM_2_1.py b/src/python_testing/TC_RVCRUNM_2_1.py index a9561647ea1ac2..e02639f8530e27 100644 --- a/src/python_testing/TC_RVCRUNM_2_1.py +++ b/src/python_testing/TC_RVCRUNM_2_1.py @@ -79,6 +79,12 @@ async def test_TC_RVCRUNM_2_1(self): self.endpoint = self.matter_test_config.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") + if self.is_ci: + app_pid = self.matter_test_config.app_pid + if app_pid != 0: + self.is_ci = True + self.app_pipe = self.app_pipe + str(app_pid) RVCRun_cluster = Clusters.RvcRunMode diff --git a/src/python_testing/TC_RVCRUNM_2_2.py b/src/python_testing/TC_RVCRUNM_2_2.py index 7c00c9b63290f7..12f9887e20e33f 100644 --- a/src/python_testing/TC_RVCRUNM_2_2.py +++ b/src/python_testing/TC_RVCRUNM_2_2.py @@ -120,15 +120,12 @@ async def test_TC_RVCRUNM_2_2(self): self.endpoint = self.matter_test_config.endpoint 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'] - app_pid = self.matter_test_config.app_pid - if app_pid != 0: - self.is_ci = True - self.app_pipe = self.app_pipe + str(app_pid) - - app_pid = self.matter_test_config.app_pid - if app_pid != 0: - self.is_ci = True - self.app_pipe = self.app_pipe + str(app_pid) + 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: + self.is_ci = True + self.app_pipe = self.app_pipe + str(app_pid) RVCRun_cluster = Clusters.RvcRunMode From 242a56476794b86e825dad9ffb1bb3963627164c Mon Sep 17 00:00:00 2001 From: Jake Ororke Date: Wed, 28 Aug 2024 14:50:00 -0700 Subject: [PATCH 06/16] Updated RVC Clean and Run test modules: - Removed initial step for if self.is_ci check as does not appear to be needed - Removed attribute checks as supported and current mode attributes are mandatory --- src/python_testing/TC_RVCCLEANM_1_2.py | 114 ++++++++-------- src/python_testing/TC_RVCCLEANM_2_1.py | 20 +-- src/python_testing/TC_RVCCLEANM_2_2.py | 19 +-- src/python_testing/TC_RVCRUNM_1_2.py | 178 ++++++++++++------------- src/python_testing/TC_RVCRUNM_2_1.py | 20 +-- src/python_testing/TC_RVCRUNM_2_2.py | 20 +-- 6 files changed, 152 insertions(+), 219 deletions(-) diff --git a/src/python_testing/TC_RVCCLEANM_1_2.py b/src/python_testing/TC_RVCCLEANM_1_2.py index c78906157a9a29..3013e4e0dac31e 100644 --- a/src/python_testing/TC_RVCCLEANM_1_2.py +++ b/src/python_testing/TC_RVCCLEANM_1_2.py @@ -64,63 +64,58 @@ async def test_TC_RVCCLEANM_1_2(self): RVCClean_cluster = Clusters.RvcCleanMode attributes = RVCClean_cluster.Attributes - RVCClean_attr_list = attributes.AttributeList - attribute_list = await self.read_single_attribute_check_success(endpoint=self.endpoint, cluster=RVCClean_cluster, attribute=RVCClean_attr_list) - supported_modes_attr_id = attributes.SupportedModes.attribute_id - current_mode_attr_id = attributes.CurrentMode.attribute_id - + self.print_step(1, "Commissioning, already done") - if supported_modes_attr_id in attribute_list: - self.print_step(2, "Read SupportedModes attribute") - supported_modes = await self.read_mod_attribute_expect_success(endpoint=self.endpoint, attribute=attributes.SupportedModes) - - logging.info("SupportedModes: %s" % (supported_modes)) - - # Verify that the list has at least 2 and at most 255 entries - asserts.assert_greater_equal(len(supported_modes), 2, "SupportedModes must have at least 2 entries!") - asserts.assert_less_equal(len(supported_modes), 255, "SupportedModes must have at most 255 entries!") - - # Verify that each ModeOptionsStruct entry has a unique Mode field value - for m in supported_modes: - if m.mode in self.supported_modes_dut: - asserts.fail("SupportedModes must have unique mode values!") - else: - self.supported_modes_dut.append(m.mode) - - # Verify that each ModeOptionsStruct entry has a unique Label field value - labels = [] - for m in supported_modes: - if m.label in labels: - asserts.fail("SupportedModes must have unique mode label values!") - else: - labels.append(m.label) - - # Verify that each ModeOptionsStruct entry's ModeTags field has: - for m in supported_modes: - # * at least one entry - if len(m.modeTags) == 0: - asserts.fail("SupportedModes must have at least one mode tag!") - - at_least_one_common_or_clean_tag = False - for t in m.modeTags: - # * the values of the Value fields that are not larger than 16 bits - if t.value > 0xFFFF or t.value < 0: - asserts.fail("Mode tag values must not be larger than 16 bits!") - - # * for each Value field: {isCommonOrDerivedOrMfgTagsVal} - is_mfg = (0x8000 <= t.value <= 0xBFFF) - if (t.value not in self.commonTags and - t.value not in self.cleanTags and - not is_mfg): - asserts.fail("Mode tag value is not a common tag, clean tag or vendor tag!") - - # * for at least one Value field: {isCommonOrDerivedTagsVal} - if not is_mfg: - at_least_one_common_or_clean_tag = True - - if not at_least_one_common_or_clean_tag: - asserts.fail("At least one mode tag must be a common tag or clean tag!") + self.print_step(2, "Read SupportedModes attribute") + supported_modes = await self.read_mod_attribute_expect_success(endpoint=self.endpoint, attribute=attributes.SupportedModes) + + logging.info("SupportedModes: %s" % (supported_modes)) + + # Verify that the list has at least 2 and at most 255 entries + asserts.assert_greater_equal(len(supported_modes), 2, "SupportedModes must have at least 2 entries!") + asserts.assert_less_equal(len(supported_modes), 255, "SupportedModes must have at most 255 entries!") + + # Verify that each ModeOptionsStruct entry has a unique Mode field value + for m in supported_modes: + if m.mode in self.supported_modes_dut: + asserts.fail("SupportedModes must have unique mode values!") + else: + self.supported_modes_dut.append(m.mode) + + # Verify that each ModeOptionsStruct entry has a unique Label field value + labels = [] + for m in supported_modes: + if m.label in labels: + asserts.fail("SupportedModes must have unique mode label values!") + else: + labels.append(m.label) + + # Verify that each ModeOptionsStruct entry's ModeTags field has: + for m in supported_modes: + # * at least one entry + if len(m.modeTags) == 0: + asserts.fail("SupportedModes must have at least one mode tag!") + + at_least_one_common_or_clean_tag = False + for t in m.modeTags: + # * the values of the Value fields that are not larger than 16 bits + if t.value > 0xFFFF or t.value < 0: + asserts.fail("Mode tag values must not be larger than 16 bits!") + + # * for each Value field: {isCommonOrDerivedOrMfgTagsVal} + is_mfg = (0x8000 <= t.value <= 0xBFFF) + if (t.value not in self.commonTags and + t.value not in self.cleanTags and + not is_mfg): + asserts.fail("Mode tag value is not a common tag, clean tag or vendor tag!") + + # * for at least one Value field: {isCommonOrDerivedTagsVal} + if not is_mfg: + at_least_one_common_or_clean_tag = True + + if not at_least_one_common_or_clean_tag: + asserts.fail("At least one mode tag must be a common tag or clean tag!") # Verify that at least one ModeOptionsStruct entry includes either the # Vacuum(0x4001) mode tag or the Mop(0x4002)mode tag in the ModeTags field @@ -134,12 +129,11 @@ async def test_TC_RVCCLEANM_1_2(self): asserts.assert_true(has_vacuum_or_mop_mode_tag, "At least one ModeOptionsStruct entry must include either the Vacuum or Mop mode tag") - if current_mode_attr_id in attribute_list: - self.print_step(3, "Read CurrentMode attribute") - current_mode = await self.read_mod_attribute_expect_success(endpoint=self.endpoint, attribute=attributes.CurrentMode) + self.print_step(3, "Read CurrentMode attribute") + current_mode = await self.read_mod_attribute_expect_success(endpoint=self.endpoint, attribute=attributes.CurrentMode) - logging.info("CurrentMode: %s" % (current_mode)) - asserts.assert_true(current_mode in self.supported_modes_dut, "CurrentMode is not a supported mode!") + logging.info("CurrentMode: %s" % (current_mode)) + asserts.assert_true(current_mode in self.supported_modes_dut, "CurrentMode is not a supported mode!") if __name__ == "__main__": diff --git a/src/python_testing/TC_RVCCLEANM_2_1.py b/src/python_testing/TC_RVCCLEANM_2_1.py index 046dfe9fc93018..9b534bbc887453 100644 --- a/src/python_testing/TC_RVCCLEANM_2_1.py +++ b/src/python_testing/TC_RVCCLEANM_2_1.py @@ -90,20 +90,12 @@ 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: - self.is_ci = True - self.app_pipe = self.app_pipe + str(app_pid) + app_pid = self.matter_test_config.app_pid + if app_pid != 0: + self.app_pipe = self.app_pipe + str(app_pid) RVCClean_cluster = Clusters.RvcCleanMode - - # Gathering Available Attributes and associated ids attributes = RVCClean_cluster.Attributes - RVCClean_attr_list = attributes.AttributeList - attribute_list = await self.read_single_attribute_check_success(endpoint=self.endpoint, cluster=RVCClean_cluster, attribute=RVCClean_attr_list) - supported_modes_attr_id = attributes.SupportedModes.attribute_id - current_mode_attr_id = attributes.CurrentMode.attribute_id # Gathering Accepted and Generated Commands and associated ids commands = RVCClean_cluster.Commands @@ -114,12 +106,6 @@ async def test_TC_RVCCLEANM_2_1(self): chg_mode_cmd_id = commands.ChangeToMode.command_id chg_rsp_cmd_id = commands.ChangeToModeResponse.command_id - if supported_modes_attr_id not in attribute_list: - asserts.fail("supported modes needs to be supported attribute") - - if current_mode_attr_id not in attribute_list: - asserts.fail("Current mode needs to be supported attribute") - if chg_mode_cmd_id not in accepted_cmd_list: asserts.fail("Change To Mode receiving commands needs to be supported") diff --git a/src/python_testing/TC_RVCCLEANM_2_2.py b/src/python_testing/TC_RVCCLEANM_2_2.py index 147cead22f658a..6a17db73b397f7 100644 --- a/src/python_testing/TC_RVCCLEANM_2_2.py +++ b/src/python_testing/TC_RVCCLEANM_2_2.py @@ -92,25 +92,12 @@ def write_to_app_pipe(self, command): async def test_TC_RVCCLEANM_2_2(self): self.endpoint = self.matter_test_config.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: - self.is_ci = True - self.app_pipe = self.app_pipe + str(app_pid) + app_pid = self.matter_test_config.app_pid + if app_pid != 0: + self.app_pipe = self.app_pipe + str(app_pid) - # replaces the RVCRUNM attributes from PICS file RVCRun_cluster = Clusters.RvcRunMode attributes = Clusters.RvcRunMode.Attributes - RVCRun_attr_list = attributes.AttributeList - attribute_list = await self.read_single_attribute_check_success(endpoint=self.endpoint, cluster=RVCRun_cluster, attribute=RVCRun_attr_list) - supported_modes_attr_id = attributes.SupportedModes.attribute_id - current_mode_attr_id = attributes.CurrentMode.attribute_id - - if supported_modes_attr_id not in attribute_list: - asserts.fail("Supported modes needs to be supported attribute") - - if current_mode_attr_id not in attribute_list: - asserts.fail("Current mode needs to be supported attribute") self.print_step(1, "Commissioning, already done") diff --git a/src/python_testing/TC_RVCRUNM_1_2.py b/src/python_testing/TC_RVCRUNM_1_2.py index b731875214e36f..953b4744e16c7c 100644 --- a/src/python_testing/TC_RVCRUNM_1_2.py +++ b/src/python_testing/TC_RVCRUNM_1_2.py @@ -64,101 +64,95 @@ async def test_TC_RVCRUNM_1_2(self): RVCRun_cluster = Clusters.RvcRunMode attributes = Clusters.RvcRunMode.Attributes - RVCRun_attr_list = attributes.AttributeList - attribute_list = await self.read_single_attribute_check_success(endpoint=self.endpoint, cluster=RVCRun_cluster, attribute=RVCRun_attr_list) - supported_modes_attr_id = attributes.SupportedModes.attribute_id - current_mode_attr_id = attributes.CurrentMode.attribute_id self.print_step(1, "Commissioning, already done") - if supported_modes_attr_id in attribute_list: - self.print_step(2, "Read SupportedModes attribute") - supported_modes = await self.read_mod_attribute_expect_success(endpoint=self.endpoint, attribute=attributes.SupportedModes) - - logging.info("SupportedModes: %s" % (supported_modes)) - - # Verify that the list has at least 2 and at most 255 entries - asserts.assert_greater_equal(len(supported_modes), 2, "SupportedModes must have at least 2 entries!") - asserts.assert_less_equal(len(supported_modes), 255, "SupportedModes must have at most 255 entries!") - - # Verify that each ModeOptionsStruct entry has a unique Mode field value - for m in supported_modes: - if m.mode in self.supported_modes_dut: - asserts.fail("SupportedModes must have unique mode values!") - else: - self.supported_modes_dut.append(m.mode) - - # Verify that each ModeOptionsStruct entry has a unique Label field value - labels = [] - for m in supported_modes: - if m.label in labels: - asserts.fail("SupportedModes must have unique mode label values!") - else: - labels.append(m.label) - - # Verify that each ModeOptionsStruct entry's ModeTags field has: - for m in supported_modes: - # * at least one entry - if len(m.modeTags) == 0: - asserts.fail("SupportedModes must have at least one mode tag!") - - at_least_one_common_or_run_tag = False - for t in m.modeTags: - # * the values of the Value fields that are not larger than 16 bits - if t.value > 0xFFFF or t.value < 0: - asserts.fail("Mode tag values must not be larger than 16 bits!") - - # * for each Value field: {isCommonOrDerivedOrMfgTagsVal} - is_mfg = (0x8000 <= t.value <= 0xBFFF) - if (t.value not in self.commonTags and - t.value not in self.runTags and - not is_mfg): - asserts.fail("Mode tag value is not a common tag, run tag or vendor tag!") - - # * for at least one Value field: {isCommonOrDerivedTagsVal} - if not is_mfg: - at_least_one_common_or_run_tag = True - - if not at_least_one_common_or_run_tag: - asserts.fail("At least one mode tag must be a common tag or run tag!") - - # Verify that at least one ModeOptionsStruct entry includes the Idle(0x4000) - # mode tag in the ModeTags field - at_least_one_idle_mode_tag = False - # Verify that at least one ModeOptionsStruct entry includes the Cleaning(0x4001) - # mode tag in the ModeTags field - at_least_one_cleaning_mode_tag = False - for m in supported_modes: - # Verify that each ModeOptionsStruct entry includes at most one of the following - # mode tags: Idle(0x4000), Cleaning(0x4001), _Mapping(0x4002) - count_of_idle_cleaning_or_mapping_mode_tags = 0 - for t in m.modeTags: - if t.value == Clusters.RvcRunMode.Enums.ModeTag.kIdle: - at_least_one_idle_mode_tag = True - count_of_idle_cleaning_or_mapping_mode_tags += 1 - - if t.value == Clusters.RvcRunMode.Enums.ModeTag.kCleaning: - at_least_one_cleaning_mode_tag = True - count_of_idle_cleaning_or_mapping_mode_tags += 1 - - if t.value == Clusters.RvcRunMode.Enums.ModeTag.kMapping: - count_of_idle_cleaning_or_mapping_mode_tags += 1 - - if count_of_idle_cleaning_or_mapping_mode_tags > 1: - asserts.fail("A ModeOptionsStruct entry includes more than one of the following " - "mode tags: Idle(0x4000), Cleaning(0x4001), Mapping(0x4002)!") - - asserts.assert_true(at_least_one_idle_mode_tag, - "The Supported Modes does not have an entry of Idle(0x4000)") - asserts.assert_true(at_least_one_cleaning_mode_tag, - "The Supported Modes does not have an entry of Cleaning(0x4001)") - - if current_mode_attr_id in attribute_list: - self.print_step(3, "Read CurrentMode attribute") - current_mode = await self.read_mod_attribute_expect_success(endpoint=self.endpoint, attribute=attributes.CurrentMode) - - logging.info("CurrentMode: %s" % (current_mode)) - asserts.assert_true(current_mode in self.supported_modes_dut, "CurrentMode is not a supported mode!") + self.print_step(2, "Read SupportedModes attribute") + supported_modes = await self.read_mod_attribute_expect_success(endpoint=self.endpoint, attribute=attributes.SupportedModes) + + logging.info("SupportedModes: %s" % (supported_modes)) + + # Verify that the list has at least 2 and at most 255 entries + asserts.assert_greater_equal(len(supported_modes), 2, "SupportedModes must have at least 2 entries!") + asserts.assert_less_equal(len(supported_modes), 255, "SupportedModes must have at most 255 entries!") + + # Verify that each ModeOptionsStruct entry has a unique Mode field value + for m in supported_modes: + if m.mode in self.supported_modes_dut: + asserts.fail("SupportedModes must have unique mode values!") + else: + self.supported_modes_dut.append(m.mode) + + # Verify that each ModeOptionsStruct entry has a unique Label field value + labels = [] + for m in supported_modes: + if m.label in labels: + asserts.fail("SupportedModes must have unique mode label values!") + else: + labels.append(m.label) + + # Verify that each ModeOptionsStruct entry's ModeTags field has: + for m in supported_modes: + # * at least one entry + if len(m.modeTags) == 0: + asserts.fail("SupportedModes must have at least one mode tag!") + + at_least_one_common_or_run_tag = False + for t in m.modeTags: + # * the values of the Value fields that are not larger than 16 bits + if t.value > 0xFFFF or t.value < 0: + asserts.fail("Mode tag values must not be larger than 16 bits!") + + # * for each Value field: {isCommonOrDerivedOrMfgTagsVal} + is_mfg = (0x8000 <= t.value <= 0xBFFF) + if (t.value not in self.commonTags and + t.value not in self.runTags and + not is_mfg): + asserts.fail("Mode tag value is not a common tag, run tag or vendor tag!") + + # * for at least one Value field: {isCommonOrDerivedTagsVal} + if not is_mfg: + at_least_one_common_or_run_tag = True + + if not at_least_one_common_or_run_tag: + asserts.fail("At least one mode tag must be a common tag or run tag!") + + # Verify that at least one ModeOptionsStruct entry includes the Idle(0x4000) + # mode tag in the ModeTags field + at_least_one_idle_mode_tag = False + # Verify that at least one ModeOptionsStruct entry includes the Cleaning(0x4001) + # mode tag in the ModeTags field + at_least_one_cleaning_mode_tag = False + for m in supported_modes: + # Verify that each ModeOptionsStruct entry includes at most one of the following + # mode tags: Idle(0x4000), Cleaning(0x4001), _Mapping(0x4002) + count_of_idle_cleaning_or_mapping_mode_tags = 0 + for t in m.modeTags: + if t.value == Clusters.RvcRunMode.Enums.ModeTag.kIdle: + at_least_one_idle_mode_tag = True + count_of_idle_cleaning_or_mapping_mode_tags += 1 + + if t.value == Clusters.RvcRunMode.Enums.ModeTag.kCleaning: + at_least_one_cleaning_mode_tag = True + count_of_idle_cleaning_or_mapping_mode_tags += 1 + + if t.value == Clusters.RvcRunMode.Enums.ModeTag.kMapping: + count_of_idle_cleaning_or_mapping_mode_tags += 1 + + if count_of_idle_cleaning_or_mapping_mode_tags > 1: + asserts.fail("A ModeOptionsStruct entry includes more than one of the following " + "mode tags: Idle(0x4000), Cleaning(0x4001), Mapping(0x4002)!") + + asserts.assert_true(at_least_one_idle_mode_tag, + "The Supported Modes does not have an entry of Idle(0x4000)") + asserts.assert_true(at_least_one_cleaning_mode_tag, + "The Supported Modes does not have an entry of Cleaning(0x4001)") + + self.print_step(3, "Read CurrentMode attribute") + current_mode = await self.read_mod_attribute_expect_success(endpoint=self.endpoint, attribute=attributes.CurrentMode) + + logging.info("CurrentMode: %s" % (current_mode)) + asserts.assert_true(current_mode in self.supported_modes_dut, "CurrentMode is not a supported mode!") if __name__ == "__main__": diff --git a/src/python_testing/TC_RVCRUNM_2_1.py b/src/python_testing/TC_RVCRUNM_2_1.py index a0860d6e438c6b..02c621de91c018 100644 --- a/src/python_testing/TC_RVCRUNM_2_1.py +++ b/src/python_testing/TC_RVCRUNM_2_1.py @@ -85,20 +85,12 @@ 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: - self.is_ci = True - self.app_pipe = self.app_pipe + str(app_pid) + app_pid = self.matter_test_config.app_pid + if app_pid != 0: + self.app_pipe = self.app_pipe + str(app_pid) RVCRun_cluster = Clusters.RvcRunMode - - # Gathering Available Attributes and associated ids attributes = RVCRun_cluster.Attributes - RVCRun_attr_list = attributes.AttributeList - attribute_list = await self.read_single_attribute_check_success(endpoint=self.endpoint, cluster=RVCRun_cluster, attribute=RVCRun_attr_list) - supported_modes_attr_id = attributes.SupportedModes.attribute_id - current_mode_attr_id = attributes.CurrentMode.attribute_id # Gathering Accepted and Generated Commands and associated ids commands = RVCRun_cluster.Commands @@ -109,12 +101,6 @@ async def test_TC_RVCRUNM_2_1(self): chg_mode_cmd_id = commands.ChangeToMode.command_id chg_rsp_cmd_id = commands.ChangeToModeResponse.command_id - if supported_modes_attr_id not in attribute_list: - asserts.fail("supported modes needs to be supported attribute") - - if current_mode_attr_id not in attribute_list: - asserts.fail("Current mode needs to be supported attribute") - if chg_mode_cmd_id not in accepted_cmd_list: asserts.fail("Change To Mode receiving commands needs to be supported") diff --git a/src/python_testing/TC_RVCRUNM_2_2.py b/src/python_testing/TC_RVCRUNM_2_2.py index ec62e9899a8ebd..26b0763649c4e7 100644 --- a/src/python_testing/TC_RVCRUNM_2_2.py +++ b/src/python_testing/TC_RVCRUNM_2_2.py @@ -126,20 +126,12 @@ async def test_TC_RVCRUNM_2_2(self): 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.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: - self.is_ci = True - self.app_pipe = self.app_pipe + str(app_pid) + app_pid = self.matter_test_config.app_pid + if app_pid != 0: + self.app_pipe = self.app_pipe + str(app_pid) RVCRun_cluster = Clusters.RvcRunMode - - # Gathering Available Attributes and associated ids attributes = RVCRun_cluster.Attributes - RVCRun_attr_list = attributes.AttributeList - attribute_list = await self.read_single_attribute_check_success(endpoint=self.endpoint, cluster=RVCRun_cluster, attribute=RVCRun_attr_list) - supported_modes_attr_id = attributes.SupportedModes.attribute_id - current_mode_attr_id = attributes.CurrentMode.attribute_id # Gathering Accepted and Generated Commands and associated ids commands = RVCRun_cluster.Commands @@ -147,12 +139,6 @@ async def test_TC_RVCRUNM_2_2(self): accepted_cmd_list = await self.read_single_attribute_check_success(endpoint=self.endpoint, cluster=RVCRun_cluster, attribute=RVCRun_accptcmd_list) chg_mode_cmd_id = commands.ChangeToMode.command_id - if supported_modes_attr_id not in attribute_list: - asserts.fail("Supported modes needs to be supported attribute") - - if current_mode_attr_id not in attribute_list: - asserts.fail("Current mode needs to be supported attribute") - if chg_mode_cmd_id not in accepted_cmd_list: asserts.fail("Change To Mode receiving commands needs to be supported") From 66f8e00d33ca8a12b0f7893b75df648b476129be Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Wed, 28 Aug 2024 21:57:14 +0000 Subject: [PATCH 07/16] Restyled by autopep8 --- src/python_testing/TC_RVCCLEANM_1_2.py | 2 +- src/python_testing/TC_RVCRUNM_1_2.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/python_testing/TC_RVCCLEANM_1_2.py b/src/python_testing/TC_RVCCLEANM_1_2.py index 3013e4e0dac31e..0953b2ce430938 100644 --- a/src/python_testing/TC_RVCCLEANM_1_2.py +++ b/src/python_testing/TC_RVCCLEANM_1_2.py @@ -64,7 +64,7 @@ async def test_TC_RVCCLEANM_1_2(self): RVCClean_cluster = Clusters.RvcCleanMode attributes = RVCClean_cluster.Attributes - + self.print_step(1, "Commissioning, already done") self.print_step(2, "Read SupportedModes attribute") diff --git a/src/python_testing/TC_RVCRUNM_1_2.py b/src/python_testing/TC_RVCRUNM_1_2.py index 953b4744e16c7c..486c05a9f8b10a 100644 --- a/src/python_testing/TC_RVCRUNM_1_2.py +++ b/src/python_testing/TC_RVCRUNM_1_2.py @@ -141,7 +141,7 @@ async def test_TC_RVCRUNM_1_2(self): if count_of_idle_cleaning_or_mapping_mode_tags > 1: asserts.fail("A ModeOptionsStruct entry includes more than one of the following " - "mode tags: Idle(0x4000), Cleaning(0x4001), Mapping(0x4002)!") + "mode tags: Idle(0x4000), Cleaning(0x4001), Mapping(0x4002)!") asserts.assert_true(at_least_one_idle_mode_tag, "The Supported Modes does not have an entry of Idle(0x4000)") From f55030cf751d3334071cf3c11906330a22ba9c2a Mon Sep 17 00:00:00 2001 From: Jake Ororke Date: Wed, 28 Aug 2024 15:13:41 -0700 Subject: [PATCH 08/16] Linting fixes in RVCCLEAN 2_2 and RVCRUN 1_2 modules --- src/python_testing/TC_RVCCLEANM_2_2.py | 3 --- src/python_testing/TC_RVCRUNM_1_2.py | 1 - 2 files changed, 4 deletions(-) diff --git a/src/python_testing/TC_RVCCLEANM_2_2.py b/src/python_testing/TC_RVCCLEANM_2_2.py index 6a17db73b397f7..4c5a9dc43343e0 100644 --- a/src/python_testing/TC_RVCCLEANM_2_2.py +++ b/src/python_testing/TC_RVCCLEANM_2_2.py @@ -96,9 +96,6 @@ async def test_TC_RVCCLEANM_2_2(self): if app_pid != 0: self.app_pipe = self.app_pipe + str(app_pid) - RVCRun_cluster = Clusters.RvcRunMode - attributes = Clusters.RvcRunMode.Attributes - self.print_step(1, "Commissioning, already done") # Ensure that the device is in the correct state diff --git a/src/python_testing/TC_RVCRUNM_1_2.py b/src/python_testing/TC_RVCRUNM_1_2.py index 486c05a9f8b10a..195609a50bf7b9 100644 --- a/src/python_testing/TC_RVCRUNM_1_2.py +++ b/src/python_testing/TC_RVCRUNM_1_2.py @@ -62,7 +62,6 @@ def pics_TC_RVCRUNM_1_2(self) -> list[str]: async def test_TC_RVCRUNM_1_2(self): self.endpoint = self.matter_test_config.endpoint - RVCRun_cluster = Clusters.RvcRunMode attributes = Clusters.RvcRunMode.Attributes self.print_step(1, "Commissioning, already done") From d43154a141055d60229b5107b140d26768236af4 Mon Sep 17 00:00:00 2001 From: Jake Ororke Date: Thu, 24 Oct 2024 13:55:08 -0700 Subject: [PATCH 09/16] Updated RVC Clean and RVC Run test modules: - Updated to restore using if self.is_cli checks --- src/python_testing/TC_RVCCLEANM_2_1.py | 9 +++++---- src/python_testing/TC_RVCCLEANM_2_2.py | 8 +++++--- src/python_testing/TC_RVCRUNM_2_1.py | 7 ++++--- src/python_testing/TC_RVCRUNM_2_2.py | 9 +++++---- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/python_testing/TC_RVCCLEANM_2_1.py b/src/python_testing/TC_RVCCLEANM_2_1.py index d59719b3ea8ffb..c37f2ac39a816e 100644 --- a/src/python_testing/TC_RVCCLEANM_2_1.py +++ b/src/python_testing/TC_RVCCLEANM_2_1.py @@ -92,10 +92,11 @@ 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") - app_pid = self.matter_test_config.app_pid - if app_pid != 0: - self.app_pipe = self.app_pipe + str(app_pid) - + 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") + RVCClean_cluster = Clusters.RvcCleanMode attributes = RVCClean_cluster.Attributes diff --git a/src/python_testing/TC_RVCCLEANM_2_2.py b/src/python_testing/TC_RVCCLEANM_2_2.py index 0699052cea9f29..26f07eb227cf9a 100644 --- a/src/python_testing/TC_RVCCLEANM_2_2.py +++ b/src/python_testing/TC_RVCCLEANM_2_2.py @@ -108,9 +108,11 @@ async def test_TC_RVCCLEANM_2_2(self): self.endpoint = self.matter_test_config.endpoint self.is_ci = self.check_pics("PICS_SDK_CI_ONLY") app_pid = self.matter_test_config.app_pid - if app_pid != 0: - self.app_pipe = self.app_pipe + str(app_pid) - + 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.print_step(1, "Commissioning, already done") # Ensure that the device is in the correct state diff --git a/src/python_testing/TC_RVCRUNM_2_1.py b/src/python_testing/TC_RVCRUNM_2_1.py index 6aca5c2e70b00f..9799a09fc52b59 100644 --- a/src/python_testing/TC_RVCRUNM_2_1.py +++ b/src/python_testing/TC_RVCRUNM_2_1.py @@ -87,9 +87,10 @@ 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") - app_pid = self.matter_test_config.app_pid - if app_pid != 0: - self.app_pipe = self.app_pipe + str(app_pid) + 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") RVCRun_cluster = Clusters.RvcRunMode attributes = RVCRun_cluster.Attributes diff --git a/src/python_testing/TC_RVCRUNM_2_2.py b/src/python_testing/TC_RVCRUNM_2_2.py index e4d68fb574ca98..f2624136740a48 100644 --- a/src/python_testing/TC_RVCRUNM_2_2.py +++ b/src/python_testing/TC_RVCRUNM_2_2.py @@ -138,10 +138,11 @@ async def test_TC_RVCRUNM_2_2(self): 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.is_ci = self.check_pics("PICS_SDK_CI_ONLY") - app_pid = self.matter_test_config.app_pid - if app_pid != 0: - self.app_pipe = self.app_pipe + str(app_pid) - + 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") + RVCRun_cluster = Clusters.RvcRunMode attributes = RVCRun_cluster.Attributes From 8ef71763462b52ca40010b9dc3e601185189f266 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Thu, 24 Oct 2024 20:57:27 +0000 Subject: [PATCH 10/16] Restyled by autopep8 --- src/python_testing/TC_RVCCLEANM_2_1.py | 2 +- src/python_testing/TC_RVCCLEANM_2_2.py | 2 +- src/python_testing/TC_RVCRUNM_2_2.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/python_testing/TC_RVCCLEANM_2_1.py b/src/python_testing/TC_RVCCLEANM_2_1.py index c37f2ac39a816e..33a6aa959ed39f 100644 --- a/src/python_testing/TC_RVCCLEANM_2_1.py +++ b/src/python_testing/TC_RVCCLEANM_2_1.py @@ -96,7 +96,7 @@ async def test_TC_RVCCLEANM_2_1(self): 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") - + RVCClean_cluster = Clusters.RvcCleanMode attributes = RVCClean_cluster.Attributes diff --git a/src/python_testing/TC_RVCCLEANM_2_2.py b/src/python_testing/TC_RVCCLEANM_2_2.py index 26f07eb227cf9a..6a63ad6f5b03ac 100644 --- a/src/python_testing/TC_RVCCLEANM_2_2.py +++ b/src/python_testing/TC_RVCCLEANM_2_2.py @@ -112,7 +112,7 @@ async def test_TC_RVCCLEANM_2_2(self): 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.print_step(1, "Commissioning, already done") # Ensure that the device is in the correct state diff --git a/src/python_testing/TC_RVCRUNM_2_2.py b/src/python_testing/TC_RVCRUNM_2_2.py index f2624136740a48..bbda35eba65489 100644 --- a/src/python_testing/TC_RVCRUNM_2_2.py +++ b/src/python_testing/TC_RVCRUNM_2_2.py @@ -142,7 +142,7 @@ async def test_TC_RVCRUNM_2_2(self): 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") - + RVCRun_cluster = Clusters.RvcRunMode attributes = RVCRun_cluster.Attributes From d46ab09c3e7d4a1e1778e21aaf1c380abab44359 Mon Sep 17 00:00:00 2001 From: Jake Ororke Date: Mon, 4 Nov 2024 12:26:02 -0800 Subject: [PATCH 11/16] Updating RVCRUNM_2 and RVCCLEANM_2 test modules: - Adding back in the self.app_pipe code as it appears to have been accidentally removed --- src/python_testing/TC_RVCCLEANM_2_1.py | 1 + src/python_testing/TC_RVCCLEANM_2_2.py | 1 + src/python_testing/TC_RVCRUNM_2_1.py | 3 ++- src/python_testing/TC_RVCRUNM_2_2.py | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/python_testing/TC_RVCCLEANM_2_1.py b/src/python_testing/TC_RVCCLEANM_2_1.py index 33a6aa959ed39f..2afdbae6050e49 100644 --- a/src/python_testing/TC_RVCCLEANM_2_1.py +++ b/src/python_testing/TC_RVCCLEANM_2_1.py @@ -96,6 +96,7 @@ async def test_TC_RVCCLEANM_2_1(self): 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) RVCClean_cluster = Clusters.RvcCleanMode attributes = RVCClean_cluster.Attributes diff --git a/src/python_testing/TC_RVCCLEANM_2_2.py b/src/python_testing/TC_RVCCLEANM_2_2.py index 6a63ad6f5b03ac..8f59de74909c6b 100644 --- a/src/python_testing/TC_RVCCLEANM_2_2.py +++ b/src/python_testing/TC_RVCCLEANM_2_2.py @@ -112,6 +112,7 @@ async def test_TC_RVCCLEANM_2_2(self): 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.print_step(1, "Commissioning, already done") diff --git a/src/python_testing/TC_RVCRUNM_2_1.py b/src/python_testing/TC_RVCRUNM_2_1.py index 9799a09fc52b59..23ca766087d104 100644 --- a/src/python_testing/TC_RVCRUNM_2_1.py +++ b/src/python_testing/TC_RVCRUNM_2_1.py @@ -91,7 +91,8 @@ async def test_TC_RVCRUNM_2_1(self): 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) + RVCRun_cluster = Clusters.RvcRunMode attributes = RVCRun_cluster.Attributes diff --git a/src/python_testing/TC_RVCRUNM_2_2.py b/src/python_testing/TC_RVCRUNM_2_2.py index bbda35eba65489..5849ed953984f8 100644 --- a/src/python_testing/TC_RVCRUNM_2_2.py +++ b/src/python_testing/TC_RVCRUNM_2_2.py @@ -142,6 +142,7 @@ async def test_TC_RVCRUNM_2_2(self): 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) RVCRun_cluster = Clusters.RvcRunMode attributes = RVCRun_cluster.Attributes From 2f8c4bce7ce85a604cbc81534e490248c3307647 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Mon, 4 Nov 2024 20:27:54 +0000 Subject: [PATCH 12/16] Restyled by autopep8 --- src/python_testing/TC_RVCRUNM_2_1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python_testing/TC_RVCRUNM_2_1.py b/src/python_testing/TC_RVCRUNM_2_1.py index 23ca766087d104..5961ec83c4b2f1 100644 --- a/src/python_testing/TC_RVCRUNM_2_1.py +++ b/src/python_testing/TC_RVCRUNM_2_1.py @@ -92,7 +92,7 @@ async def test_TC_RVCRUNM_2_1(self): 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) - + RVCRun_cluster = Clusters.RvcRunMode attributes = RVCRun_cluster.Attributes From 26985ab6d5efed97de9022ef947edb128d6bc0f9 Mon Sep 17 00:00:00 2001 From: Jake Ororke Date: Wed, 18 Dec 2024 20:36:16 -0800 Subject: [PATCH 13/16] Updating TC_RVCCLEANM_2_1, RVCRUNM_2_1, and RVCRUNM_2_2 test modules: - Updating to using command_guard() and attribute_guard() where applicable --- src/python_testing/TC_RVCCLEANM_2_1.py | 4 +--- src/python_testing/TC_RVCRUNM_2_1.py | 5 +---- src/python_testing/TC_RVCRUNM_2_2.py | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/python_testing/TC_RVCCLEANM_2_1.py b/src/python_testing/TC_RVCCLEANM_2_1.py index 8e2daba3782618..2241d38f16e08f 100644 --- a/src/python_testing/TC_RVCCLEANM_2_1.py +++ b/src/python_testing/TC_RVCCLEANM_2_1.py @@ -105,12 +105,10 @@ async def test_TC_RVCCLEANM_2_1(self): commands = RVCClean_cluster.Commands RVCClean_accptcmd_list = attributes.AcceptedCommandList RVCClean_gencmd_list = attributes.GeneratedCommandList - accepted_cmd_list = await self.read_single_attribute_check_success(endpoint=self.endpoint, cluster=RVCClean_cluster, attribute=RVCClean_accptcmd_list) generated_cmd_list = await self.read_single_attribute_check_success(endpoint=self.endpoint, cluster=RVCClean_cluster, attribute=RVCClean_gencmd_list) - chg_mode_cmd_id = commands.ChangeToMode.command_id chg_rsp_cmd_id = commands.ChangeToModeResponse.command_id - if chg_mode_cmd_id not in accepted_cmd_list: + if not await self.command_guard(endpoint=self.endpoint, command=commands.ChangeToMode): asserts.fail("Change To Mode receiving commands needs to be supported") if chg_rsp_cmd_id not in generated_cmd_list: diff --git a/src/python_testing/TC_RVCRUNM_2_1.py b/src/python_testing/TC_RVCRUNM_2_1.py index 5ef7bcbc4fed5f..6afe436e70e511 100644 --- a/src/python_testing/TC_RVCRUNM_2_1.py +++ b/src/python_testing/TC_RVCRUNM_2_1.py @@ -98,14 +98,11 @@ async def test_TC_RVCRUNM_2_1(self): # Gathering Accepted and Generated Commands and associated ids commands = RVCRun_cluster.Commands - RVCRun_accptcmd_list = attributes.AcceptedCommandList RVCRun_gencmd_list = attributes.GeneratedCommandList - accepted_cmd_list = await self.read_single_attribute_check_success(endpoint=self.endpoint, cluster=RVCRun_cluster, attribute=RVCRun_accptcmd_list) generated_cmd_list = await self.read_single_attribute_check_success(endpoint=self.endpoint, cluster=RVCRun_cluster, attribute=RVCRun_gencmd_list) - chg_mode_cmd_id = commands.ChangeToMode.command_id chg_rsp_cmd_id = commands.ChangeToModeResponse.command_id - if chg_mode_cmd_id not in accepted_cmd_list: + if not await self.command_guard(endpoint=self.endpoint, command=commands.ChangeToMode): asserts.fail("Change To Mode receiving commands needs to be supported") if chg_rsp_cmd_id not in generated_cmd_list: diff --git a/src/python_testing/TC_RVCRUNM_2_2.py b/src/python_testing/TC_RVCRUNM_2_2.py index 1b19951e023e2d..f846feda633a8a 100644 --- a/src/python_testing/TC_RVCRUNM_2_2.py +++ b/src/python_testing/TC_RVCRUNM_2_2.py @@ -153,7 +153,7 @@ async def test_TC_RVCRUNM_2_2(self): accepted_cmd_list = await self.read_single_attribute_check_success(endpoint=self.endpoint, cluster=RVCRun_cluster, attribute=RVCRun_accptcmd_list) chg_mode_cmd_id = commands.ChangeToMode.command_id - if chg_mode_cmd_id not in accepted_cmd_list: + if not await self.command_guard(endpoint=self.endpoint, command=commands.ChangeToMode): asserts.fail("Change To Mode receiving commands needs to be supported") asserts.assert_true(self.check_pics("RVCRUNM.S.M.CAN_MANUALLY_CONTROLLED"), From 454ddd8fb8f503324e846f13e2550e30bc131f0e Mon Sep 17 00:00:00 2001 From: Jake Ororke Date: Wed, 18 Dec 2024 21:48:13 -0800 Subject: [PATCH 14/16] Updating TC_RVCCLEANM_2_1 and TC_RVCRUNM_2_2 test modules: - Resolving linting errors --- src/python_testing/TC_RVCCLEANM_2_1.py | 1 - src/python_testing/TC_RVCRUNM_2_2.py | 2 -- 2 files changed, 3 deletions(-) diff --git a/src/python_testing/TC_RVCCLEANM_2_1.py b/src/python_testing/TC_RVCCLEANM_2_1.py index 2241d38f16e08f..23032013f29648 100644 --- a/src/python_testing/TC_RVCCLEANM_2_1.py +++ b/src/python_testing/TC_RVCCLEANM_2_1.py @@ -103,7 +103,6 @@ async def test_TC_RVCCLEANM_2_1(self): # Gathering Accepted and Generated Commands and associated ids commands = RVCClean_cluster.Commands - RVCClean_accptcmd_list = attributes.AcceptedCommandList RVCClean_gencmd_list = attributes.GeneratedCommandList generated_cmd_list = await self.read_single_attribute_check_success(endpoint=self.endpoint, cluster=RVCClean_cluster, attribute=RVCClean_gencmd_list) chg_rsp_cmd_id = commands.ChangeToModeResponse.command_id diff --git a/src/python_testing/TC_RVCRUNM_2_2.py b/src/python_testing/TC_RVCRUNM_2_2.py index f846feda633a8a..16ab5c28e5b974 100644 --- a/src/python_testing/TC_RVCRUNM_2_2.py +++ b/src/python_testing/TC_RVCRUNM_2_2.py @@ -150,8 +150,6 @@ async def test_TC_RVCRUNM_2_2(self): # Gathering Accepted and Generated Commands and associated ids commands = RVCRun_cluster.Commands RVCRun_accptcmd_list = attributes.AcceptedCommandList - accepted_cmd_list = await self.read_single_attribute_check_success(endpoint=self.endpoint, cluster=RVCRun_cluster, attribute=RVCRun_accptcmd_list) - chg_mode_cmd_id = commands.ChangeToMode.command_id if not await self.command_guard(endpoint=self.endpoint, command=commands.ChangeToMode): asserts.fail("Change To Mode receiving commands needs to be supported") From 221bc8ce67562cf190ad7e9d4c879c391b51b724 Mon Sep 17 00:00:00 2001 From: Jake Ororke Date: Thu, 19 Dec 2024 20:24:00 -0800 Subject: [PATCH 15/16] Update TC_RVCRUNM_2_2 python test module: - Resolving linting error --- src/python_testing/TC_RVCRUNM_2_2.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/python_testing/TC_RVCRUNM_2_2.py b/src/python_testing/TC_RVCRUNM_2_2.py index 16ab5c28e5b974..9b06c873db2c0b 100644 --- a/src/python_testing/TC_RVCRUNM_2_2.py +++ b/src/python_testing/TC_RVCRUNM_2_2.py @@ -146,10 +146,7 @@ async def test_TC_RVCRUNM_2_2(self): RVCRun_cluster = Clusters.RvcRunMode attributes = RVCRun_cluster.Attributes - - # Gathering Accepted and Generated Commands and associated ids commands = RVCRun_cluster.Commands - RVCRun_accptcmd_list = attributes.AcceptedCommandList if not await self.command_guard(endpoint=self.endpoint, command=commands.ChangeToMode): asserts.fail("Change To Mode receiving commands needs to be supported") From 9c4e4e2e17d32f86d5c138f76f34ac458ca78d0e Mon Sep 17 00:00:00 2001 From: Jake Ororke Date: Thu, 19 Dec 2024 20:52:11 -0800 Subject: [PATCH 16/16] Updating TC_RVCRUNM_2_2 python test module: - Resolving linting errors --- src/python_testing/TC_RVCRUNM_2_2.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/python_testing/TC_RVCRUNM_2_2.py b/src/python_testing/TC_RVCRUNM_2_2.py index 9b06c873db2c0b..5068e075e636be 100644 --- a/src/python_testing/TC_RVCRUNM_2_2.py +++ b/src/python_testing/TC_RVCRUNM_2_2.py @@ -145,7 +145,6 @@ async def test_TC_RVCRUNM_2_2(self): self.app_pipe = self.app_pipe + str(app_pid) RVCRun_cluster = Clusters.RvcRunMode - attributes = RVCRun_cluster.Attributes commands = RVCRun_cluster.Commands if not await self.command_guard(endpoint=self.endpoint, command=commands.ChangeToMode):