8.1.1. Resource Management

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


8.1.1.1. HL Tester Functions

async reserve_tester(tester, force=True)

Added in version 1.1.

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 free_tester(tester, should_free_modules_ports=False)

Added in version 1.1.

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_free_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)

Added in version 2.7.2.

Get chassis system uptime in seconds

Parameters:

tester (L23Tester) – The tester to free

Returns:

Chassis system uptime in seconds

Return type:

int

8.1.1.2. HL Module Functions

async reserve_module(module, force=True)

Added in version 1.1.

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 free_module(module, should_free_ports=False)

Added in version 1.2.

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_free_ports (bool, optional) – should ports also be freed, defaults to False

Returns:

Return type:

None

get_module(tester, module_id)

Added in version 1.1.

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)

Added in version 1.1.

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)

Added in version 1.3.

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)

Added in version 1.3.

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)

Added in version 1.3.

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)

Added in version 1.3.

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)

Added in version 1.3.

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)

Added in version 2.7.2.

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

8.1.1.3. HL Port Functions

async reserve_port(port, force=True)

Added in version 1.1.

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 reset_port(port)

Added in version 1.1.

Reserve and reset a port

Parameters:

port (GenericAnyPort) – The port to reset

Returns:

Return type:

None

async free_port(port)

Added in version 1.1.

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

get_port(tester, module_id, port_id)

Added in version 1.1.

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)

Added in version 1.1.

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)

Added in version 1.1.

Get all ports of the tester

Parameters:

tester (GenericAnyTester) – The tester object

Returns:

List of port objects

Return type:

tuple[GenericAnyPort]

async free_ports(*ports)

Added in version 1.1.

Free all ports on a module.

Parameters:

port (GenericAnyPort) – The port to free

8.1.1.4. HL Stream Functions

async remove_streams(port)

Added in version 2.1.

Remove all streams on a port.

Parameters:

module (GenericAnyPort) – The port object