config_io module

The config_io module offers high-level functions to save and load Xena Port Configuration files (.xpc) and Xena Test Case Configuration files (.xtc2).

save_port_config(tester, port, path[, ...])

Save port config to the specified filepath

load_port_config(tester, port, path[, ...])

Load port config from the specified filepath

port_config_from_file(tester, port, path[, ...])

Load port configuration from the specifiied filepath.

save_testbed_config(tester, ports, path[, ...])

Save testbed configuration to the specifiied filepath

load_testbed_config(tester, path[, mode, ...])

Load testbed configuration from the specifiied filepath

module_config_from_file(tester, path[, ...])

Load module configuration from the specifiied filepath.

Module Contents

The cli high-level function module.

async save_port_config(tester, port, path, debug=False, halt_on_error=False)[source]

Save port config to the specified filepath

Parameters:
  • tester (testers.L23Tester) – Chassis object

  • port (ports.GenericL23Port) – Port object to save configuration from

  • save_path (str) – File path to save the port configuration

Returns:

Port configuration string

Return type:

str

async load_port_config(tester, port, path, debug=False, halt_on_error=False)[source]

Load port config from the specified filepath

Parameters:
  • tester (testers.L23Tester) – Chassis object

  • port (ports.GenericL23Port) – Port object to load configuration to

  • load_path (str) – File path to load the port configuration from

Returns:

List of tuples containing response and the corresponding command sent

Return type:

List[Tuple[str, str]]

async port_config_from_file(tester, port, path, debug=False, halt_on_error=False)[source]

Load port configuration from the specifiied filepath. This function is a wrapper around load_port_config to provide backward compatibility.

Parameters:
  • tester (testers.L23Tester) – Chassis object

  • port (ports.GenericL23Port) – Port object to load configuration to

  • load_path (str) – File path to load the port configuration from

Returns:

List of tuples containing response and command sent

Return type:

List[Tuple[str, str]]

async save_testbed_config(tester, ports, path, testbed_name='<testbed>', with_module_config=True, debug=False, halt_on_error=False)[source]

Save testbed configuration to the specifiied filepath

Parameters:
  • tester (testers.L23Tester) – Chassis object

  • ports (List[ports.GenericL23Port]) – List of port objects to save configuration from

  • path (str) – File path to save the test case configuration

  • testbed_name (str) – Name of the testbed

  • with_module_config (bool) – Whether to include module configuration in the saved test case configuration

Returns:

Test case configuration string

Return type:

str

async load_testbed_config(tester, path, mode='default', delay_after_module_config=5, debug=False, halt_on_error=False)[source]

Load testbed configuration from the specifiied filepath

Parameters:
  • tester (testers.L23Tester) – Chassis object

  • path (str) – File path to load the module configuration from

  • mode (str) – Load mode, “default | port | module”. “default” loads both module and port configurations, “port” loads only port configurations, “module” loads only module configurations.

  • delay_after_module_config (int) – Delay in seconds after configuring each module to ensure proper configuration

Returns:

List of tuples containing response and the corresponding command sent

Return type:

List[Tuple[str, str]]

async module_config_from_file(tester, path, debug=False, halt_on_error=False)[source]

Load module configuration from the specifiied filepath. This function is a wrapper around load_module_config to provide backward compatibility.

Parameters:
  • tester (testers.L23Tester) – Chassis object

  • path (str) – File path to load the module configuration from