HL Module Management

The following high-level functions help you manage test modules.

Reserve/Release Module

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

Access Module Object

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]

Module Supported Media

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]]

Module Configuration

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

Change the module configuration to the target media, port count and port speed.

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

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

  • port_count (int) – the target port count

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

  • force (bool, optional) – should forcibly reserve the module, defaults to True

Raises:

NotSupportMediaPortSpeed – the provided media, port count and port speed configuration is not supported by the module

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:

Note

If you use set_module_config, you don’t need to call set_module_media_config and set_module_port_config separately, as set_module_config already includes both functionalities.

Module End-of-Life Information

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

Module Cage Insertion Information

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