Skip to content

Commit

Permalink
Updating CertificateAuthority and TC_CreateNewController modules:
Browse files Browse the repository at this point in the history
- Updated to change arg names to using lower_snake_case for create_new_controller function.
  • Loading branch information
j-ororke committed Jan 20, 2025
1 parent ce75f81 commit ad93629
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/controller/python/chip/CertificateAuthority.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,20 +315,20 @@ def NewCertificateAuthority(self, caIndex: Optional[int] = None, maximizeCertCha

return ca

def create_new_controller(self, vendorid: int = 0xFFF1, fabricId: int = 1, new_fabric: bool = True, CaList: int = 0, nodeid: int = 2):
if new_fabric:
def create_new_controller(self, vendor_Id: int = 0xFFF1, fabric_Id: int = 1, new_Fabric: bool = True, ca_List: int = 0, node_Id: int = 2):
if new_Fabric:
"""
Create new fabric and controller for commissioning
"""
new_cert_auth = self.NewCertificateAuthority()
new_fabric_admin = new_cert_auth.NewFabricAdmin(vendorId=vendorid, fabricId=fabricId)
return new_fabric_admin.NewController(nodeId=nodeid)
new_fabric_admin = new_cert_auth.NewFabricAdmin(vendorId=vendor_Id, fabricId=fabric_Id)
return new_fabric_admin.NewController(nodeId=node_Id)

else:
"""
Create new controller on an already established fabric
"""
return self.activeCaList[CaList].adminList[0].NewController(nodeId=nodeid)
return self.activeCaList[ca_List].adminList[0].NewController(nodeId=node_Id)

def Shutdown(self):
''' Shuts down all active CertificateAuthority instances tracked by this manager, before shutting itself down.
Expand Down
4 changes: 2 additions & 2 deletions src/python_testing/TC_CreateNewController.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,13 @@ async def test_TC_CreateNewController(self):
self.th1 = self.default_controller

self.step(2)
self.th2 = self.certificate_authority_manager.create_new_controller(fabricId=self.th1.fabricId + 1, CaList=1, nodeid=2)
self.th2 = self.certificate_authority_manager.create_new_controller(fabric_Id=self.th1.fabricId + 1, ca_List=1, node_Id=2)

self.step(3)
self.th2.Shutdown()

self.step(4)
self.th3 = self.certificate_authority_manager.create_new_controller(CaList=0, new_fabric=False, nodeid=2)
self.th3 = self.certificate_authority_manager.create_new_controller(ca_List=0, new_Fabric=False, node_Id=2)

self.step(5)
self.th3.Shutdown()
Expand Down

0 comments on commit ad93629

Please sign in to comment.