@@ -61,10 +61,20 @@ class TC_MCORE_FS_1_5(MatterBaseTest):
61
61
@async_test_body
62
62
async def setup_class (self ):
63
63
super ().setup_class ()
64
+ self ._partslist_subscription = None
65
+ self ._cadmin_subscription = None
64
66
self ._app_th_server_process = None
65
67
self ._th_server_kvs = None
66
68
67
69
def teardown_class (self ):
70
+ if self ._partslist_subscription is not None :
71
+ self ._partslist_subscription .Shutdown ()
72
+ self ._partslist_subscription = None
73
+
74
+ if self ._cadmin_subscription is not None :
75
+ self ._cadmin_subscription .Shutdown ()
76
+ self ._cadmin_subscription = None
77
+
68
78
if self ._app_th_server_process is not None :
69
79
logging .warning ("Stopping app with SIGTERM" )
70
80
self ._app_th_server_process .send_signal (signal .SIGTERM .value )
@@ -142,7 +152,7 @@ async def test_TC_MCORE_FS_1_5(self):
142
152
parts_list_subscription_contents = [
143
153
(root_endpoint , Clusters .Descriptor .Attributes .PartsList )
144
154
]
145
- parts_list_sub = await self .default_controller .ReadAttribute (
155
+ self . _partslist_subscription = await self .default_controller .ReadAttribute (
146
156
nodeid = self .dut_node_id ,
147
157
attributes = parts_list_subscription_contents ,
148
158
reportInterval = (min_report_interval_sec , max_report_interval_sec ),
@@ -152,8 +162,8 @@ async def test_TC_MCORE_FS_1_5(self):
152
162
parts_list_queue = queue .Queue ()
153
163
parts_list_attribute_handler = AttributeChangeAccumulator (
154
164
name = self .default_controller .name , expected_attribute = Clusters .Descriptor .Attributes .PartsList , output = parts_list_queue )
155
- parts_list_sub .SetAttributeUpdateCallback (parts_list_attribute_handler )
156
- parts_list_cached_attributes = parts_list_sub .GetAttributes ()
165
+ self . _partslist_subscription .SetAttributeUpdateCallback (parts_list_attribute_handler )
166
+ parts_list_cached_attributes = self . _partslist_subscription .GetAttributes ()
157
167
step_1_dut_parts_list = parts_list_cached_attributes [root_endpoint ][Clusters .Descriptor ][Clusters .Descriptor .Attributes .PartsList ]
158
168
159
169
asserts .assert_true (type_matches (step_1_dut_parts_list , list ), "PartsList is expected to be a list" )
@@ -219,7 +229,7 @@ async def test_TC_MCORE_FS_1_5(self):
219
229
cadmin_subscription_contents = [
220
230
(newly_added_endpoint , Clusters .AdministratorCommissioning )
221
231
]
222
- cadmin_sub = await self .default_controller .ReadAttribute (
232
+ self . _cadmin_subscription = await self .default_controller .ReadAttribute (
223
233
nodeid = self .dut_node_id ,
224
234
attributes = cadmin_subscription_contents ,
225
235
reportInterval = (min_report_interval_sec , max_report_interval_sec ),
@@ -230,7 +240,7 @@ async def test_TC_MCORE_FS_1_5(self):
230
240
# This AttributeChangeAccumulator is really just to let us know when new subscription came in
231
241
cadmin_attribute_handler = AttributeChangeAccumulator (
232
242
name = self .default_controller .name , expected_attribute = Clusters .AdministratorCommissioning .Attributes .WindowStatus , output = cadmin_queue )
233
- cadmin_sub .SetAttributeUpdateCallback (cadmin_attribute_handler )
243
+ self . _cadmin_subscription .SetAttributeUpdateCallback (cadmin_attribute_handler )
234
244
time .sleep (1 )
235
245
236
246
self .step (7 )
0 commit comments