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

[PICS-Removal] Removing automatable PICS from ICDM 2 1 test module #34933

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
eb00219
Updated TC_ICDM_2_1 test module:
j-ororke Aug 12, 2024
f74cdc7
Restyled by autopep8
restyled-commits Aug 12, 2024
38cdc25
Merge branch 'master' into remove_PICS_from_ICDM_tests
j-ororke Aug 12, 2024
dd77706
updated TC_ICDM_2_1: Attempting to resolve issue in CI/CD pipeline
j-ororke Aug 12, 2024
355e460
Restyled by autopep8
restyled-commits Aug 12, 2024
372e144
Merge branch 'master' into remove_PICS_from_ICDM_tests
j-ororke Aug 12, 2024
6f9e1e5
Updated TC_ICDM_2_1 test module:
j-ororke Aug 13, 2024
076cbe6
Updating TC_ICDM_2_1 and test_TC_ICDM_2_1 test modules:
j-ororke Aug 13, 2024
267afbe
Restyled by autopep8
restyled-commits Aug 13, 2024
fa944cd
Merge branch 'master' into remove_PICS_from_ICDM_tests
j-ororke Aug 26, 2024
a629150
Merge branch 'master' into remove_PICS_from_ICDM_tests
j-ororke Dec 2, 2024
07bb37a
Merge branch 'master' into remove_PICS_from_ICDM_tests
j-ororke Dec 18, 2024
d7747ed
Update TC_ICDM_2_1 test module:
j-ororke Dec 19, 2024
0d62747
Updating TC_ICDM_2_1 test module:
j-ororke Jan 20, 2025
fcb86b7
Updating TC_ICDM_2_1 and matter_testing support module:
j-ororke Jan 22, 2025
969a87f
Merge remote-tracking branch 'upstream/master' into remove_PICS_from_…
j-ororke Jan 23, 2025
4618ff4
Updating TC_ICDM_2_1 test module:
j-ororke Jan 23, 2025
2a59997
Merge branch 'master' into remove_PICS_from_ICDM_tests
j-ororke Jan 23, 2025
0eb6b99
Restyled by autopep8
restyled-commits Jan 23, 2025
1b63d63
Restyled by isort
restyled-commits Jan 23, 2025
545232f
Updating TC_ICDM_2_1 test module:
j-ororke Jan 27, 2025
ddb3488
Merge branch 'master' into remove_PICS_from_ICDM_tests
j-ororke Feb 10, 2025
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
24 changes: 12 additions & 12 deletions src/python_testing/TC_ICDM_2_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ def pics_TC_ICDM_2_1(self) -> list[str]:

@async_test_body
async def test_TC_ICDM_2_1(self):
self.endpoint = self.get_endpoint()

cluster = Clusters.Objects.IcdManagement
attributes = cluster.Attributes
Expand All @@ -148,8 +149,7 @@ async def test_TC_ICDM_2_1(self):

# Validate ActiveModeThreshold
self.step(2)
if self.check_pics("ICDM.S.A0002"):

if await self.attribute_guard(endpoint=self.endpoint, attribute=attributes.ActiveModeThreshold):
activeModeThreshold = await self._read_icdm_attribute_expect_success(
attributes.ActiveModeThreshold)
# Verify ActiveModeThreshold is not bigger than uint16
Expand All @@ -166,7 +166,7 @@ async def test_TC_ICDM_2_1(self):

# Validate ActiveModeDuration
self.step(3)
if self.check_pics("ICDM.S.A0001"):
if await self.attribute_guard(endpoint=self.endpoint, attribute=attributes.ActiveModeDuration):
activeModeDuration = await self._read_icdm_attribute_expect_success(
attributes.ActiveModeDuration)
# Verify ActiveModeDuration is not bigger than uint32
Expand All @@ -178,7 +178,7 @@ async def test_TC_ICDM_2_1(self):

# Validate IdleModeDuration
self.step(4)
if self.check_pics("ICDM.S.A0000"):
if await self.attribute_guard(endpoint=self.endpoint, attribute=attributes.IdleModeDuration):
idleModeDuration = await self._read_icdm_attribute_expect_success(
attributes.IdleModeDuration)
# Verify IdleModeDuration is not bigger than uint32
Expand All @@ -194,7 +194,7 @@ async def test_TC_ICDM_2_1(self):

# Validate ClientsSupportedPerFabric
self.step(5)
if self.pics_guard(self.check_pics("ICDM.S.A0005")):
if await self.attribute_guard(endpoint=self.endpoint, attribute=attributes.ClientsSupportedPerFabric):
Copy link
Contributor

Choose a reason for hiding this comment

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

thinking it makes more sense to have this be a non-async function. See _async_runner for the wrapper on how to do that. I don't think you're ever going to want this to be truly async

Copy link
Contributor Author

@j-ororke j-ororke Jan 22, 2025

Choose a reason for hiding this comment

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

