Skip to content

Commit 9f262a3

Browse files
Step2 progress
1 parent 0251902 commit 9f262a3

File tree

1 file changed

+23
-9
lines changed

1 file changed

+23
-9
lines changed

src/python_testing/TC_IDM_4_3.py

+23-9
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,14 @@ async def all_type_attributes_for_cluster(self, cluster: ClusterObjects.Cluster,
183183

184184
async def check_attribute_read_for_type(self, attribute_type: type, return_objects: bool = False) -> None:
185185
# Get all clusters from device
186+
self.fprint(f"self.device_clusters: {self.device_clusters}", "red", 2)
186187
for cluster in self.device_clusters:
188+
189+
# TEMPORARY: if cluster is SmokeCoAlarm skip, as it returns INVALID_ACTION when trying
190+
# to subscribe to its TestInProgress attribute
191+
# if cluster.id == 92:
192+
# continue
193+
187194
all_types = await self.all_type_attributes_for_cluster(cluster, attribute_type)
188195
self.fprint(f"all_types: {all_types}", "green", 2)
189196

@@ -231,9 +238,9 @@ async def test_TC_IDM_4_3(self):
231238
await self.setup_class_helper(default_to_pase=False)
232239

233240
# all_clusters = [cluster for cluster in Clusters.ClusterObjects.ALL_ATTRIBUTES]
234-
# server_list_attr = Clusters.Objects.Descriptor.Attributes.ServerList
235-
# attribute_list = Clusters.Objects.Descriptor.Attributes.AttributeList
236-
# descriptor_obj = Clusters.Objects.Descriptor
241+
# server_list_attr = Clusters.Descriptor.Attributes.ServerList
242+
# attribute_list = Clusters.Descriptor.Attributes.AttributeList
243+
# descriptor_obj = Clusters.Descriptor
237244
# server_list_attr_path = [(0, server_list_attr)]
238245
# descriptor_obj_path = [(0, descriptor_obj)]
239246
# attribute_list_path = [0, attribute_list]
@@ -252,7 +259,7 @@ async def test_TC_IDM_4_3(self):
252259

253260
# Test setup
254261
# Mandatory writable attributes
255-
node_label_attr = Clusters.Objects.BasicInformation.Attributes.NodeLabel
262+
node_label_attr = Clusters.BasicInformation.Attributes.NodeLabel
256263

257264
# bc = Clusters.GeneralCommissioning.Attributes.Breadcrumb
258265
# Event
@@ -363,7 +370,8 @@ async def test_TC_IDM_4_3(self):
363370
nodeid=self.dut_node_id,
364371
attributes=node_label_attr_path,
365372
reportInterval=(self.min_interval_floor_sec, self.max_interval_ceiling_sec),
366-
keepSubscriptions=False
373+
keepSubscriptions=False,
374+
fabricFiltered=False
367375
)
368376

369377
# Record time after subscription
@@ -375,7 +383,7 @@ async def test_TC_IDM_4_3(self):
375383
# Records the time the first empty report after subscription arrives
376384
sub_th_step1.SetNotifySubscriptionStillActiveCallback(self.on_notify_subscription_still_active_empty_report)
377385

378-
# Waint for empty report data
386+
# Wait for empty report data
379387
wait_increments = self.min_interval_floor_sec / 10
380388
while not self.report_data_received:
381389
time.sleep(wait_increments)
@@ -418,18 +426,24 @@ async def test_TC_IDM_4_3(self):
418426
attr_path = [(self.root_node_endpoint, attribute)]
419427

420428
# Subscribe to attribute
429+
self.fprint(f"Will sub TO: {attr_path}", "black", 7)
430+
logging.info(f"Attribute of type 'bool' was found")
421431
sub_th_step2: SubscriptionTransaction = await TH.ReadAttribute(
422432
nodeid=self.dut_node_id,
423433
attributes=attr_path,
424434
reportInterval=(self.min_interval_floor_sec, self.max_interval_ceiling_sec),
425-
keepSubscriptions=False
435+
keepSubscriptions=False,
436+
fabricFiltered=False
426437
)
427438

428-
self.fprint(f"sub_th_step2: {sub_th_step2.subscriptionId}", "yellow", 3)
439+
# Verify the subscription was successfully activated and a priming
440+
# data report was sent
441+
asserts.assert_is_not_none(sub_th_step2.subscriptionId, "Subscription activation to attribute of type 'bool' was unsuccessful")
442+
logging.info("Subscription activation to attribute of type 'bool' successful")
429443

430444
sub_th_step2.Shutdown()
431445
else:
432-
logging.info("No attribute of type bool was found, skipping step")
446+
logging.info("No attribute of type 'bool' was found, skipping step")
433447

434448

435449
if __name__ == "__main__":

0 commit comments

Comments
 (0)