Add pixit to test 1 3 (#35281)
* Added the PIXIT.SEAR.VALID_AREAS to the SEAR-1.3 test.
* Updated the rvc-app's PICS and readme following the addition of PIXIT.SEAR.VALID_AREAS.
* Restyled by prettier-markdown
* Update src/python_testing/TC_SEAR_1_3.py
Co-authored-by: Kiel Oleson <kielo@apple.com>
---------
Co-authored-by: Restyled.io <commits@restyled.io>
Co-authored-by: Kiel Oleson <kielo@apple.com>
diff --git a/examples/rvc-app/README.md b/examples/rvc-app/README.md
index da9317f..03a96a4 100644
--- a/examples/rvc-app/README.md
+++ b/examples/rvc-app/README.md
@@ -181,11 +181,8 @@
### TC 1.3
-todo once the
-[test plan issue](https://github.com/CHIP-Specifications/chip-test-plans/issues/4454)
-is resolved, add the required PIXIT and set the
-PICS`SEAR.S.M.VALID_STATE_FOR_SELECT_AREAS=1`. PIXIT: `` Example command:
-`./scripts/tests/run_python_test.py --script src/python_testing/TC_SEAR_1_3.py --script-args "--storage-path admin_storage.json --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values --endpoint 1`
+PIXIT: `PIXIT.SEAR.VALID_AREAS:'[7, 1234567]'` Example command:
+`./scripts/tests/run_python_test.py --script src/python_testing/TC_SEAR_1_3.py --script-args "--storage-path admin_storage.json --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values --endpoint 1 --json-arg PIXIT.SEAR.VALID_AREAS:'[7, 1234567]'`
### TC 1.4
diff --git a/examples/rvc-app/rvc-common/pics/rvc-app-pics-values b/examples/rvc-app/rvc-common/pics/rvc-app-pics-values
index 4ad084e..3829ee1 100644
--- a/examples/rvc-app/rvc-common/pics/rvc-app-pics-values
+++ b/examples/rvc-app/rvc-common/pics/rvc-app-pics-values
@@ -70,7 +70,7 @@
SEAR.S.M.REMOVE_MAP=1
SEAR.S.M.ADD_MAP=1
SEAR.S.M.INVALID_STATE_FOR_SELECT_AREAS=1
-SEAR.S.M.VALID_STATE_FOR_SELECT_AREAS=0
+SEAR.S.M.VALID_STATE_FOR_SELECT_AREAS=1
SEAR.S.M.SELECT_AREAS_WHILE_NON_IDLE=1
SEAR.S.M.HAS_MANUAL_SELAREA_STATE_CONTROL=1
SEAR.S.M.HAS_MANUAL_SKIP_STATE_CONTROL=1
diff --git a/src/python_testing/TC_SEAR_1_3.py b/src/python_testing/TC_SEAR_1_3.py
index 9613e58..80b6404 100644
--- a/src/python_testing/TC_SEAR_1_3.py
+++ b/src/python_testing/TC_SEAR_1_3.py
@@ -110,36 +110,42 @@
selected_areas = await self.read_selected_areas(step=6)
asserts.assert_true(len(selected_areas) == 0, "SelectedAreas should be empty")
- await self.send_cmd_select_areas_expect_response(step=8, new_areas=[invalid_area_id], expected_response=Clusters.ServiceArea.Enums.SelectAreasStatus.kUnsupportedArea)
+ await self.send_cmd_select_areas_expect_response(step=7, new_areas=[invalid_area_id], expected_response=Clusters.ServiceArea.Enums.SelectAreasStatus.kUnsupportedArea)
+
+ if "PIXIT.SEAR.VALID_AREAS" not in self.matter_test_config.global_test_params:
+ # All the remaining tests require the PIXIT.SEAR.VALID_AREAS
+ return
+
+ valid_areas = self.matter_test_config.global_test_params['PIXIT.SEAR.VALID_AREAS']
if self.check_pics("SEAR.S.M.INVALID_STATE_FOR_SELECT_AREAS") and self.check_pics("SEAR.S.M.HAS_MANUAL_SELAREA_STATE_CONTROL"):
test_step = "Manually intervene to put the device in a state that prevents it from executing the SelectAreas command"
- self.print_step("7", test_step)
+ self.print_step("8", test_step)
if self.is_ci:
await self.send_single_cmd(cmd=Clusters.Objects.RvcRunMode.Commands.ChangeToMode(newMode=1), endpoint=self.endpoint)
else:
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
- await self.send_cmd_select_areas_expect_response(step=10, new_areas=[valid_area_id], expected_response=Clusters.ServiceArea.Enums.SelectAreasStatus.kInvalidInMode)
+ await self.send_cmd_select_areas_expect_response(step=9, new_areas=valid_areas, expected_response=Clusters.ServiceArea.Enums.SelectAreasStatus.kInvalidInMode)
if self.check_pics("SEAR.S.M.VALID_STATE_FOR_SELECT_AREAS") and self.check_pics("SEAR.S.M.HAS_MANUAL_SELAREA_STATE_CONTROL"):
- test_step = f"Manually intervene to put the device in a state that allows it to execute the SelectAreas({supported_area_ids}) command"
- self.print_step("9", test_step)
+ test_step = f"Manually intervene to put the device in a state that allows it to execute the SelectAreas({valid_areas}) command"
+ self.print_step("10", test_step)
if self.is_ci:
self.write_to_app_pipe({"Name": "Reset"})
else:
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
- await self.send_cmd_select_areas_expect_response(step=11, new_areas=supported_area_ids, expected_response=Clusters.ServiceArea.Enums.SelectAreasStatus.kSuccess)
+ await self.send_cmd_select_areas_expect_response(step=11, new_areas=valid_areas, expected_response=Clusters.ServiceArea.Enums.SelectAreasStatus.kSuccess)
selected_areas = await self.read_selected_areas(step=12)
- asserts.assert_true(len(selected_areas) == len(supported_area_ids),
- f"SelectedAreas({selected_areas}) should match SupportedAreas({supported_area_ids})")
+ asserts.assert_true(selected_areas == valid_areas,
+ f"SelectedAreas({selected_areas}) should match SupportedAreas({valid_areas})")
- await self.send_cmd_select_areas_expect_response(step=13, new_areas=supported_area_ids, expected_response=Clusters.ServiceArea.Enums.SelectAreasStatus.kSuccess)
+ await self.send_cmd_select_areas_expect_response(step=13, new_areas=valid_areas, expected_response=Clusters.ServiceArea.Enums.SelectAreasStatus.kSuccess)
if self.check_pics("SEAR.S.M.VALID_STATE_FOR_SELECT_AREAS") and self.check_pics("SEAR.S.M.HAS_MANUAL_SELAREA_STATE_CONTROL") and self.check_pics("SEAR.S.M.SELECT_AREAS_WHILE_NON_IDLE"):
- test_step = f"Manually intervene to put the device in a state that allows it to execute the SelectAreas({valid_area_id}) command, and put the device in a non-idle state"
+ test_step = f"Manually intervene to put the device in a state that allows it to execute the SelectAreas({valid_areas}) command, and put the device in a non-idle state"
self.print_step("14", test_step)
if self.is_ci:
self.write_to_app_pipe({"Name": "Reset"})
@@ -148,9 +154,9 @@
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
if self.check_pics("SEAR.S.F00"):
- await self.send_cmd_select_areas_expect_response(step=15, new_areas=[valid_area_id], expected_response=Clusters.ServiceArea.Enums.SelectAreasStatus.kSuccess)
+ await self.send_cmd_select_areas_expect_response(step=15, new_areas=valid_areas, expected_response=Clusters.ServiceArea.Enums.SelectAreasStatus.kSuccess)
else:
- await self.send_cmd_select_areas_expect_response(step=15, new_areas=[valid_area_id], expected_response=Clusters.ServiceArea.Enums.SelectAreasStatus.kInvalidInMode)
+ await self.send_cmd_select_areas_expect_response(step=15, new_areas=valid_areas, expected_response=Clusters.ServiceArea.Enums.SelectAreasStatus.kInvalidInMode)
if __name__ == "__main__":