linux_session - Linux Remote Session
Linux OS translator.
Translate OS-unaware calls into Linux calls/utilities. Most of Linux distributions are mostly compliant with POSIX standards, so this module only implements the parts that aren’t. This intermediate module implements the common parts of mostly POSIX compliant distributions.
- class LshwConfigurationOutput
Bases:
TypedDict
The relevant parts of
lshw
’sconfiguration
section.- driver: str
- link: str
- class LshwOutput
Bases:
TypedDict
A model of the relevant information from
lshw
’s json output.Example
{ ... "businfo" : "pci@0000:08:00.0", "logicalname" : "enp8s0", "version" : "00", "serial" : "52:54:00:59:e1:ac", ... "configuration" : { ... "link" : "yes", ... }, ...
- businfo: str
- logicalname: typing_extensions.NotRequired.<class 'str'>
- serial: typing_extensions.NotRequired.<class 'str'>
- configuration: LshwConfigurationOutput
- class LinuxSession
Bases:
PosixSession
The implementation of non-Posix compliant parts of Linux.
- get_remote_cpus() list[framework.testbed_model.cpu.LogicalCore]
Overrides
get_remote_cpus()
.
- get_dpdk_file_prefix(dpdk_prefix: str) str
Overrides
get_dpdk_file_prefix()
.
- setup_hugepages(number_of: int, hugepage_size: int, force_first_numa: bool) None
Overrides
setup_hugepages()
.- Raises:
ConfigurationError – If the given hugepage_size is not supported by the OS.
- get_port_info(pci_address: str) PortInfo
Overrides
get_port_info()
.- Raises:
ConfigurationError – If the port could not be found.
- bind_ports_to_driver(ports: list[framework.testbed_model.port.Port], driver_name: str) None
Overrides
bind_ports_to_driver()
.The
devbind_script_path
property must be setup in order to call this method.
- bring_up_link(ports: Iterable[Port]) None
Overrides
bring_up_link()
.
- property devbind_script_path: PurePath
The path to the dpdk-devbind.py script on the node.
Needs to be manually assigned first in order to be used.
- Raises:
InternalError – If accessed before environment setup.
- create_vfs(pf_port: Port) None
Overrides
create_vfs()
.- Raises:
InternalError – If there are existing VFs which have to be deleted.
- delete_vfs(pf_port: Port) None
Overrides
delete_vfs()
.
- get_pci_addr_of_vfs(pf_port: Port) list[str]
Overrides
get_pci_addr_of_vfs()
.
- refresh_lshw() None
Force refresh of cached lshw network info.
- configure_port_mtu(mtu: int, port: Port) None
Overrides
configure_port_mtu()
.
- configure_ipv4_forwarding(enable: bool) None
Overrides
configure_ipv4_forwarding()
.