8.1.3. CLI Integration

You can utilize the following high-level functions to set up testers, modules, and ports by employing CLI commands from command strings or files.


8.1.3.1. Configure from String

async tester_config_from_string(tester, long_str, comment_start=(';', '#', '//'))

Send tester configuration from a string. The CLI commands must all start with C_ prefix.

Parameters:
  • tester (GenericAnyTester) – the tester object

  • long_str (str) – the string containing the CLI commands

  • comment_start (tuple[str, ...], optional) – symbol used to start a comment, defaults to (“;”, “#”, “//”)

async module_config_from_string(module, long_str, comment_start=(';', '#', '//'))

Send module configuration from a string. The CLI commands must all start with M_ prefix.

Parameters:
  • module (GenericAnyModule) – the module object

  • long_str (str) – the string containing the CLI commands

  • comment_start (tuple[str, ...], optional) – symbol used to start a comment, defaults to (“;”, “#”, “//”)

async port_config_from_string(port, long_str, comment_start=(';', '#', '//'))

Send port configuration from a string. The CLI commands must all start with P_ prefix.

Parameters:
  • port (GenericAnyPort) – the port object

  • long_str (str) – the string containing the CLI commands

  • comment_start (tuple[str, ...], optional) – symbol used to start a comment, defaults to (“;”, “#”, “//”)

8.1.3.2. Configure from File

async tester_config_from_file(tester, path, comment_start=(';', '#', '//'))

Send tester configuration from a configuration file. The CLI commands must all start with C_ prefix.

Parameters:
  • tester (GenericAnyTester) – the tester object

  • path (str) – the path to the configuration file

  • comment_start (tuple[str, ...], optional) – symbol used to start a comment, defaults to (“;”, “#”, “//”)

async module_config_from_file(module, path, comment_start=(';', '#', '//'))

Send module configuration from a configuration file. The CLI commands must all start with M_ prefix.

Parameters:
  • module (GenericAnyModule) – the module object

  • path (str) – the path to the configuration file

  • comment_start (tuple[str, ...], optional) – symbol used to start a comment, defaults to (“;”, “#”, “//”)

async port_config_from_file(port, path, comment_start=(';', '#', '//'))

Send port configuration from a port configuration file (.xpc file).

Parameters:
  • port (GenericAnyPort) – the port object

  • path (str) – the path to the configuration file

  • comment_start (tuple[str, ...], optional) – symbol used to start a comment, defaults to (“;”, “#”, “//”)