sssd_test_framework.utils.sshd
SSH Daemon Tools.
Classes
|
Managing global and server SSH configuration files. |
- class sssd_test_framework.utils.sshd.SSHDUtils(*args, **kwargs)
Bases:
MultihostUtility[MultihostHost]Managing global and server SSH configuration files.
Warning
Incorrectly configuring sshd may disable the ability to connect to the host.
Example usage@pytest.mark.topology(KnownTopologyGroup.AnyProvider) def test_example(client: Client, provider: GenericProvider): # Add user provider.user("user1").add() # Select authselect profile and feature client.authselect.select("sssd", ["with-gssapi", "with-mkhomedir"]) # Start sssd client.sssd.start() # Configure ssh client and daemon client.sshd.config_set([{"GSSAPIAuthentication": "yes"}]) # Reload sshd configuration client.sshd.reload()
- Parameters:
host (MultihostHost) – Remote host instance.
fs (LinuxFileSystem) – Linux file system instance.
svc (SystemdServices) – Systemd utils.
file (str) – Configuration file.
- setup() None
Setup object.
- teardown() None
Teardown object.
- config_read() str
Read SSH daemon configuration as Augeas tree.
- Returns:
sshd configuration
- Return type:
str
- config_delete(value: list[dict[str, str]]) None
Delete SSH daemon configuration.
- Parameters:
value (list[dict[str, str]]) – Configuration.
- Returns:
None
- config_set(value: list[dict[str, str]]) None
Set SSH daemon configuration.
- Parameters:
value (list[list[str]]) – sshd parameter
- Returns:
None
- reload(service='sshd', *, raise_on_error: bool = True) ProcessResult
Reload the SSH daemon.
- Parameters:
service (str, optional) – Service to start, defaults to ‘sshd’
raise_on_error (bool, optional) – Raise exception on error, defaults to True
- Returns:
SSH process result.
- Return type:
ProcessResult