waft.system.nodes.macos_node module

class waft.system.nodes.macos_node.MacOSNode(client: ClientBase)

Bases: UnixNode

Node for mac 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]

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

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 macOS for installed app matching name part

property os_name: str

Returns the name of the OS e.g. Darwin

property os_version: str

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

platform: Platforms = 'macos'
property platform_is_macOS: bool

Return boolean indicating whether system is a macOS-based platform

Returns:

True if node is a macOS-based platform, False otherwise

Return type:

bool

restart_process(process: str)

Restart process running on node

Parameters:

process – Process to be restarted

restart_ssh_server()

Restart SSH server if in use, else ignore

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

Parameters:

process – Process to be started

stop_process(process: str)

Stop process running on node

Parameters:

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_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 = 'traceroute'
uninstall_package(package_name: str, full_purge: bool = True)

Uninstall package with given name

Parameters:
  • package_name – String name of package to be uninstalled

  • full_purge – Boolean indicating if all associated files should be removed upon uninstalling the package