Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6a3853ae authored by Chienyuan's avatar Chienyuan
Browse files

GD: Make controller properties configurable by cert test

Tag: #refactor
Bug: 197316394
Test: gd/cert/run
BYPASS_LONG_LINES_REASON: Bluetooth likes 120 lines

Change-Id: Iec9503bfa3ff16485fc5658fb8ee207abd962b62
parent cfa6f139
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -59,12 +59,18 @@ class GdBaseTestClass(BaseTestClass):
        for config in self.controller_configs[CONTROLLER_CONFIG_NAME]:
            config['verbose_mode'] = self.verbose_mode

        try:
            controller_properties_file = self.controller_properties_file
        except AttributeError:
            controller_properties_file = ''

        self.info = setup_rootcanal(
            dut_module=self.dut_module,
            cert_module=self.cert_module,
            verbose_mode=self.verbose_mode,
            log_path_base=self.log_path_base,
            controller_configs=self.controller_configs)
            controller_configs=self.controller_configs,
            controller_properties_file=controller_properties_file)
        self.rootcanal_running = self.info['rootcanal_running']
        self.rootcanal_logpath = self.info['rootcanal_logpath']
        self.rootcanal_process = self.info['rootcanal_process']
+12 −2
Original line number Diff line number Diff line
@@ -27,7 +27,12 @@ from cert.os_utils import make_ports_available
from cert.os_utils import TerminalColor


def setup_rootcanal(dut_module, cert_module, verbose_mode, log_path_base, controller_configs):
def setup_rootcanal(dut_module,
                    cert_module,
                    verbose_mode,
                    log_path_base,
                    controller_configs,
                    controller_properties_file=''):
    info = {}
    info['dut_module'] = dut_module
    info['cert_module'] = cert_module
@@ -62,7 +67,12 @@ def setup_rootcanal(dut_module, cert_module, verbose_mode, log_path_base, contro
            return info

        # Start root canal process
        rootcanal_cmd = [rootcanal, str(rootcanal_test_port), str(rootcanal_hci_port), str(rootcanal_link_layer_port)]
        rootcanal_cmd = [
            rootcanal,
            str(rootcanal_test_port),
            str(rootcanal_hci_port),
            str(rootcanal_link_layer_port), '-controller_properties_file=' + controller_properties_file
        ]
        info['rootcanal_cmd'] = rootcanal_cmd

        rootcanal_process = subprocess.Popen(