Skip to content

Commit 1665116

Browse files
authored
Merge b8903bc into ccaa0ed
2 parents ccaa0ed + b8903bc commit 1665116

File tree

3 files changed

+33
-7
lines changed

3 files changed

+33
-7
lines changed

src/python_testing/TC_SEAR_1_3.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ async def test_TC_SEAR_1_3(self):
9797
asserts.fail("The --app-pid flag must be set when PICS_SDK_CI_ONLY is set")
9898
self.app_pipe = self.app_pipe + str(app_pid)
9999

100+
features = await self.read_sear_attribute_expect_success(endpoint=self.endpoint, attribute=Clusters.ServiceArea.Attributes.FeatureMap)
101+
100102
self.print_step(1, "Commissioning, already done")
101103

102104
# Ensure that the device is in the correct state
@@ -163,7 +165,7 @@ async def test_TC_SEAR_1_3(self):
163165
else:
164166
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
165167

166-
if self.check_pics("SEAR.S.F00"):
168+
if bool(features & Clusters.ServiceArea.Bitmaps.Feature.kSelectWhileRunning):
167169
await self.send_cmd_select_areas_expect_response(step=15, new_areas=valid_areas, expected_response=Clusters.ServiceArea.Enums.SelectAreasStatus.kSuccess)
168170
else:
169171
await self.send_cmd_select_areas_expect_response(step=15, new_areas=valid_areas, expected_response=Clusters.ServiceArea.Enums.SelectAreasStatus.kInvalidInMode)

src/python_testing/TC_SEAR_1_5.py

+13-5
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ async def send_cmd_skip_area_expect_response(self, step, skipped_area, expected_
9898
f"Command response ({ret.status}) doesn't match the expected one")
9999

100100
def TC_SEAR_1_5(self) -> list[str]:
101-
return ["SEAR.S", "SEAR.S.C02.Rsp"]
101+
return ["SEAR.S"]
102102

103103
@async_test_body
104104
async def test_TC_SEAR_1_5(self):
@@ -111,6 +111,14 @@ async def test_TC_SEAR_1_5(self):
111111
asserts.fail("The --app-pid flag must be set when PICS_SDK_CI_ONLY is set")
112112
self.app_pipe = self.app_pipe + str(app_pid)
113113

114+
attribute_list = await self.read_sear_attribute_expect_success(
115+
endpoint=self.endpoint, attribute=Clusters.ServiceArea.Attributes.AttributeList)
116+
accepted_cmd_list = await self.read_sear_attribute_expect_success(
117+
endpoint=self.endpoint, attribute=Clusters.ServiceArea.Attributes.AcceptedCommandList)
118+
119+
if Clusters.ServiceArea.Commands.SkipArea.command_id not in accepted_cmd_list:
120+
asserts.fail("Skip Area Response command needs to be supported to run this test")
121+
114122
self.print_step(1, "Commissioning, already done")
115123

116124
# Ensure that the device is in the correct state
@@ -167,15 +175,15 @@ async def test_TC_SEAR_1_5(self):
167175
if not self.check_pics("SEAR.S.M.VALID_STATE_FOR_SKIP"):
168176
return
169177

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

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

177185
old_current_area = NullValue
178-
if self.check_pics("SEAR.S.A0003"):
186+
if Clusters.ServiceArea.Attributes.CurrentArea.attribute_id in attribute_list:
179187
old_current_area = await self.read_current_area(step=11)
180188

181189
self.print_step("12", "")
@@ -189,7 +197,7 @@ async def test_TC_SEAR_1_5(self):
189197
if not self.is_ci:
190198
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
191199

192-
if self.check_pics("SEAR.S.A0005"):
200+
if Clusters.ServiceArea.Attributes.Progress.attribute_id in attribute_list:
193201
new_progress_list = await self.read_progress(step=15)
194202
asserts.assert_true(len(new_progress_list) > 0,
195203
f"len of Progress({len(new_progress_list)}) should not be zero)")
@@ -230,7 +238,7 @@ async def test_TC_SEAR_1_5(self):
230238
self.print_step("17", "")
231239
return
232240

233-
if not self.check_pics("SEAR.S.A0005"):
241+
if Clusters.ServiceArea.Attributes.Progress.attribute_id not in attribute_list:
234242
return
235243

236244
if self.check_pics("SEAR.S.M.HAS_MANUAL_SKIP_STATE_CONTROL"):

src/python_testing/TC_SEAR_1_6.py

+17-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ async def read_progress(self, step):
8181
return progress
8282

8383
def TC_SEAR_1_6(self) -> list[str]:
84-
return ["SEAR.S", "SEAR.S.A0005", "SEAR.S.A0000", "SEAR.S.A0002", "SEAR.S.M.HAS_MANUAL_OPERATING_STATE_CONTROL"]
84+
return ["SEAR.S", "SEAR.S.M.HAS_MANUAL_OPERATING_STATE_CONTROL"]
8585

8686
@async_test_body
8787
async def test_TC_SEAR_1_6(self):
@@ -94,6 +94,22 @@ async def test_TC_SEAR_1_6(self):
9494
asserts.fail("The --app-pid flag must be set when PICS_SDK_CI_ONLY is set")
9595
self.app_pipe = self.app_pipe + str(app_pid)
9696

97+
attributes = Clusters.ServiceArea.Attributes
98+
attribute_list = await self.read_sear_attribute_expect_success(
99+
endpoint=self.endpoint, attribute=Clusters.ServiceArea.Attributes.AttributeList)
100+
SupportedAreas = attributes.SupportedAreas.attribute_id
101+
SelectedAreas = attributes.SelectedAreas.attribute_id
102+
Progress = attributes.Progress.attribute_id
103+
104+
if SupportedAreas not in attribute_list:
105+
asserts.fail("Supported areas attribute required in attribute list to run test")
106+
107+
if SelectedAreas not in attribute_list:
108+
asserts.fail("Selected areas attribute required in attribute list to run test")
109+
110+
if Progress not in attribute_list:
111+
asserts.fail("Progress attribute required in attribute list to run test")
112+
97113
self.print_step(1, "Commissioning, already done")
98114

99115
# Ensure that the device is in the correct state

0 commit comments

Comments
 (0)