It does seem that it makes more sense for it to be non-async, always best to keep things as simple as possible.
Updated using _async_runner as an example, created async_function_runner function in matter_testing support module, this should allow us to call the functions such as attribute_guard inside of tests without having to use await moving forward, instead uses the asyncio.wait_for() and asyncio.run() as needed such as displayed in _async_runner.
Please let me know if this will be ok.

clientsSupportedPerFabric = await self._read_icdm_attribute_expect_success(
attributes.ClientsSupportedPerFabric)

Expand All @@ -207,7 +207,7 @@ async def test_TC_ICDM_2_1(self):

# Validate RegisteredClients
self.step(6)
if self.pics_guard(self.check_pics("ICDM.S.A0003")):
if await self.attribute_guard(endpoint=self.endpoint, attribute=attributes.RegisteredClients):
registeredClients = await self._read_icdm_attribute_expect_success(
attributes.RegisteredClients)

Expand All @@ -216,8 +216,7 @@ async def test_TC_ICDM_2_1(self):

# Validate ICDCounter
self.step(7)
if self.pics_guard(self.check_pics("ICDM.S.A0004")):

if await self.attribute_guard(endpoint=self.endpoint, attribute=attributes.ICDCounter):
icdCounter = await self._read_icdm_attribute_expect_success(
attributes.ICDCounter)
# Verify ICDCounter is not bigger than uint32
Expand All @@ -226,7 +225,7 @@ async def test_TC_ICDM_2_1(self):

# Validate UserActiveModeTriggerHint
self.step(8)
if self.pics_guard(self.check_pics("ICDM.S.A0006")):
if await self.attribute_guard(endpoint=self.endpoint, attribute=attributes.UserActiveModeTriggerHint):
userActiveModeTriggerHint = await self._read_icdm_attribute_expect_success(
attributes.UserActiveModeTriggerHint)

Expand All @@ -243,7 +242,7 @@ async def test_TC_ICDM_2_1(self):

# Valdate UserActiveModeTriggerInstruction
self.step(9)
if self.check_pics("ICDM.S.A0007"):
if await self.attribute_guard(endpoint=self.endpoint, attribute=attributes.UserActiveModeTriggerInstruction):
userActiveModeTriggerInstruction = await self._read_icdm_attribute_expect_success(
attributes.UserActiveModeTriggerInstruction)

Expand Down Expand Up @@ -275,7 +274,7 @@ async def test_TC_ICDM_2_1(self):

# Verify OperatingMode
self.step(10)
if self.pics_guard(self.check_pics("ICDM.S.A0008")):
if await self.attribute_guard(endpoint=self.endpoint, attribute=attributes.OperatingMode):
operatingMode = await self._read_icdm_attribute_expect_success(
attributes.OperatingMode)

Expand All @@ -284,8 +283,9 @@ async def test_TC_ICDM_2_1(self):

asserts.assert_less(
operatingMode, modes.kUnknownEnumValue, "OperatingMode can only have 0 and 1 as valid values")

self.step(11)
if self.pics_guard(self.check_pics("ICDM.S.A0009")):
if await self.attribute_guard(endpoint=self.endpoint, attribute=attributes.MaximumCheckInBackOff):
maximumCheckInBackOff = await self._read_icdm_attribute_expect_success(attributes.MaximumCheckInBackOff)

asserts.assert_true(self.is_valid_uint32_value(maximumCheckInBackOff),
Expand Down
2 changes: 1 addition & 1 deletion src/python_testing/test_testing/test_TC_ICDM_2_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def test_spec_to_attribute_cache(test_icdm: ICDMData) -> Attribute.AsyncReadTran
resp.attributes = {0: {c: {attr.FeatureMap: test_icdm.FeatureMap, attr.IdleModeDuration: test_icdm.IdleModeDuration, attr.ActiveModeDuration: test_icdm.ActiveModeDuration, attr.ActiveModeThreshold: test_icdm.ActiveModeThreshold,
attr.RegisteredClients: test_icdm.RegisteredClients, attr.ICDCounter: test_icdm.ICDCounter,
attr.ClientsSupportedPerFabric: test_icdm.ClientsSupportedPerFabric, attr.UserActiveModeTriggerHint: test_icdm.UserActiveModeTriggerHint,
attr.UserActiveModeTriggerInstruction: test_icdm.UserActiveModeTriggerInstruction, attr.OperatingMode: test_icdm.OperatingMode, attr.MaximumCheckInBackOff: test_icdm.MaximumCheckInBackOff}}}
attr.UserActiveModeTriggerInstruction: test_icdm.UserActiveModeTriggerInstruction, attr.OperatingMode: test_icdm.OperatingMode, attr.MaximumCheckInBackOff: test_icdm.MaximumCheckInBackOff, attr.AttributeList: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 65528, 65529, 65531, 65532, 65533]}}}
return resp


Expand Down
Loading