sssd_test_framework.misc.ssh

Functions

retry_command([max_retries, delay, ...])

Decorated function will be retried if its return code is non zero.

Classes

SSHKillableProcess(client, argv, *[, cwd, ...])

Run an asynchronous process that requires SIGTERM to be terminated.

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: object

Run an asynchronous process that requires SIGTERM to 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_delay seconds 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