sssd_test_framework.hosts.keycloak
Keycloak multihost host.
Classes
|
Keycloak host object. |
- class sssd_test_framework.hosts.keycloak.KeycloakHost(*args, **kwargs)
Bases:
BaseDomainHost,BaseLinuxHostKeycloak host object.
Provides features specific for Keycloak server.
This class adds
config.adminpwmultihost 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 exportandkc.sh importcommands 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
adminuser 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 exporton 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 importon the server and can take several seconds to finish.- Returns:
Backup data.
- Return type:
Any