tmt.steps.prepare.feature package

Submodules

tmt.steps.prepare.feature.epel module

class tmt.steps.prepare.feature.epel.Epel(*args: Any, **kwargs: Any)

Bases: Feature

Initialize feature data

NAME: str = 'epel'
cli_invocation: 'tmt.cli.CliInvocation' | None = None
classmethod disable(guest: Guest, logger: Logger) None
classmethod enable(guest: Guest, logger: Logger) None
class tmt.steps.prepare.feature.epel.EpelStepData(name: str, how: str, order: int = 50, when: list[str] = <factory>, summary: Optional[str] = None, where: list[str] = <factory>, epel: Optional[str] = None)

Bases: PrepareFeatureData

epel: str | None = None

Module contents

class tmt.steps.prepare.feature.Feature(*, parent: PrepareFeature, guest: Guest, logger: Logger)

Bases: Common

Base class for feature prepare plugin implementations

Initialize feature data

NAME: str
cli_invocation: 'tmt.cli.CliInvocation' | None = None
classmethod disable(guest: Guest, logger: Logger) None
classmethod enable(guest: Guest, logger: Logger) None
classmethod get_data_class() type[PrepareFeatureData]

Return step data class for this plugin.

By default, _data_class is returned, but plugin may override this method to provide different class.

class tmt.steps.prepare.feature.PrepareFeature(*, step: Step, data: StepDataT, workdir: Literal[True] | Path | None = None, logger: Logger)

Bases: PreparePlugin[PrepareFeatureData]

Enable or disable common features like repositories on the guest.

Note

The plugin requires a working Ansible to be available on the test runner.

Warning

The plugin may be a subject of various limitations, imposed by the fact it uses Ansible to implement some of the features:

  • Ansible 2.17+ no longer supports Python 3.6 and older. Guests where Python 3.7+ is not available cannot be prepared with the feature plugin. This has been observed when Fedora Rawhide runner is used with CentOS 7 or CentOS Stream 8 guests. Possible workarounds: downgrade Ansible tmt uses, or install Python 3.7+ before using feature plugin from an alternative repository or local build.

Example config:

prepare:
    how: feature
    epel: enabled

Or

prepare:
    how: feature
    epel: disabled

Store plugin name, data and parent step

cli_invocation: 'tmt.cli.CliInvocation' | None = None
essential_requires() list[DependencySimple | DependencyFmfId | DependencyFile]

Collect all essential requirements of the plugin.

Essential requirements of a plugin are necessary for the plugin to perform its basic functionality.

Returns:

a list of requirements.

classmethod get_data_class() type[PrepareFeatureData]

Return step data class for this plugin.

prepare/feature builds the class in a dynamic way: class’ fields are defined by discovered feature plugins. Plugins define their own data classes, these are collected, their fields extracted and merged together with the base data class fields (name, order, …) into the final data class of prepare/feature plugin.

go(*, guest: Guest, environment: Environment | None = None, logger: Logger) list[PhaseResult]

Prepare the guests

class tmt.steps.prepare.feature.PrepareFeatureData(name: str, how: str, order: int = 50, when: list[str] = <factory>, summary: Optional[str] = None, where: list[str] = <factory>)

Bases: PrepareStepData

tmt.steps.prepare.feature.find_plugin(name: str) type[Feature]

Find a plugin by its name.

Raises:

GeneralError – when the plugin does not exist.

tmt.steps.prepare.feature.provides_feature(feature: str) Callable[[type[Feature]], type[Feature]]

A decorator for registering feature plugins. Decorate a feature plugin class to register a feature.