waft.system.nodes.macos_node module¶
- class waft.system.nodes.macos_node.MacOSNode(client: ClientBase)¶
Bases:
UnixNodeNode for mac specific functionality
- chromium_browser: str = 'chromium'¶
- 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_sha256_of_file(remote_file_path: PurePath) str¶
Get the sha256 of a file
- inline_ssh_env: bool = True¶
- 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_codename: str¶
Returns the codename of the OS e.g. sequoia or 24F74
- property os_name: str¶
Returns the name of the OS e.g. macOS
- property os_version: str¶
Returns the version of the OS e.g. 15.5
- 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_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
- 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