sssd_test_framework.hosts.keycloak

Keycloak multihost host.

Classes

KeycloakHost(*args, **kwargs)

Keycloak host object.

class sssd_test_framework.hosts.keycloak.KeycloakHost(*args, **kwargs)

Bases: BaseDomainHost, BaseLinuxHost

Keycloak host object.

Provides features specific for Keycloak server.

This class adds config.adminpw multihost configuration option to set password of the Keycloak admin user so we run kcadm.sh commands to set options in Keycloak.

Example multihost configuration
- hostname: master.keycloak.test
  role: keycloak
  config:
    adminpw: Secret123

Note

Full backup and restore is supported. However, the operation relies on kc.sh export and kc.sh import commands which can take several seconds to finish.

Parameters:
  • auto_start – Automatically start service before taking the first backup.

  • auto_restore (bool, optional) – If True, the host is automatically restored to the backup state when a test is finished in teardown(), defaults to True

kclogin() None

Obtain admin user credentials for Keycloak.

start() None

Start required services.

Raises:

NotImplementedError – If start operation is not supported.

stop() None

Stop required services.

Raises:

NotImplementedError – If stop operation is not supported.

backup() Any

Backup all Keycloak server data.

This is done by calling kc.sh export on the server and can take several seconds to finish.

Returns:

Backup data.

Return type:

Any

restore(backup_data: Any | None) None

Restore all Keycloak server data to its original state.

This is done by calling kc.sh import on the server and can take several seconds to finish.

Returns:

Backup data.

Return type:

Any