sssd_test_framework.misc.ssh
Functions
|
Decorated function will be retried if its return code is non zero. |
Classes
|
Run an asynchronous process that requires |
- class sssd_test_framework.misc.ssh.SSHKillableProcess(client: Connection, argv: list[Any], *, cwd: str | None = None, env: dict[str, Any] | None = None, input: str | None = None, log_level: ProcessLogLevel = ProcessLogLevel.Full)
Bases:
objectRun an asynchronous process that requires
SIGTERMto be terminated.- Parameters:
client (Connection) – SSH client.
argv (list[Any]) – Command to run.
cwd (str | None, optional) – Working directory, defaults to None (= do not change)
env (dict[str, Any] | None, optional) – Additional environment variables, defaults to None
input (str | None, optional) – Content of standard input, defaults to None
log_level (ProcessLogLevel, optional) – Log level, defaults to ProcessLogLevel.Full
- pid
Process id.
- kill_delay: int
Wait
kill_delayseconds before killing the process.
- kill() None
- sssd_test_framework.misc.ssh.retry_command(max_retries: int = 5, delay: float = 1, match_stdout: str | list[str] | None = None, match_stderr: str | list[str] | None = None, check_rc: bool = True) Callable[[Callable[[Param], ProcessResult]], Callable[[Param], ProcessResult]]
Decorated function will be retried if its return code is non zero.
- Parameters:
max_retries (int, optional) – Maximum number of retry attempts, defaults to 5
delay (float, optional) – Delay in seconds between each retry, defaults to 1
match_stdout (str | list[str] | None, optional) – If set, retry only of string is found in stdout, defaults to None
match_stderr (str | list[str] | None, optional) – If set, retry only of string is found in stderr, defaults to None
check_rc (bool) – If True and rc == 0, do not retry.
- Returns:
Decorated function.
- Return type:
Callable