waft.system.nodes.linux_node module

class waft.system.nodes.linux_node.LinuxNode(client: ClientBase)

Bases: UnixNode

Node 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_package_manager_repos() list[str]

Return dictionary of repo filenames and associated URLs

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_version: str

Returns the version of the OS e.g. 10.0.22631 N/A Build 22631

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_cdp_server()

Start a Chrome Debugging Protocol server on the test node

run_update()

Run updates on the system

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'