waft.system.nodes.linux_node module¶
- class waft.system.nodes.linux_node.LinuxNode(client: ClientBase)¶
Bases:
UnixNodeNode class that contains linux specific functionality
- clone_ssh_key_auth(username: str)¶
Clone SSH key authorization to another system user account.
- Parameters:
username (str) – Target system account username
- create_user(username: str, password: str | None = None) str¶
Create a system user account.
- Parameters:
username (str) – New system account username
password (Optional[str]) – New user’s password. Defaults to existing user’s password or a new system generated value.
- Returns:
Password for the new user account
- Return type:
str
- delete_user(username: str)¶
Delete a system user account.
- Parameters:
username (str) – System account username
- get_dns_server_addresses() set[str]¶
Get the IP addresses of the currently configured DNS servers.
- Returns:
Set of DNS server addresses
- Return type:
set[str]
- get_interface_mtu(interface_name: str) int¶
Get the current MTU of the specified interface.
- Parameters:
interface_name – The name of the interface
- Returns:
The current MTU value
- Return type:
int
- Raises:
RuntimeError – If MTU cannot be retrieved
- get_package_manager_repos() list[str]¶
Return dictionary of repo filenames and associated URLs
- get_sha256_of_file(remote_file_path: PurePath) str¶
Get the sha256 of a file
- install_packages(package_names: list[str], arguments: List[str] | None = None)¶
Install packages with given names
- Parameters:
package_names – List of names of packages to be installed
arguments – Optional list of additional arguments to be passed to package manager
- is_service_running(service: str) bool¶
Return boolean indicating if service of the given name is running
- Parameters:
service – String name of the service to check if is running
- keyring_exec(*args, secret: str | None = None) str¶
Execute the keyring CLI.
- Parameters:
args (str) – Keyring command options to execute.
secret (Optional[str]) – Secret input.
- Returns:
Keyring command output.
- Return type:
str
- list_applications_matching_name(application_name: str) List[str]¶
Search system for installed app matching name part :param application_name: Name of application to search for on node
Returns: List of strings from package manager of all installed applications matching given application_name
- property os_codename: str¶
Returns the codename of the OS e.g. noble
- property os_name: str¶
Returns the name of the OS e.g. ubuntu
- property os_version: str¶
Returns the version of the OS e.g. 24.04
- package_manager: str¶
- package_manager_repo_dir: PurePosixPath¶
- property platform_is_linux: bool¶
Return boolean indicating whether system is a Linux-based platform
- Returns:
True if node is a Linux-based platform, False otherwise
- Return type:
bool
- restart_process(process: str)¶
Restart process running on node :param process: Process to be restarted
- run_update()¶
Run updates on the system
- set_interface_mtu(interface_name: str, mtu: int) None¶
Set the MTU of the specified interface.
- Parameters:
interface_name – The name of the interface
mtu – The MTU value to set
- Raises:
RuntimeError – If MTU cannot be set
- start_process(process: str)¶
Start process running on node :param process: Process to be started
- stop_process(process: str)¶
Stop process running on node :param process: Process to be stopped
- system_secret_del(identifier: str, username: str)¶
Delete a stored system secret.
- Parameters:
identifier (str) – Credential identifier.
username (str) – Credential username.
- system_secret_get(identifier: str, username: str) dict¶
Retrieve a stored system secret.
- Parameters:
identifier (str) – Credential identifier.
username (str) – Credential username.
- Returns:
Credential as a JSON dictionary
- Return type:
dict
- system_secret_key(identifier: str, username: str)¶
Set a stored system secret.
- Parameters:
identifier (str) – Credential identifier.
username (str) – Credential username.
- system_secret_set(identifier: str, username: str, secret: str)¶
Set a stored system secret.
- Parameters:
identifier (str) – Credential identifier.
username (str) – Credential username.
secret (str) – Credential secret.
- trace_cmd: str = 'timeout 20 tracepath'¶