Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating friendly functions for establishing new controllers on existing or new fabrics #37009

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Original file line number Diff line number Diff line change
Expand Up @@ -1681,6 +1681,23 @@ def wait_for_user_input(self,
logging.info("========= EOF on STDIN =========")
return None

def create_new_controller_on_new_fabric(self, nodeid: int = 2, vendorid: bytes = 0xFFF1, fabricid: int = 1):
andy31415 marked this conversation as resolved.
Show resolved Hide resolved
"""
Create new fabric and controller for commissioning
"""
new_cert_auth = self.certificate_authority_manager.NewCertificateAuthority()
new_fabric_admin = new_cert_auth.NewFabricAdmin(vendorId=vendorid, fabricId=fabricid)
new_controller = new_fabric_admin.NewController(nodeId=nodeid)
return new_controller

def create_new_controller_on_existing_fabric(self, nodeid: int = 2):
andy31415 marked this conversation as resolved.
Show resolved Hide resolved
"""
Create new controller on an already established fabric
"""
current_fabric_admin = self.certificate_authority_manager.activeCaList[0].adminList[0]
andy31415 marked this conversation as resolved.
Show resolved Hide resolved
new_controller = current_fabric_admin.NewController(nodeId=nodeid)
return new_controller


def generate_mobly_test_config(matter_test_config: MatterTestConfig):
test_run_config = TestRunConfig()
Expand Down
Loading