Skip to content

Commit

Permalink
python testing: Add top-level PICS markers to all tests (#31523)
Browse files Browse the repository at this point in the history
Without these, all the python tests will be run on every device
on the TH.
  • Loading branch information
cecille authored Jan 19, 2024
1 parent 9f1e15e commit d758a67
Show file tree
Hide file tree
Showing 33 changed files with 93 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/python_testing/TC_DRLK_2_12.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ async def teardown_test(self):
await self.teardown()
return super().teardown_test()

def pics_TC_DRLK_2_12(self) -> list[str]:
return ["DRLK.S.F0c"]

@async_test_body
async def test_TC_DRLK_2_12(self):
await self.run_drlk_test_2_12()
Expand Down
3 changes: 3 additions & 0 deletions src/python_testing/TC_DRLK_2_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ async def teardown_test(self):
await self.teardown()
return super().teardown_test()

def pics_TC_DRLK_2_2(self) -> list[str]:
return ["DRLK.S"]

@async_test_body
async def test_TC_DRLK_2_2(self):
await self.run_drlk_test_2_2()
Expand Down
3 changes: 3 additions & 0 deletions src/python_testing/TC_DRLK_2_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ async def teardown_test(self):
await self.teardown()
return super().teardown_test()

def pics_TC_DRLK_2_3(self) -> list[str]:
return ["DRLK.S"]

@async_test_body
async def test_TC_DRLK_2_3(self):
await self.run_drlk_test_2_3()
Expand Down
2 changes: 1 addition & 1 deletion src/python_testing/TC_EEVSE_2_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def desc_TC_EEVSE_2_2(self) -> str:
def pics_TC_EEVSE_2_2(self):
""" This function returns a list of PICS for this test case that must be True for the test to be run"""
# In this case - there is no feature flags needed to run this test case
return None
return ["EEVSE.S"]

def steps_TC_EEVSE_2_2(self) -> list[TestStep]:
steps = [
Expand Down
2 changes: 1 addition & 1 deletion src/python_testing/TC_EEVSE_2_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def desc_TC_EEVSE_2_4(self) -> str:
def pics_TC_EEVSE_2_4(self):
""" This function returns a list of PICS for this test case that must be True for the test to be run"""
# In this case - there is no feature flags needed to run this test case
return None
return ["EEVSE.S"]

def steps_TC_EEVSE_2_4(self) -> list[TestStep]:
steps = [
Expand Down
2 changes: 1 addition & 1 deletion src/python_testing/TC_EEVSE_2_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def desc_TC_EEVSE_2_5(self) -> str:
def pics_TC_EEVSE_2_5(self):
""" This function returns a list of PICS for this test case that must be True for the test to be run"""
# In this case - there is no feature flags needed to run this test case
return None
return ["EEVSE.S"]

def steps_TC_EEVSE_2_5(self) -> list[TestStep]:
steps = [
Expand Down
3 changes: 3 additions & 0 deletions src/python_testing/TC_FAN_3_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ async def write_rock_setting(self, endpoint, rock_setting):
result = await self.default_controller.WriteAttribute(self.dut_node_id, [(endpoint, Clusters.FanControl.Attributes.RockSetting(rock_setting))])
asserts.assert_equal(result[0].Status, Status.Success, "RockSetting write failed")

def pics_TC_FAN_3_3(self) -> list[str]:
return ["FAN.S"]

@async_test_body
async def test_TC_FAN_3_3(self):
if not self.check_pics("FAN.S.F02"):
Expand Down
3 changes: 3 additions & 0 deletions src/python_testing/TC_FAN_3_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ async def write_wind_setting(self, endpoint, wind_setting):
result = await self.default_controller.WriteAttribute(self.dut_node_id, [(endpoint, Clusters.FanControl.Attributes.WindSetting(wind_setting))])
asserts.assert_equal(result[0].Status, Status.Success, "WindSetting write failed")

def pics_TC_FAN_3_4(self) -> list[str]:
return ["FAN.S"]

@async_test_body
async def test_TC_FAN_3_4(self):
if not self.check_pics("FAN.S.F03"):
Expand Down
3 changes: 3 additions & 0 deletions src/python_testing/TC_FAN_3_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ async def send_step_command(self, endpoint,
asserts.assert_equal(e.status, expected_status, "Unexpected error returned")
pass

def pics_TC_FAN_3_5(self) -> list[str]:
return ["FAN.S"]

@async_test_body
async def test_TC_FAN_3_5(self):
if not self.check_pics("FAN.S.F04"):
Expand Down
3 changes: 3 additions & 0 deletions src/python_testing/TC_ICDM_2_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ async def read_icdm_attribute_expect_success(self, endpoint, attribute):
cluster = Clusters.Objects.IcdManagement
return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attribute)

def pics_TC_ICDM_2_1(self) -> list[str]:
return ["ICDM.S"]

@async_test_body
async def test_TC_ICDM_2_1(self):

Expand Down
3 changes: 3 additions & 0 deletions src/python_testing/TC_OPSTATE_2_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ async def read_and_validate_operror(self, step, expected_error):
asserts.assert_equal(operational_error.errorStateID, expected_error,
"errorStateID(%s) should equal %s" % (operational_error.errorStateID, expected_error))

def pics_TC_OPSTATE_2_1(self) -> list[str]:
return ["OPSTATE.S"]

@async_test_body
async def test_TC_OPSTATE_2_1(self):

Expand Down
3 changes: 3 additions & 0 deletions src/python_testing/TC_OPSTATE_2_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ async def send_resume_cmd(self) -> Clusters.Objects.OperationalState.Commands.Re
"Unexpected return type for Resume")
return ret

def pics_TC_OPSTATE_2_3(self) -> list[str]:
return ["OPSTATE.S"]

@async_test_body
async def test_TC_OPSTATE_2_3(self):

Expand Down
3 changes: 3 additions & 0 deletions src/python_testing/TC_RVCCLEANM_1_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ async def read_mod_attribute_expect_success(self, endpoint, attribute):
cluster = Clusters.Objects.RvcCleanMode
return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attribute)

def pics_TC_RVCCLEANM_1_2(self) -> list[str]:
return ["RVCCLEANM.S"]

@async_test_body
async def test_TC_RVCCLEANM_1_2(self):

Expand Down
3 changes: 3 additions & 0 deletions src/python_testing/TC_RVCCLEANM_2_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ async def send_change_to_mode_cmd(self, newMode) -> Clusters.Objects.RvcCleanMod
"Unexpected return type for ChangeToMode")
return ret

def pics_TC_RVCCLEANM_2_1(self) -> list[str]:
return ["RVCCLEANM.S"]

@async_test_body
async def test_TC_RVCCLEANM_2_1(self):

Expand Down
3 changes: 3 additions & 0 deletions src/python_testing/TC_RVCCLEANM_3_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ async def check_preconditions(self, endpoint):

return False

def pics_TC_RVCCLEANM_3_2(self) -> list[str]:
return ["RVCCLEANM.S.A0002"]

@async_test_body
async def test_TC_RVCCLEANM_3_2(self):

Expand Down
3 changes: 3 additions & 0 deletions src/python_testing/TC_RVCOPSTATE_2_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ async def read_and_validate_operror(self, step, expected_error):
asserts.assert_equal(operational_error.errorStateID, expected_error,
"errorStateID(%s) should equal %s" % (operational_error.errorStateID, expected_error))

def TC_RVCOPSTATE_2_1(self) -> list[str]:
return ["RVCOPSTATE.S"]

@async_test_body
async def test_TC_RVCOPSTATE_2_1(self):

Expand Down
3 changes: 3 additions & 0 deletions src/python_testing/TC_RVCOPSTATE_2_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ async def send_resume_cmd(self) -> Clusters.Objects.RvcOperationalState.Commands
"Unexpected return type for Resume")
return ret

