Skip to content

Commit

Permalink
update ICDM 2.1 test
Browse files Browse the repository at this point in the history
  • Loading branch information
mkardous-silabs committed Nov 8, 2023
1 parent 368b9a0 commit 9c98b2f
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/python_testing/TC_ICDM_2_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,18 @@ async def read_icdm_attribute_expect_success(self, endpoint, attribute):

@async_test_body
async def test_TC_ICDM_2_1(self):

if not self.check_pics("ICDM.S"):
logger.info("Test skipped because PICS ICDM.S is not set")
return

endpoint = self.user_params.get("endpoint", 0)

self.print_step(1, "Commissioning, already done")
attributes = Clusters.IcdManagement.Attributes
idleModeDuration = 0

# Idle Mode Interval attribute test
# Idle Mode Duration attribute test
if (self.check_pics("ICDM.S.A0000")):
self.print_step(2, "Read IdleModeDuration Attribute")

Expand All @@ -44,7 +48,7 @@ async def test_TC_ICDM_2_1(self):
else:
asserts.assert_true(False, "IdleModeDuration is a mandatory attribute and must be present in the PICS file")

# Active Mode Interval attribute test
# Active Mode Duration attribute test
if (self.check_pics("ICDM.S.A0001")):
self.print_step(2, "Read ActiveModeDuration Attribute")

Expand Down Expand Up @@ -80,17 +84,22 @@ async def test_TC_ICDM_2_1(self):
if (self.check_pics("ICDM.S.A0003")):
self.print_step(2, "Read ICDCounter Attribute")

await self.read_icdm_attribute_expect_success(endpoint=endpoint,
ICDCounter = await self.read_icdm_attribute_expect_success(endpoint=endpoint,
attribute=attributes.ICDCounter)
asserts.assert_true(0 <= ICDCounter <= 4294967295,
"ICDCounter attribute does not fit in a uint32.")

# ClientsSupportedPerFabric attribute test
if (self.check_pics("ICDM.S.A0003")):
self.print_step(2, "Read ClientsSupportedPerFabric Attribute")

clientsSupportedPerFabric = await self.read_icdm_attribute_expect_success(endpoint=endpoint,
attribute=attributes.ClientsSupportedPerFabric)
asserts.assert_true(0 <= clientsSupportedPerFabric <= 65535,
"ActiveModeThreshold ClientsSupportedPerFabric does not fit in a uint16.")
asserts.assert_greater_equal(clientsSupportedPerFabric, 1,
"ActiveModeThreshold attribute is smaller than minimum value (300).")
"ClientsSupportedPerFabric attribute is smaller than minimum value (1).")



if __name__ == "__main__":
Expand Down

0 comments on commit 9c98b2f

Please sign in to comment.