SCAutolib.controller
Classes
- class Controller(config=None, params=None)[source]
Constructor will parse and check input configuration file. If some required fields in the configuration are missing, CLI parameters would be checked if missing values are there. If not, an exception would be raised. After parsing the configuration file and filling internal values of the Controller object, other related objects (users, cards, CAs, Authselect, etc.) would be initialised, but any real action that would affect the system wouldn’t be made.
- Parameters:
config (pathlib.Path or str) – Path to configuration file with metadata for testing.
params (dict) – Parameters from CLI
- Returns:
- static _general_steps_for_ipa()[source]
General system preparation for installing IPA client on RHEL/Fedora
- Returns:
name of the IPA client package for current Linux
- static _general_steps_for_virtual_sc()[source]
Prepare the system for virtual smart card. Preparation means to configure pcscd service and opensc module to work correctly with virtual smart card. Also, repository for installing virt_cacard package is added in this method.
- static _validate_configuration(conf, params=None)[source]
Validate schema of the configuration file. If some value is not present in the config file, this value would be looked in the CLI parameters
- cleanup()[source]
Clean the system after setup. This method restores the SSSD config file, deletes created users with cards, remove CA’s (local and/or IPA Client)
- enroll_card(card)[source]
Enroll the card - i.e. upload keys and certs to card. If private key and/or the certificate do not exist, new one’s would be requested from corresponding CA.
- Parameters:
card (card.VirtualCard) – card object
- init_ca(local=False)[source]
Initialize CA.
- Parameters:
local (bool) – if True, local CA is initialized, otherwise IPA
- prepare(force, gdm, install_missing, graphical)[source]
Prepare system for testing. This method provides complex configuration of system under test for testing including creation of CAs, users and smart cards in the system and objects that represents them in SCAutolib. Configuration is based on config file and CLI options.
- Parameters:
force (bool) – Defines if existing objects, files, users, services etc. should be erased or overwritten if they already exist. True stands for erase/overwrite. This parameter is forwarded to several methods and it can have slightly different meaning in each of them. For details see docstrings of the methods.
gdm (bool) – If True, GDM package would be installed
install_missing (bool) – If True, all missing packages would be installed
graphical (bool) – If True, GUI tests dependencies are installed
- setup_card(card_dict, force=False)[source]
Create card object. Card object should contain its root CA cert as it represents general card (i.e. including physical read-only cards).
- setup_ipa_client(force=False)[source]
Configure IPA client for given IPA server on current host. IPA server should be already up and running for correct configuration of the IPA client
- Parameters:
force (bool) – If IPA Client is already configured on the system, specifies if it should be removed before configuring a new client.
- Raises:
SCAutolib.exceptions.SCAutolibWrongConfig
- setup_local_ca(force=False)[source]
Setup local CA based on configuration from the configuration file. All necessary files for this operation (e.g. CNF file for self-signed root certificate) would be created along the way.
- Parameters:
force (bool) – If local CA already exists in given directory, specifies if it should be overwritten
- Raises:
SCAutolib.exceptions.SCAutolibWrongConfig