Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Replaced automatable PICS in SEAR tests #35231

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/python_testing/TC_SEAR_1_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ async def test_TC_SEAR_1_3(self):
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)

features = await self.read_sear_attribute_expect_success(endpoint=self.endpoint, attribute=Clusters.ServiceArea.Attributes.FeatureMap)

self.print_step(1, "Commissioning, already done")

# Ensure that the device is in the correct state
Expand Down Expand Up @@ -153,7 +155,7 @@ async def test_TC_SEAR_1_3(self):
else:
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")

if self.check_pics("SEAR.S.F00"):
if bool(features & Clusters.ServiceArea.Bitmaps.Feature.kSelectWhileRunning):
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_areas, expected_response=Clusters.ServiceArea.Enums.SelectAreasStatus.kInvalidInMode)
Expand Down
18 changes: 13 additions & 5 deletions src/python_testing/TC_SEAR_1_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ async def send_cmd_skip_area_expect_response(self, step, skipped_area, expected_
f"Command response ({ret.status}) doesn't match the expected one")

def TC_SEAR_1_5(self) -> list[str]:
return ["SEAR.S", "SEAR.S.C02.Rsp"]
return ["SEAR.S"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here - let's leave the top level PICS as-is for now and we'll deal with the top level PICS separately.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been updated to leave the top level PICS as-is.


@async_test_body
async def test_TC_SEAR_1_5(self):
Expand All @@ -102,6 +102,14 @@ async def test_TC_SEAR_1_5(self):
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)

attribute_list = await self.read_sear_attribute_expect_success(
endpoint=self.endpoint, attribute=Clusters.ServiceArea.Attributes.AttributeList)
accepted_cmd_list = await self.read_sear_attribute_expect_success(
endpoint=self.endpoint, attribute=Clusters.ServiceArea.Attributes.AcceptedCommandList)

if Clusters.ServiceArea.Commands.SkipArea.command_id not in accepted_cmd_list:
asserts.fail("Skip Area Response command needs to be supported to run this test")

self.print_step(1, "Commissioning, already done")

# Ensure that the device is in the correct state
Expand Down Expand Up @@ -154,15 +162,15 @@ async def test_TC_SEAR_1_5(self):
if not self.check_pics("SEAR.S.M.VALID_STATE_FOR_SKIP"):
return

if self.check_pics("SEAR.S.A0005"):
if Clusters.ServiceArea.Attributes.Progress.attribute_id in attribute_list:
old_progress_list = await self.read_progress(step=9)
asserts.assert_true(len(old_progress_list) > 0, f"len of Progress({len(old_progress_list)}) should not be zero)")

selected_areas = await self.read_selected_areas(step=10)
asserts.assert_true(len(selected_areas) > 0, "SelectedAreas is empty")

old_current_area = NullValue
if self.check_pics("SEAR.S.A0003"):
if Clusters.ServiceArea.Attributes.CurrentArea.attribute_id in attribute_list:
old_current_area = await self.read_current_area(step=11)

self.print_step("12", "")
Expand All @@ -176,7 +184,7 @@ async def test_TC_SEAR_1_5(self):
if not self.is_ci:
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")

if self.check_pics("SEAR.S.A0005"):
if Clusters.ServiceArea.Attributes.Progress.attribute_id in attribute_list:
new_progress_list = await self.read_progress(step=15)
asserts.assert_true(len(new_progress_list) > 0,
f"len of Progress({len(new_progress_list)}) should not be zero)")
Expand Down Expand Up @@ -217,7 +225,7 @@ async def test_TC_SEAR_1_5(self):
self.print_step("17", "")
return

if not self.check_pics("SEAR.S.A0005"):
if Clusters.ServiceArea.Attributes.Progress.attribute_id not in attribute_list:
return

if self.check_pics("SEAR.S.M.HAS_MANUAL_SKIP_STATE_CONTROL"):
Expand Down
18 changes: 17 additions & 1 deletion src/python_testing/TC_SEAR_1_6.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ async def read_progress(self, step):
return progress

def TC_SEAR_1_6(self) -> list[str]:
return ["SEAR.S", "SEAR.S.A0005", "SEAR.S.A0000", "SEAR.S.A0002", "SEAR.S.M.HAS_MANUAL_OPERATING_STATE_CONTROL"]
return ["SEAR.S", "SEAR.S.M.HAS_MANUAL_OPERATING_STATE_CONTROL"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, let's just leave this test as-is for now. The top level pics we can deal with separately and this will mess up the TH

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you,
This has been updated to leave the top level PICS as-is and should now be resolved.


@async_test_body
async def test_TC_SEAR_1_6(self):
Expand All @@ -85,6 +85,22 @@ async def test_TC_SEAR_1_6(self):
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)

attributes = Clusters.ServiceArea.Attributes
attribute_list = await self.read_sear_attribute_expect_success(
endpoint=self.endpoint, attribute=Clusters.ServiceArea.Attributes.AttributeList)
SupportedAreas = attributes.SupportedAreas.attribute_id
SelectedAreas = attributes.SelectedAreas.attribute_id
Progress = attributes.Progress.attribute_id

if SupportedAreas not in attribute_list:
asserts.fail("Supported areas attribute required in attribute list to run test")

if SelectedAreas not in attribute_list:
asserts.fail("Selected areas attribute required in attribute list to run test")

if Progress not in attribute_list:
asserts.fail("Progress attribute required in attribute list to run test")

self.print_step(1, "Commissioning, already done")

# Ensure that the device is in the correct state
Expand Down
Loading