pytest_mh.utils.services
Classes
|
Manage remote services. |
- class pytest_mh.utils.services.SystemdServices(*args, **kwargs)
Bases:
MultihostReentrantUtility[MultihostHost]Manage remote services.
Find all MultihostUtility objects in the constructor.
- async_start(service: str) Process
Start a systemd unit. Non-blocking call.
systemctl status $unitis called automatically if the unit can not be started. The status is then visible in the logs.
- start(service: str, raise_on_error: bool = True) ProcessResult
Start a systemd unit. The call will wait until the operation is finished.
systemctl status $unitis called automatically if the unit can not be started. The status is then visible in the logs.- Parameters:
- Returns:
SSH process result.
- Return type:
- async_stop(service: str) Process
Stop a systemd unit. Non-blocking call.
systemctl status $unitis called automatically if the unit can not be stopped. The status is then visible in the logs.
- stop(service: str, raise_on_error: bool = True) ProcessResult
Stop a systemd unit. The call will wait until the operation is finished.
systemctl status $unitis called automatically if the unit can not be stoped. The status is then visible in the logs.- Parameters:
- Returns:
SSH process result.
- Return type:
- async_restart(service: str) Process
Restart a systemd unit. Non-blocking call.
systemctl status $unitis called automatically if the unit can not be restarted. The status is then visible in the logs.
- restart(service: str, raise_on_error: bool = True) ProcessResult
Restart a systemd unit. The call will wait until the operation is finished.
systemctl status $unitis called automatically if the unit can not be restarted. The status is then visible in the logs.- Parameters:
- Returns:
SSH process result.
- Return type:
- async_reload(service: str) Process
Reload a systemd unit. Non-blocking call.
systemctl status $unitis called automatically if the unit can not be reloaded. The status is then visible in the logs.
- reload(service: str, raise_on_error: bool = True) ProcessResult
Reload a systemd unit. The call will wait until the operation is finished.
systemctl status $unitis called automatically if the unit can not be reloaded. The status is then visible in the logs.- Parameters:
- Returns:
SSH process result.
- Return type:
- status(service: str, raise_on_error: bool = True) ProcessResult
Get systemd unit status. The call will wait until the operation is finished.
- Parameters:
- Returns:
SSH process result.
- Return type:
- async_get_property(service: str, prop: str) Process
Get property of systemd unit. Non-blocking call.
- get_property(service: str, prop: str, raise_on_error: bool = True) str
Get property of systemd unit. The call will wait until the operation is finished.
- async_reload_daemon() Process
Reload systemd daemon to refresh unit files. Non-blocking call.
- Returns:
Running SSH process.
- Return type:
- reload_daemon(raise_on_error: bool = True) ProcessResult
Reload systemd daemon to refresh unit files. The call will wait until the operation is finished.
- Parameters:
raise_on_error (bool, optional) – Raise exception on error, defaults to True
- Returns:
SSH process result.
- Return type: