Skip to content

Commit

Permalink
fixup! replace yaml test by python test
Browse files Browse the repository at this point in the history
  • Loading branch information
mkardous-silabs committed Aug 22, 2023
1 parent cf4021e commit fa11d62
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 24 deletions.
4 changes: 1 addition & 3 deletions src/app/tests/suites/ciTests.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@
"GeneralCommissioning": ["Test_TC_CGEN_1_1", "Test_TC_CGEN_2_1"],
"GeneralDiagnostics": ["Test_TC_DGGEN_1_1", "Test_TC_DGGEN_2_1"],
"GroupKeyManagement": ["Test_TC_GRPKEY_1_1"],
"IcdManagement": [
"Test_TC_ICDM_1_1"
],
"IcdManagement": ["Test_TC_ICDM_1_1"],
"Identify": [
"Test_TC_I_1_1",
"Test_TC_I_2_1",
Expand Down
47 changes: 26 additions & 21 deletions src/python_testing/TC_ICDM_2_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ async def test_TC_ICDM_2_1(self):
idleModeInterval = 0

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

idleModeInterval = await self.read_icdm_attribute_expect_success(endpoint=endpoint,
attribute=attributes.IdleModeInterval)
asserts.assert_greater_equal(idleModeInterval, 1, "IdleModeInterval attribute is smaller than minimum value (1).")
Expand All @@ -50,48 +50,53 @@ async def test_TC_ICDM_2_1(self):
asserts.assert_true(False, "IdleModeInterval is a mandatory attribute and must be present in the PICS file")

# Active Mode Interval attribute test
if(self.check_pics("ICDM.S.A0001")):
if (self.check_pics("ICDM.S.A0001")):
self.print_step(2, "Read ActiveModeInterval Attribute")
idleModeInterval *= 1000 # Convert seconds to milliseconds

idleModeInterval *= 1000 # Convert seconds to milliseconds
activeModeInterval = await self.read_icdm_attribute_expect_success(endpoint=endpoint,
attribute=attributes.ActiveModeInterval)
asserts.assert_greater_equal(activeModeInterval, 300, "ActiveModeInterval attribute is smaller than minimum value (300).")
asserts.assert_less_equal(activeModeInterval, idleModeInterval, "ActiveModeInterval attribute is greater than the IdleModeInterval attrbiute.")
asserts.assert_greater_equal(activeModeInterval, 300,
"ActiveModeInterval attribute is smaller than minimum value (300).")
asserts.assert_less_equal(activeModeInterval, idleModeInterval,
"ActiveModeInterval attribute is greater than the IdleModeInterval attrbiute.")
else:
asserts.assert_true(False, "ActiveModeInterval is a mandatory attribute and must be present in the PICS file")

# Active Mode Threshold attribute test
if(self.check_pics("ICDM.S.A0002")):
if (self.check_pics("ICDM.S.A0002")):
self.print_step(2, "Read ActiveModeThreshold Attribute")

activeModeThreshold = await self.read_icdm_attribute_expect_success(endpoint=endpoint,
attribute=attributes.ActiveModeThreshold)
asserts.assert_greater_equal(activeModeThreshold, 300, "ActiveModeThreshold attribute is smaller than minimum value (300).")
attribute=attributes.ActiveModeThreshold)
asserts.assert_greater_equal(activeModeThreshold, 300,
"ActiveModeThreshold attribute is smaller than minimum value (300).")
else:
asserts.assert_true(False, "ActiveModeThreshold is a mandatory attribute and must be present in the PICS file")

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

registeredClients = await self.read_icdm_attribute_expect_success(endpoint=endpoint,
attribute=attributes.RegisteredClients)

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

icdCounter = await self.read_icdm_attribute_expect_success(endpoint=endpoint,
attribute=attributes.ICDCounter)

# ClientsSupportedPerFabric attribute test
if(self.check_pics("ICDM.S.A0003")):
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_greater_equal(clientsSupportedPerFabric, 1, "ActiveModeThreshold attribute is smaller than minimum value (300).")
attribute=attributes.ClientsSupportedPerFabric)
asserts.assert_greater_equal(clientsSupportedPerFabric, 1,
"ActiveModeThreshold attribute is smaller than minimum value (300).")


if __name__ == "__main__":
default_matter_test_main()

0 comments on commit fa11d62

Please sign in to comment.