def TC_RVCOPSTATE_2_3(self) -> list[str]:
return ["RVCOPSTATE.S"]

@async_test_body
async def test_TC_RVCOPSTATE_2_3(self):

Expand Down
3 changes: 3 additions & 0 deletions src/python_testing/TC_RVCRUNM_1_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ async def read_mod_attribute_expect_success(self, endpoint, attribute):
cluster = Clusters.Objects.RvcRunMode
return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attribute)

def pics_TC_RVCRUNM_1_2(self) -> list[str]:
return ["RVCRUNM.S"]

@async_test_body
async def test_TC_RVCRUNM_1_2(self):

Expand Down
3 changes: 3 additions & 0 deletions src/python_testing/TC_RVCRUNM_2_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ async def send_change_to_mode_cmd(self, newMode) -> Clusters.Objects.RvcRunMode.
"Unexpected return type for ChangeToMode")
return ret

def pics_TC_RVCRUNM_2_1(self) -> list[str]:
return ["RVCRUNM.S"]

@async_test_body
async def test_TC_RVCRUNM_2_1(self):

Expand Down
3 changes: 3 additions & 0 deletions src/python_testing/TC_RVCRUNM_3_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ async def check_preconditions(self, endpoint):

return False

def pics_TC_RVCRUNM_3_2(self) -> list[str]:
return ["RVCRUNM.S"]

