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 reserveforce (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 freeshould_release_ports (bool, optional) – should ports also be freed, defaults to False
- Returns:
- Return type:
None
Access Module Object
Module Supported Media
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:
- 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.