8.1.1. Resource Management

The following high-level functions handle test resource management, e.g. connection, port reservation, and port reset.


High-Level Tester Functions

async reserve_tester(tester, force=True)[source]

Reserve a tester regardless whether it is owned by others or not.

Parameters:
  • tester (GenericAnyTester) – The tester to reserve

  • force (boolean) – Should force reserve the tester

Returns:

Return type:

None

async release_tester(tester, should_release_modules_ports=False)[source]

Free a tester. If the tester is reserved by you, release the tester. If the tester is reserved by others, relinquish the tester. The tester should have no owner afterwards.

Parameters:
  • tester (GenericAnyTester) – The tester to free

  • should_release_modules_ports (bool, optional) – should modules and ports also be freed, defaults to False

Returns:

Return type:

None

async get_chassis_sys_uptime_sec(tester)[source]

Get chassis system uptime in seconds

Parameters:

tester (L23Tester) – The tester to free

Returns:

Chassis system uptime in seconds

Return type:

int

High-Level Module Functions

async reserve_module(module, force=True)[source]

Reserve a module regardless whether it is owned by others or not.

Parameters:
  • module (GenericAnyModule) – The module to reserve

  • force (boolean) – Should force reserve the module, defaults to True

Returns:

Return type:

None

async release_module(module, should_release_ports=False)[source]

Free a module. If the module is reserved by you, release the module. If the module is reserved by others, relinquish the module. The module should have no owner afterwards.

Parameters:
  • module (GenericAnyModule) – The module to free

  • should_release_ports (bool, optional) – should ports also be freed, defaults to False

Returns:

Return type:

None

get_module(tester, module_id)[source]

Get a module object of the tester.

Parameters:
  • tester (GenericAnyTester) – The tester object

  • module_id (int) – the index id of the module

Raises:

NoSuchModuleError – No such a module index on the tester

Returns:

module object

Return type:

GenericAnyModule

get_modules(tester)[source]

Get all modules of the tester

Parameters:

tester (GenericAnyTester) – The tester object

Returns:

List of module objects

Return type:

tuple[GenericAnyModule]

get_module_supported_media(module)[source]

Get a list of supported media, port speed and count of the module.

Parameters:

module (GenericAnyModule) – The module object

Returns:

List of supported media, port speed and count

Return type:

list[dict[str, t.Any]]

async set_module_media_config(module, media, force=True)[source]

Set module’s media configuration.

Parameters:
  • module (GenericAnyModule) – The module object

  • media (enums.MediaConfigurationType) – Target media for the module

  • force (bool, optional) – Should reserve the module by force, defaults to True

Raises:

NotSupportMedia – The module does not support this media type

Returns:

Return type:

async set_module_port_config(module, port_count, port_speed, force=True)[source]

Set module’s port-speed configuration

Parameters:
  • module (t.Union[GenericL23Module, ModuleChimera]) – The module object

  • port_count (int) – The port count

  • port_speed (int) – The port speed in Mbps, e.g. 40000 for 40G

  • force (bool, optional) – Should reserve the module by force, defaults to True

Raises:

NotSupportPortSpeed – The module does not support the port-speed configuration under its current media configuration

Returns:

Return type:

async get_module_eol_date(module)[source]

Get module’s End-of-Life date

Parameters:

module (GenericAnyModule) – The module object

Returns:

Module’s EOL date

Return type:

str

async get_module_eol_days(module)[source]

Get days until module’s End-of-Life date

Parameters:

module (GenericAnyModule) – The module object

Returns:

days until module’s End-of-Life date

Return type:

int

async get_module_cage_insertion_count(module, cage_index)[source]

Get module cage insertion count

Parameters:
  • module (int) – The Z800 Freya module object

  • cage_index – The cage index

Returns:

Insertion count of the cage

Return type:

int

High-Level Port Functions

async reserve_port(port, force=True, reset=False)[source]

Reserve a port regardless whether it is owned by others or not.

Parameters:
  • port (GenericAnyPort) – The port to reserve

  • force (boolean) – Should force reserve the port

Returns:

Return type:

None

async release_port(port)[source]

Free a port. If the port is reserved by you, release the port. If the port is reserved by others, relinquish the port. The port should have no owner afterwards.

Parameters:

port (GenericAnyPort) – The port to free

Returns:

Return type:

None

async release_ports(*ports)[source]

Free a list of ports. If the port is reserved by you, release the port. If the port is reserved by others, relinquish the port. The port should have no owner afterwards.

Parameters:

ports (GenericAnyPort) – The ports to free

get_port(tester, module_id, port_id)[source]

Get a port of the module

Parameters:
  • tester (GenericAnyTester) – The tester object

  • module_id (int) – The module index

  • port_id (int) – The port index

Raises:

NoSuchPortError – No port found with the index

Returns:

The port object

Return type:

GenericAnyPort

get_ports(tester, module_id)[source]

Get all ports of the module

Parameters:
  • tester (GenericAnyTester) – The tester object

  • module_id (int) – The module index

Returns:

List of port objects

Return type:

tuple[GenericAnyPort]

get_all_ports(tester)[source]

Get all ports of the tester

Parameters:

tester (GenericAnyTester) – The tester object

Returns:

List of port objects

Return type:

tuple[GenericAnyPort]

High-Level Stream Functions

async remove_streams(port)[source]

Remove all streams on a port witout resetting the port.

Parameters:

port (GenericAnyPort) – The port object