@async_test_body
async def test_TC_RVCRUNM_3_2(self):

Expand Down
3 changes: 3 additions & 0 deletions src/python_testing/TC_TIMESYNC_2_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ async def read_ts_attribute_expect_success(self, endpoint, attribute):
cluster = Clusters.Objects.TimeSynchronization
return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attribute)

def pics_TC_TIMESYNC_2_1(self) -> list[str]:
return ["TIMESYNC.S"]

@async_test_body
async def test_TC_TIMESYNC_2_1(self):

Expand Down
3 changes: 3 additions & 0 deletions src/python_testing/TC_TIMESYNC_2_10.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ async def send_set_dst_cmd(self, dst: typing.List[Clusters.Objects.TimeSynchroni
async def send_set_utc_cmd(self, utc: uint) -> None:
await self.send_single_cmd(cmd=Clusters.Objects.TimeSynchronization.Commands.SetUTCTime(UTCTime=utc, granularity=Clusters.Objects.TimeSynchronization.Enums.GranularityEnum.kMillisecondsGranularity))

def pics_TC_TIMESYNC_2_10(self) -> list[str]:
return ["TIMESYNC.S.F00"]

@async_test_body
async def test_TC_TIMESYNC_2_10(self):

Expand Down
3 changes: 3 additions & 0 deletions src/python_testing/TC_TIMESYNC_2_11.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ def wait_for_dst_status(self, th_utc, wait_s, expect_active):
asserts.fail("Did not receive DSTStatus event")
pass

def pics_TC_TIMESYNC_2_11(self) -> list[str]:
return ["TIMESYNC.S.F00"]

@async_test_body
async def test_TC_TIMESYNC_2_11(self):

Expand Down
3 changes: 3 additions & 0 deletions src/python_testing/TC_TIMESYNC_2_12.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ def wait_for_tz_status(self, th_utc, wait_s, expected_offset, expected_name):
except queue.Empty:
asserts.fail("Did not receive TZStatus event")

def pics_TC_TIMESYNC_2_12(self) -> list[str]:
return ["TIMESYNC.S.F00"]

@async_test_body
async def test_TC_TIMESYNC_2_12(self):

Expand Down
3 changes: 3 additions & 0 deletions src/python_testing/TC_TIMESYNC_2_13.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ def wait_for_trusted_time_souce_event(self, timeout):
except queue.Empty:
asserts.fail("Did not receive MissingTrustedTimeSouce event")

def pics_TC_TIMESYNC_2_13(self) -> list[str]:
return ["TIMESYNC.S.F01"]

@async_test_body
async def test_TC_TIMESYNC_2_13(self):

Expand Down
3 changes: 3 additions & 0 deletions src/python_testing/TC_TIMESYNC_2_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ async def read_ts_attribute_expect_success(self, endpoint, attribute):
cluster = Clusters.Objects.TimeSynchronization
return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attribute)

def pics_TC_TIMESYNC_2_2(self) -> list[str]:
return ["TIMESYNC.S"]

@async_test_body
async def test_TC_TIMESYNC_2_2(self):

Expand Down
3 changes: 3 additions & 0 deletions src/python_testing/TC_TIMESYNC_2_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ async def send_set_time_zone_cmd_expect_error(self, tz: typing.List[Clusters.Obj
asserts.assert_equal(e.status, error, "Unexpected error returned")
pass

def pics_TC_TIMESYNC_2_4(self) -> list[str]:
return ["TIMESYNC.S.F00"]

@async_test_body
async def test_TC_TIMESYNC_2_4(self):

Expand Down
3 changes: 3 additions & 0 deletions src/python_testing/TC_TIMESYNC_2_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ async def send_set_dst_cmd_expect_error(self, dst: typing.List[Clusters.Objects.
asserts.assert_equal(e.status, error, "Unexpected error returned")
pass

def pics_TC_TIMESYNC_2_5(self) -> list[str]:
return ["TIMESYNC.S.F00"]

@async_test_body
async def test_TC_TIMESYNC_2_5(self):

Expand Down
3 changes: 3 additions & 0 deletions src/python_testing/TC_TIMESYNC_2_6.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ async def send_set_default_ntp_cmd_expect_error(self, ntp: typing.Union[Nullable
asserts.assert_equal(e.status, error, "Unexpected error returned")
pass

def pics_TC_TIMESYNC_2_6(self) -> list[str]:
return ["TIMESYNC.S.F01"]

@async_test_body
async def test_TC_TIMESYNC_2_6(self):

Expand Down
3 changes: 3 additions & 0 deletions src/python_testing/TC_TIMESYNC_2_7.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ async def send_set_dst_cmd(self, dst: typing.List[Clusters.Objects.TimeSynchroni
async def send_set_utc_cmd(self, utc: uint) -> None:
await self.send_single_cmd(cmd=Clusters.Objects.TimeSynchronization.Commands.SetUTCTime(UTCTime=utc, granularity=Clusters.Objects.TimeSynchronization.Enums.GranularityEnum.kMillisecondsGranularity))

def pics_TC_TIMESYNC_2_7(self) -> list[str]:
return ["TIMESYNC.S.F00"]

@async_test_body
async def test_TC_TIMESYNC_2_7(self):

Expand Down
3 changes: 3 additions & 0 deletions src/python_testing/TC_TIMESYNC_2_8.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ async def send_set_dst_cmd(self, dst: typing.List[Clusters.Objects.TimeSynchroni
async def send_set_utc_cmd(self, utc: uint) -> None:
await self.send_single_cmd(cmd=Clusters.Objects.TimeSynchronization.Commands.SetUTCTime(UTCTime=utc, granularity=Clusters.Objects.TimeSynchronization.Enums.GranularityEnum.kMillisecondsGranularity))

def pics_TC_TIMESYNC_2_8(self) -> list[str]:
return ["TIMESYNC.S.F00"]

@async_test_body
async def test_TC_TIMESYNC_2_8(self):

Expand Down
3 changes: 3 additions & 0 deletions src/python_testing/TC_TIMESYNC_2_9.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ async def send_set_dst_cmd(self, dst: typing.List[Clusters.Objects.TimeSynchroni
async def send_set_utc_cmd(self, utc: uint) -> None:
await self.send_single_cmd(cmd=Clusters.Objects.TimeSynchronization.Commands.SetUTCTime(UTCTime=utc, granularity=Clusters.Objects.TimeSynchronization.Enums.GranularityEnum.kMillisecondsGranularity))

def pics_TC_TIMESYNC_2_9(self) -> list[str]:
return ["TIMESYNC.S.F00"]

@async_test_body
async def test_TC_TIMESYNC_2_9(self):

Expand Down
3 changes: 3 additions & 0 deletions src/python_testing/TC_TIMESYNC_3_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

class TC_TIMESYNC_3_1(MatterBaseTest):

def pics_TC_TIMESYNC_3_1(self) -> list[str]:
return ["TIMESYNC.S"]

@async_test_body
async def test_TC_TIMESYNC_3_1(self):
self.print_step(1, "Wildcard read of time sync cluster")
Expand Down

0 comments on commit d758a67

Please sign in to comment.