Skip to content

Commit c5906ab

Browse files
committedDec 5, 2024
Updating matter_testing support module:
- Changed method for setup of self.global_wildcard from being under setup_class() to being established in setup_test() once commissioning was completed.
1 parent 06c7306 commit c5906ab

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed
 

‎src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py

+4-7
Original file line numberDiff line numberDiff line change
@@ -1120,10 +1120,6 @@ def setup_class(self):
11201120
self.current_step_index = 0
11211121
self.step_start_time = datetime.now(timezone.utc)
11221122
self.step_skipped = False
1123-
self.global_wildcard = asyncio.wait_for(self.default_controller.Read(self.dut_node_id, [(Clusters.Descriptor), Attribute.AttributePath(None, None, GlobalAttributeIds.ATTRIBUTE_LIST_ID), Attribute.AttributePath(
1124-
None, None, GlobalAttributeIds.FEATURE_MAP_ID), Attribute.AttributePath(None, None, GlobalAttributeIds.ACCEPTED_COMMAND_LIST_ID)]), timeout=60)
1125-
# self.stored_global_wildcard stores value of self.global_wildcard after first async call, appears needed in order to not timeout during commissioning
1126-
self.stored_global_wildcard = None
11271123

11281124
def setup_test(self):
11291125
self.current_step_index = 0
@@ -1139,6 +1135,9 @@ def setup_test(self):
11391135
desc = self.get_test_desc(test_name)
11401136
steps_descriptions = [] if steps is None else [step.description for step in steps]
11411137
self.runner_hook.test_start(filename=filename, name=desc, count=num_steps, steps=steps_descriptions)
1138+
self.global_wildcard = asyncio.run(self.default_controller.Read(self.dut_node_id, [(Clusters.Descriptor), Attribute.AttributePath(None, None, GlobalAttributeIds.ATTRIBUTE_LIST_ID), Attribute.AttributePath(
1139+
None, None, GlobalAttributeIds.FEATURE_MAP_ID), Attribute.AttributePath(None, None, GlobalAttributeIds.ACCEPTED_COMMAND_LIST_ID)]))
1140+
11421141
# If we don't have defined steps, we're going to start the one and only step now
11431142
# if there are steps defined by the test, rely on the test calling the step() function
11441143
# to indicates how it is proceeding
@@ -1468,9 +1467,7 @@ async def attribute_guard(self, endpoint: int, attribute: ClusterObjects.Cluster
14681467
if self.attribute_guard(condition2_needs_to_be_false_to_skip_step):
14691468
# skip step 2 if condition not met
14701469
"""
1471-
if self.stored_global_wildcard is None:
1472-
self.stored_global_wildcard = await self.global_wildcard
1473-
attr_condition = _has_attribute(wildcard=self.stored_global_wildcard, endpoint=endpoint, attribute=attribute)
1470+
attr_condition = _has_attribute(wildcard=self.global_wildcard, endpoint=endpoint, attribute=attribute)
14741471
if not attr_condition:
14751472
self.mark_current_step_skipped()
14761473
return attr_condition

0 commit comments

Comments
 (0)