@@ -188,13 +188,16 @@ async def test_TC_CCTRL_3_1(self):
188
188
189
189
#self.step(15)
190
190
cmd = Clusters .CommissionerControl .Commands .CommissionNode (requestId = good_request_id , responseTimeoutSeconds = 30 )
191
- resp = await self .send_single_cmd (cmd )
191
+ resp : Clusters . CommissionerControl . Commands . ReverseOpenCommissioningWindow = await self .send_single_cmd (cmd )
192
192
asserts .assert_equal (type (resp ), Clusters .CommissionerControl .Commands .ReverseOpenCommissioningWindow , "Incorrect response type" )
193
193
194
194
#self.step(16)
195
- #TODO: we do not have a direct line to OpenEnhancedCommissioningWindow. Need to add plumbing
196
- # For now, open with anything so the below command is ok
197
- await self .openCommissioningWindow (dev_ctrl = self .TH_server_controller , node_id = self .server_nodeid )
195
+ # min commissioning timeout is 3*60 seconds, so use that even though the command said 30.
196
+ cmd = Clusters .AdministratorCommissioning .Commands .OpenCommissioningWindow (commissioningTimeout = 3 * 60 ,
197
+ PAKEPasscodeVerifier = resp .PAKEPasscodeVerifier ,
198
+ discriminator = resp .discriminator ,
199
+ iterations = resp .iterations , salt = resp .salt )
200
+ await self .send_single_cmd (cmd , dev_ctrl = self .TH_server_controller , node_id = self .server_nodeid , endpoint = 0 , timedRequestTimeoutMs = 5000 )
198
201
199
202
#self.step(17)
200
203
logging .info ("Test now waits for 30 seconds" )
@@ -210,9 +213,10 @@ async def test_TC_CCTRL_3_1(self):
210
213
await self .send_single_cmd (cmd , dev_ctrl = self .TH_server_controller , node_id = self .server_nodeid , timedRequestTimeoutMs = 5000 , endpoint = 0 )
211
214
212
215
#self.step(20)
216
+ print ('step 20' )
213
217
good_request_id = 0x1234567812345678
214
218
cmd = Clusters .CommissionerControl .Commands .RequestCommissioningApproval (requestId = good_request_id , vendorId = th_server_vid , productId = th_server_pid , label = "Test Ecosystem" )
215
- self .send_single_cmd (cmd )
219
+ await self .send_single_cmd (cmd )
216
220
217
221
#self.step(21)
218
222
if not self .is_ci :
@@ -227,6 +231,28 @@ async def test_TC_CCTRL_3_1(self):
227
231
asserts .assert_equal (new_event [0 ].Data .clientNodeId , self .matter_test_config .controller_node_id , "Unexpected client node id" )
228
232
asserts .assert_equal (new_event [0 ].Data .requestId , good_request_id , "Unexpected request ID" )
229
233
234
+ #self.step(23)
235
+ cmd = Clusters .CommissionerControl .Commands .CommissionNode (requestId = good_request_id , responseTimeoutSeconds = 30 )
236
+ resp = await self .send_single_cmd (cmd )
237
+ asserts .assert_equal (type (resp ), Clusters .CommissionerControl .Commands .ReverseOpenCommissioningWindow , "Incorrect response type" )
238
+
239
+ #self.step(24)
240
+ # min commissioning timeout is 3*60 seconds, so use that even though the command said 30.
241
+ cmd = Clusters .AdministratorCommissioning .Commands .OpenCommissioningWindow (commissioningTimeout = 3 * 60 ,
242
+ PAKEPasscodeVerifier = resp .PAKEPasscodeVerifier ,
243
+ discriminator = resp .discriminator ,
244
+ iterations = resp .iterations , salt = resp .salt )
245
+ await self .send_single_cmd (cmd , dev_ctrl = self .TH_server_controller , node_id = self .server_nodeid , endpoint = 0 , timedRequestTimeoutMs = 5000 )
246
+
247
+ #self.step(25)
248
+ if not self .is_ci :
249
+ time .sleep (30 )
250
+
251
+ th_server_fabrics_new = await self .read_single_attribute_check_success (cluster = Clusters .OperationalCredentials , attribute = Clusters .OperationalCredentials .Attributes .Fabrics , dev_ctrl = self .TH_server_controller , node_id = self .server_nodeid , endpoint = 0 )
252
+ #TODO: this should be mocked too.
253
+ if not self .is_ci :
254
+ asserts .assert_equal (len (th_server_fabrics ) + 1 , len (th_server_fabrics_new ), "Unexpected number of fabrics on TH_SERVER" )
255
+
230
256
231
257
232
258
if __name__ == "__main__" :
0 commit comments