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 reserveforce (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 freeshould_free_modules_ports (bool, optional) – should modules and ports also be freed, defaults to False
- Returns:
- Return type:
None
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 reserveforce (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 freeshould_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 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)
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.
- 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:
- 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:
- 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:
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
- get_ports(tester, module_id)
Added in version 1.1.
Get all ports of the module
- 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