@@ -41,8 +41,8 @@ def FindAndEstablishPase(self, longDiscriminator: int, setupPinCode: int, nodeid
41
41
Discovery .FilterType .LONG_DISCRIMINATOR and d .longDiscriminator == longDiscriminator , devices ))
42
42
for a in device .addresses :
43
43
try :
44
- dev_ctrl .EstablishPASESessionIP (ipaddr = a , setupPinCode = setupPinCode ,
45
- nodeid = nodeid , port = device .port )
44
+ await dev_ctrl .EstablishPASESessionIP (ipaddr = a , setupPinCode = setupPinCode ,
45
+ nodeid = nodeid , port = device .port )
46
46
break
47
47
except ChipStackError :
48
48
continue
@@ -51,11 +51,11 @@ def FindAndEstablishPase(self, longDiscriminator: int, setupPinCode: int, nodeid
51
51
except TimeoutError :
52
52
asserts .fail ("Unable to establish a PASE session to the device" )
53
53
54
- def OpenCommissioningWindow (self , dev_ctrl : ChipDeviceCtrl , node_id : int ):
54
+ async def OpenCommissioningWindow (self , dev_ctrl : ChipDeviceCtrl , node_id : int ):
55
55
# TODO: abstract this in the base layer? Do we do this a lot?
56
56
longDiscriminator = random .randint (0 , 4095 )
57
57
try :
58
- params = dev_ctrl .OpenCommissioningWindow (
58
+ params = await dev_ctrl .OpenCommissioningWindow (
59
59
nodeid = node_id , timeout = 600 , iteration = 10000 , discriminator = longDiscriminator , option = ChipDeviceCtrl .ChipDeviceControllerBase .CommissioningWindowPasscode .kTokenWithRandomPin )
60
60
except Exception as e :
61
61
logging .exception ('Error running OpenCommissioningWindow %s' , e )
@@ -85,7 +85,7 @@ async def test_TC_OPCREDS_3_1(self):
85
85
"Device fabric table is full - please remove one fabric and retry" )
86
86
87
87
self .print_step (1 , "TH0 opens a commissioning window on the DUT" )
88
- longDiscriminator , params = self .OpenCommissioningWindow (self .default_controller , self .dut_node_id )
88
+ longDiscriminator , params = await self .OpenCommissioningWindow (self .default_controller , self .dut_node_id )
89
89
90
90
self .print_step (
91
91
2 , "TH0 reads the BasicCommissioningInfo field from the General commissioning cluster saves MaxCumulativeFailsafeSeconds as `failsafe_max`" )
@@ -109,7 +109,7 @@ async def test_TC_OPCREDS_3_1(self):
109
109
self .print_step (6 , "TH1 obtains or generates the NOC, the Root CA Certificate and ICAC using csrResponse and selects an IPK. The certificates shall have their subjects padded with additional data such that they are each the maximum certificate size of 400 bytes when encoded in the MatterCertificateEncoding." )
110
110
# Our CA is set up to maximize cert chains already
111
111
# Extract the RCAC public key and save as `Root_Public_Key_TH1`
112
- TH1_certs_real = TH1 .IssueNOCChain (csrResponse , newNodeId )
112
+ TH1_certs_real = await TH1 .IssueNOCChain (csrResponse , newNodeId )
113
113
if (TH1_certs_real .rcacBytes is None or
114
114
TH1_certs_real .icacBytes is None or
115
115
TH1_certs_real .nocBytes is None or TH1_certs_real .ipkBytes is None ):
@@ -125,7 +125,7 @@ async def test_TC_OPCREDS_3_1(self):
125
125
TH1_CA_fake = self .certificate_authority_manager .NewCertificateAuthority ()
126
126
TH1_fabric_admin_fake = TH1_CA_fake .NewFabricAdmin (vendorId = 0xFFF1 , fabricId = 2 )
127
127
TH1_fake = TH1_fabric_admin_fake .NewController (nodeId = self .default_controller .nodeId )
128
- TH1_certs_fake = TH1_fake .IssueNOCChain (csrResponse , newNodeId )
128
+ TH1_certs_fake = await TH1_fake .IssueNOCChain (csrResponse , newNodeId )
129
129
if (TH1_certs_fake .rcacBytes is None or
130
130
TH1_certs_fake .icacBytes is None or
131
131
TH1_certs_fake .nocBytes is None or TH1_certs_real .ipkBytes is None ):
@@ -361,7 +361,7 @@ async def test_TC_OPCREDS_3_1(self):
361
361
asserts .assert_equal (len (fabrics ), fabrics_original_size , "Fabric list size does not match original" )
362
362
363
363
self .print_step (37 , "TH1 fully commissions DUT onto the fabric using a set of valid certificates" )
364
- TH1 .Commission (newNodeId )
364
+ await TH1 .Commission (newNodeId )
365
365
366
366
self .print_step (
367
367
38 , "TH1 reads the TrustedRootCertificates list from DUT and verify that there are trusted_root_original_size + 1 entries" )
@@ -404,7 +404,7 @@ async def test_TC_OPCREDS_3_1(self):
404
404
resp .statusCode , opcreds .Enums .NodeOperationalCertStatusEnum .kOk , "Failure on UpdateFabricLabel" )
405
405
406
406
self .print_step (44 , "TH1 sends an OpenCommissioningWindow command to the Administrator Commissioning cluster" )
407
- longDiscriminator , params = self .OpenCommissioningWindow (TH1 , newNodeId )
407
+ longDiscriminator , params = await self .OpenCommissioningWindow (TH1 , newNodeId )
408
408
409
409
self .print_step (45 , "TH2 commissions the DUT" )
410
410
TH2_CA = self .certificate_authority_manager .NewCertificateAuthority (maximizeCertChains = True )
@@ -413,7 +413,7 @@ async def test_TC_OPCREDS_3_1(self):
413
413
TH2_nodeid = self .default_controller .nodeId + 2
414
414
TH2 = TH2_fabric_admin .NewController (nodeId = TH2_nodeid )
415
415
TH2_dut_nodeid = self .dut_node_id + 2
416
- TH2 .CommissionOnNetwork (
416
+ await TH2 .CommissionOnNetwork (
417
417
nodeId = TH2_dut_nodeid , setupPinCode = params .setupPinCode ,
418
418
filterType = ChipDeviceCtrl .DiscoveryFilterType .LONG_DISCRIMINATOR , filter = longDiscriminator )
419
419
@@ -484,7 +484,7 @@ async def test_TC_OPCREDS_3_1(self):
484
484
temp_CA = self .certificate_authority_manager .NewCertificateAuthority ()
485
485
temp_fabric_admin = temp_CA .NewFabricAdmin (vendorId = 0xFFF1 , fabricId = 3 )
486
486
temp_controller = temp_fabric_admin .NewController (nodeId = self .default_controller .nodeId )
487
- temp_certs = temp_controller .IssueNOCChain (csrResponse , newNodeId )
487
+ temp_certs = await temp_controller .IssueNOCChain (csrResponse , newNodeId )
488
488
if (temp_certs .rcacBytes is None or
489
489
temp_certs .icacBytes is None or
490
490
temp_certs .nocBytes is None or temp_certs .ipkBytes is None ):
@@ -521,7 +521,7 @@ async def test_TC_OPCREDS_3_1(self):
521
521
522
522
self .print_step (61 , "TH1 obtains or generates a NOC and ICAC using the CSR elements from the previous step with a different NodeID, but the same Root CA Certificate and fabric ID as step <<TH1-gen-real-creds>>. Save as `Node_Operational_Certificates_TH1_fabric_conflict` and `Intermediate_Certificate_TH1_fabric_conflict`|" )
523
523
anotherNodeId = newNodeId + 1
524
- TH1_certs_fabric_conflict = TH1 .IssueNOCChain (csrResponse_new , anotherNodeId )
524
+ TH1_certs_fabric_conflict = await TH1 .IssueNOCChain (csrResponse_new , anotherNodeId )
525
525
if (TH1_certs_fabric_conflict .rcacBytes is None or
526
526
TH1_certs_fabric_conflict .icacBytes is None or
527
527
TH1_certs_fabric_conflict .nocBytes is None or TH1_certs_fabric_conflict .ipkBytes is None ):
@@ -565,7 +565,7 @@ async def test_TC_OPCREDS_3_1(self):
565
565
"Unexpected response type for UpdateNOC csr request" )
566
566
567
567
self .print_step (68 , "TH1 obtains or generates a NOC, Root CA Certificate, ICAC using the CSR elements from the previous step" )
568
- TH1_certs_3 = TH1 .IssueNOCChain (csrResponse , anotherNodeId )
568
+ TH1_certs_3 = await TH1 .IssueNOCChain (csrResponse , anotherNodeId )
569
569
if (TH1_certs_3 .rcacBytes is None or
570
570
TH1_certs_3 .icacBytes is None or
571
571
TH1_certs_3 .nocBytes is None or TH1_certs_3 .ipkBytes is None ):
0 commit comments