8.1.1. Resource Management
The following high-level functions handle test resource management, e.g. connection, port reservation, and port reset.
HL Tester Functions
- async reserve_tester(tester, force=True)[source]
Added in version 1.1.
Reserve a tester regardless whether it is owned by others or not.
- Parameters:
tester (
GenericAnyTester
) – The tester to reserveforce (boolean) – Should force reserve the tester
- Returns:
- Return type:
None
- async free_tester(tester, should_free_modules_ports=False)[source]
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 freeshould_free_modules_ports (bool, optional) – should modules and ports also be freed, defaults to False
- Returns:
- Return type:
None
HL Module Functions
- async reserve_module(module, force=True)[source]
Added in version 1.1.
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 free_module(module, should_free_ports=False)[source]
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 freeshould_free_ports (bool, optional) – should ports also be freed, defaults to False
- Returns:
- Return type:
None
- get_module(tester, module_id)[source]
Added in version 1.1.
Get a module object of the tester.
- Parameters:
tester (
GenericAnyTester
) – The tester objectmodule_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]
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)[source]
Added in version 1.3.
Get a list of supported media, port speed and count of the module.
- async set_module_media_config(module, media, force=True)[source]
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)[source]
Added in version 1.3.
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:
- async get_module_eol_date(module)[source]
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:
HL Port Functions
- async reserve_port(port, force=True)[source]
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)[source]
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)[source]
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