tmt.steps package
Subpackages
- tmt.steps.discover package
- Submodules
- tmt.steps.discover.fmf module
DiscoverFmfDiscoverFmfStepDataDiscoverFmfStepData.adjust_testsDiscoverFmfStepData.dist_git_extractDiscoverFmfStepData.dist_git_initDiscoverFmfStepData.dist_git_mergeDiscoverFmfStepData.dist_git_remove_fmf_rootDiscoverFmfStepData.excludeDiscoverFmfStepData.filterDiscoverFmfStepData.fmf_idDiscoverFmfStepData.linkDiscoverFmfStepData.modified_onlyDiscoverFmfStepData.modified_refDiscoverFmfStepData.modified_urlDiscoverFmfStepData.pathDiscoverFmfStepData.post_normalization()DiscoverFmfStepData.pruneDiscoverFmfStepData.refDiscoverFmfStepData.repositoryDiscoverFmfStepData.revisionDiscoverFmfStepData.sync_repoDiscoverFmfStepData.testDiscoverFmfStepData.upgrade_pathDiscoverFmfStepData.url
normalize_ref()
- tmt.steps.discover.shell module
DiscoverShellDiscoverShellDataTestDescriptionTestDescription.adjustTestDescription.componentTestDescription.contactTestDescription.descriptionTestDescription.durationTestDescription.enabledTestDescription.environmentTestDescription.frameworkTestDescription.from_spec()TestDescription.idTestDescription.linkTestDescription.manualTestDescription.nameTestDescription.orderTestDescription.pathTestDescription.recommendTestDescription.requireTestDescription.resultTestDescription.summaryTestDescription.tagTestDescription.testTestDescription.tierTestDescription.to_spec()TestDescription.tty
- Module contents
- tmt.steps.execute package
- Submodules
- tmt.steps.execute.internal module
- tmt.steps.execute.upgrade module
- Module contents
DEFAULT_SCRIPTS_DEST_DIRDEFAULT_SCRIPTS_DEST_DIR_OSTREEExecuteExecutePluginExecutePlugin.base_command()ExecutePlugin.check_abort_file()ExecutePlugin.cli_invocationExecutePlugin.discoverExecutePlugin.discover_phaseExecutePlugin.extract_custom_results()ExecutePlugin.extract_results()ExecutePlugin.extract_tmt_report_results()ExecutePlugin.extract_tmt_report_results_restraint()ExecutePlugin.go()ExecutePlugin.howExecutePlugin.prepare_scripts()ExecutePlugin.prepare_tests()ExecutePlugin.results()ExecutePlugin.run_checks_after_test()ExecutePlugin.run_checks_before_test()ExecutePlugin.scriptsExecutePlugin.timeout_hint()
ExecuteStepDataResultCollectionSCRIPTS_DEST_DIR_VARIABLESCRIPTS_SRC_DIRScriptScriptCreatingFileScriptTemplateTestInvocationTestInvocation.abort_request_pathTestInvocation.abort_requestedTestInvocation.check_dataTestInvocation.check_files_pathTestInvocation.check_resultsTestInvocation.end_timeTestInvocation.guestTestInvocation.handle_reboot()TestInvocation.handle_restart()TestInvocation.hard_reboot_requestedTestInvocation.is_guest_healthyTestInvocation.loggerTestInvocation.pathTestInvocation.phaseTestInvocation.processTestInvocation.process_lockTestInvocation.real_durationTestInvocation.reboot_request_pathTestInvocation.reboot_requestedTestInvocation.relative_pathTestInvocation.relative_test_data_pathTestInvocation.restart_requestedTestInvocation.resultsTestInvocation.return_codeTestInvocation.soft_reboot_requestedTestInvocation.start_timeTestInvocation.terminate_process()TestInvocation.testTestInvocation.test_data_path
effective_scripts_dest_dir()
- tmt.steps.finish package
- tmt.steps.prepare package
- Subpackages
- Submodules
- tmt.steps.prepare.ansible module
- tmt.steps.prepare.distgit module
- tmt.steps.prepare.install module
CoprInstallApkInstallAptInstallBaseInstallBase.cli_invocationInstallBase.debuginfo_packagesInstallBase.excludeInstallBase.guestInstallBase.install()InstallBase.install_debuginfo()InstallBase.install_from_repository()InstallBase.install_from_url()InstallBase.install_local()InstallBase.list_installables()InstallBase.local_packagesInstallBase.package_directoryInstallBase.packagesInstallBase.prepare_install_local()InstallBase.prepare_installables()InstallBase.prepare_repository()InstallBase.remote_packagesInstallBase.rpm_check()InstallBase.skip_missing
InstallDnfInstallDnf5InstallRpmOstreeInstallRpmOstree.cli_invocationInstallRpmOstree.copr_pluginInstallRpmOstree.enable_copr()InstallRpmOstree.install_debuginfo()InstallRpmOstree.install_from_repository()InstallRpmOstree.install_local()InstallRpmOstree.recommended_packagesInstallRpmOstree.required_packagesInstallRpmOstree.sort_packages()
InstallYumPrepareInstallPrepareInstallData
- tmt.steps.prepare.shell module
- Module contents
- tmt.steps.provision package
- Submodules
- tmt.steps.provision.artemis module
ArtemisAPIArtemisGuestDataArtemisGuestData.api_retriesArtemisGuestData.api_retry_backoff_factorArtemisGuestData.api_timeoutArtemisGuestData.api_urlArtemisGuestData.api_versionArtemisGuestData.archArtemisGuestData.guestnameArtemisGuestData.imageArtemisGuestData.keynameArtemisGuestData.kickstartArtemisGuestData.log_typeArtemisGuestData.poolArtemisGuestData.post_install_scriptArtemisGuestData.priority_groupArtemisGuestData.provision_tickArtemisGuestData.provision_timeoutArtemisGuestData.skip_prepare_verify_sshArtemisGuestData.userArtemisGuestData.user_dataArtemisGuestData.watchdog_dispatch_delayArtemisGuestData.watchdog_period_delay
ArtemisProvisionErrorGuestArtemisGuestArtemis.apiGuestArtemis.api_retriesGuestArtemis.api_retry_backoff_factorGuestArtemis.api_timeoutGuestArtemis.api_urlGuestArtemis.api_versionGuestArtemis.archGuestArtemis.cli_invocationGuestArtemis.guestnameGuestArtemis.imageGuestArtemis.is_readyGuestArtemis.keynameGuestArtemis.kickstartGuestArtemis.log_typeGuestArtemis.poolGuestArtemis.post_install_scriptGuestArtemis.priority_groupGuestArtemis.provision_tickGuestArtemis.provision_timeoutGuestArtemis.remove()GuestArtemis.skip_prepare_verify_sshGuestArtemis.start()GuestArtemis.user_dataGuestArtemis.watchdog_dispatch_delayGuestArtemis.watchdog_period_delay
GuestInspectTypeProvisionArtemisProvisionArtemisData
- tmt.steps.provision.bootc module
- tmt.steps.provision.connect module
- tmt.steps.provision.local module
- tmt.steps.provision.mrack module
BEAKERBeakerAPIBeakerGuestDataBeakerProviderBeakerTransformerCreateJobParametersDEFAULT_API_SESSION_REFRESHGuestBeakerGuestBeaker.apiGuestBeaker.api_session_refresh_tickGuestBeaker.archGuestBeaker.beaker_job_ownerGuestBeaker.cli_invocationGuestBeaker.hardwareGuestBeaker.imageGuestBeaker.is_readyGuestBeaker.job_idGuestBeaker.kickstartGuestBeaker.provision_tickGuestBeaker.provision_timeoutGuestBeaker.reboot()GuestBeaker.remove()GuestBeaker.start()GuestBeaker.stop()GuestBeaker.whiteboard
GuestInspectTypeMrackBaseHWElementMrackHWAndGroupMrackHWBinOpMrackHWElementMrackHWGroupMrackHWKeyValueMrackHWNotGroupMrackHWOrGroupNotAuthenticatedErrorProvisionBeakerProvisionBeakerDataProvisioningErrorTmtBeakerTransformerasync_run()constraint_to_beaker_filter()import_and_load_mrack_deps()mrackmrack_constructs_ks_pre()operator_to_beaker_op()providers
- tmt.steps.provision.podman module
GuestContainerGuestContainer.cli_invocationGuestContainer.containerGuestContainer.execute()GuestContainer.force_pullGuestContainer.imageGuestContainer.is_readyGuestContainer.loggerGuestContainer.podman()GuestContainer.pull()GuestContainer.pull_attemptsGuestContainer.pull_image()GuestContainer.pull_intervalGuestContainer.push()GuestContainer.reboot()GuestContainer.remove()GuestContainer.start()GuestContainer.stop()GuestContainer.stop_timeGuestContainer.userGuestContainer.wake()
PodmanGuestDataProvisionPodmanProvisionPodmanData
- tmt.steps.provision.testcloud module
AArch64ArchitectureConfigurationBOOT_TIMEOUTCONNECT_TIMEOUTDEFAULT_BOOT_TIMEOUTDEFAULT_CONNECT_TIMEOUTDomainConfigurationGuestTestcloudGuestTestcloud.archGuestTestcloud.cli_invocationGuestTestcloud.connectionGuestTestcloud.diskGuestTestcloud.imageGuestTestcloud.image_urlGuestTestcloud.instance_nameGuestTestcloud.is_coreosGuestTestcloud.is_kvmGuestTestcloud.is_legacy_osGuestTestcloud.is_readyGuestTestcloud.memoryGuestTestcloud.prepare_config()GuestTestcloud.prepare_ssh_key()GuestTestcloud.reboot()GuestTestcloud.remove()GuestTestcloud.start()GuestTestcloud.stop()GuestTestcloud.wake()
NON_KVM_TIMEOUT_COEFPpc64leArchitectureConfigurationProvisionTestcloudProvisionTestcloudDataQCow2StorageDeviceRawStorageDeviceS390xArchitectureConfigurationSystemNetworkConfigurationTPMConfigurationTPM_CONFIG_ALLOWS_VERSIONSTPM_VERSION_ALLOWED_OPERATORSTPM_VERSION_SUPPORTED_VERSIONSTestcloudGuestDataUserNetworkConfigurationWorkaroundsX86_64ArchitectureConfigurationimport_testcloud()normalize_disk_size()normalize_memory_size()
- Module contents
BASE_SSH_OPTIONSCheckRsyncOutcomeDEFAULT_REBOOT_COMMANDDEFAULT_REBOOT_TIMEOUTDEFAULT_SSH_OPTIONSGuestGuest.ansible()Guest.becomeGuest.cli_invocationGuest.essential_requires()Guest.execute()Guest.factsGuest.hardwareGuest.is_readyGuest.load()Guest.localhostGuest.multihost_nameGuest.options()Guest.package_managerGuest.primary_addressGuest.pull()Guest.push()Guest.reboot()Guest.reconnect()Guest.remove()Guest.roleGuest.save()Guest.scripts_pathGuest.setup()Guest.show()Guest.start()Guest.stop()Guest.topology_addressGuest.wake()
GuestCapabilityGuestDataGuestFactsGuestFacts.archGuestFacts.capabilitiesGuestFacts.distroGuestFacts.format()GuestFacts.has_capability()GuestFacts.has_selinuxGuestFacts.in_syncGuestFacts.is_ostreeGuestFacts.is_superuserGuestFacts.kernel_releaseGuestFacts.lsb_release_contentGuestFacts.os_release_contentGuestFacts.package_managerGuestFacts.sync()
GuestSshGuestSsh.cli_invocationGuestSsh.execute()GuestSsh.is_readyGuestSsh.is_ssh_multiplexing_enabledGuestSsh.keyGuestSsh.passwordGuestSsh.perform_reboot()GuestSsh.portGuestSsh.pull()GuestSsh.push()GuestSsh.reboot()GuestSsh.remove()GuestSsh.setup()GuestSsh.ssh_optionGuestSsh.stop()GuestSsh.user
GuestSshDataProvisionProvisionPluginProvisionQueueProvisionStepDataProvisionTaskREBOOT_TIMEOUTSSH_MASTER_SOCKET_LENGTH_LIMITSTAT_BTIME_PATTERNconfigure_ssh_options()essential_ansible_requires()format_guest_full_name()normalize_hardware()
- tmt.steps.report package
- Submodules
- tmt.steps.report.display module
- tmt.steps.report.html module
- tmt.steps.report.junit module
- tmt.steps.report.polarion module
ReportPolarionReportPolarionDataReportPolarionData.archReportPolarionData.assigneeReportPolarionData.buildReportPolarionData.compose_idReportPolarionData.descriptionReportPolarionData.fileReportPolarionData.fipsReportPolarionData.include_output_logReportPolarionData.logsReportPolarionData.planned_inReportPolarionData.platformReportPolarionData.pool_teamReportPolarionData.prettifyReportPolarionData.project_idReportPolarionData.sample_imageReportPolarionData.templateReportPolarionData.titleReportPolarionData.uploadReportPolarionData.use_facts
- tmt.steps.report.reportportal module
LogFilterSettingsReportReportPortalReportReportPortal.TMT_TO_RP_RESULT_STATUSReportReportPortal.append_description()ReportReportPortal.check_options()ReportReportPortal.cli_invocationReportReportPortal.construct_launch_attributes()ReportReportPortal.datetimeReportReportPortal.execute_rp_import()ReportReportPortal.get_defect_type_locator()ReportReportPortal.go()ReportReportPortal.handle_response()ReportReportPortal.headersReportReportPortal.rp_api_get()ReportReportPortal.rp_api_post()ReportReportPortal.rp_api_put()ReportReportPortal.url
ReportReportPortalDataReportReportPortalData.api_versionReportReportPortalData.artifacts_urlReportReportPortalData.defect_typeReportReportPortalData.exclude_variablesReportReportPortalData.launchReportReportPortalData.launch_descriptionReportReportPortalData.launch_per_planReportReportPortalData.launch_rerunReportReportPortalData.launch_urlReportReportPortalData.launch_uuidReportReportPortalData.log_size_limitReportReportPortalData.projectReportReportPortalData.ssl_verifyReportReportPortalData.suite_per_planReportReportPortalData.suite_uuidReportReportPortalData.test_uuidsReportReportPortalData.tokenReportReportPortalData.traceback_size_limitReportReportPortalData.upload_to_launchReportReportPortalData.upload_to_suiteReportReportPortalData.url
- Module contents
Module contents
Step Classes
- class tmt.steps.Action(*, order: int = 50, **kwargs: Any)
Bases:
Phase,MultiInvokableCommonA special action performed during a normal step.
Initialize name and relation with the parent object
Prepare the workdir for provided id / directory path or generate a new workdir name if workdir=True given. Store command line context and options for future use if context is provided.
- cli_invocation: 'tmt.cli.CliInvocation' | None = None
- cli_invocations: list['tmt.cli.CliInvocation'] = []
- go() None
- class tmt.steps.ActionTask(logger: Logger, phase: Action, **kwargs: Any)
Bases:
GuestlessTask[None]A task to run an action
- property name: str
A name of this task.
Left for child classes to implement, because the name depends on the actual task.
- class tmt.steps.BasePlugin(*, step: Step, data: StepDataT, workdir: Literal[True] | Path | None = None, logger: Logger)
Bases:
Phase,Generic[StepDataT,PluginReturnValueT]Common parent of all step plugins
Store plugin name, data and parent step
- classmethod base_command(usage: str, method_class: type[Command] | None = None) Command
Create base click command (common for all step plugins)
- cli_invocation: 'tmt.cli.CliInvocation' | None = None
- classmethod command() Command
Prepare click command for all supported methods
- data: StepDataT
- default(option: str, default: Any | None = None) Any
Return default data for given option
- classmethod delegate(step: Step, data: StepDataT | None = None, raw_data: _RawStepData | None = None) BasePlugin[StepDataT, PluginReturnValueT]
Return plugin instance implementing the data[‘how’] method
Supports searching by method prefix as well (e.g. ‘virtual’). The first matching method with the lowest ‘order’ wins.
- 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.
- get(option: str, default: Any | None = None) Any
Get option from plugin data, user/system config or defaults
- how: str = 'shell'
- classmethod options(how: str | None = None) list[Callable[[Any], Any]]
Prepare command line options for given method
- prune(logger: Logger) None
Prune uninteresting files from the plugin workdir
By default we remove the whole workdir. Individual plugins can override this method to keep files and directories which are useful for inspection when the run is finished.
- property safe_name: str
A safe variant of the name which does not contain special characters.
Override parent implementation as we do not allow phase names to contain slash characters,
/.
- show(keys: list[str] | None = None) None
Show plugin details for given or all available keys
- wake() None
Wake up the plugin, process data, apply options
Check command line options corresponding to plugin keys and store their value into the ‘self.data’ dictionary if their value is True or non-empty.
By default, all supported options corresponding to common and plugin-specific keys are processed. List of key names in the ‘keys’ parameter can be used to override only selected ones.
- class tmt.steps.DefaultNameGenerator(known_names: list[str])
Bases:
objectGenerator of names for that do not have any.
If user did not set any
namefor one or more phases, tmt will assign them a “dummy” namedefault-N. This class wraps the generator.Generator of names for that do not have any.
- Parameters:
known_names – already existing names the generator needs to avoid.
- classmethod from_raw_phases(raw_data: Iterable[_RawStepData]) DefaultNameGenerator
Create a generator based on available phase specifications.
A special constructor that extracts
known_namesfromraw_data.- Parameters:
raw_data – phase specifications as collected from fmf nodes and CLI options.
- get() str
- restart() None
Reset the generator and start from the beginning again
- class tmt.steps.GuestTopology(guest: Guest)
Bases:
SerializableContainerDescribes a guest in the topology of provisioned tmt guests
- hostname: str | None
- name: str
- role: str | None
- class tmt.steps.GuestlessPlugin(*, step: Step, data: StepDataT, workdir: Literal[True] | Path | None = None, logger: Logger)
Bases:
BasePlugin[StepDataT,PluginReturnValueT]Common parent of all step plugins that do not work against a particular guest
Store plugin name, data and parent step
- cli_invocation: 'tmt.cli.CliInvocation' | None = None
- go(*, logger: Logger | None = None) PluginReturnValueT
Perform actions shared among plugins when beginning their tasks
- class tmt.steps.Login(*, step: Step, order: int, logger: Logger)
Bases:
ActionLog into the guest
Initialize relations, store the login order
- after_test(result: Result, cwd: Path | None = None, env: Environment | None = None) None
Check and login after test execution
- cli_invocation: 'tmt.cli.CliInvocation' | None = None
- cli_invocations: list['tmt.cli.CliInvocation'] = []
- classmethod command(method_class: Method | None = None, usage: str | None = None) Command
Create the login command
- go(force: bool = False) None
Login to the guest(s)
- class tmt.steps.Method(name: str, class_: type[BasePlugin] | None = None, doc: str | None = None, order: int = 50)
Bases:
objectStep implementation method
Store method data
- describe() str
Format name and summary for a nice method overview
- usage() str
Prepare a detailed usage from summary and description
- class tmt.steps.Phase(*, order: int = 50, **kwargs: Any)
Bases:
CommonA phase of a step
Initialize name and relation with the parent object
Prepare the workdir for provided id / directory path or generate a new workdir name if workdir=True given. Store command line context and options for future use if context is provided.
- assert_feeling_safe(deprecated_in_version: str, subject: str) None
Raises a tmt.utils.ProvisionError if feeling-safe is required, but not set. Warns when feeling-safe will be required in a future version. :param deprecated_in_version: Version from which feeling-safe is required, e.g. ‘1.38’. :param subject: Subject requiring feeling-safe, e.g. ‘Local provision plugin’.
- cli_invocation: 'tmt.cli.CliInvocation' | None = None
- property is_in_standalone_mode: bool
True if the phase is in stand-alone mode.
Stand-alone mode means that only this phase should be run as a part of the run (and not any other even if requested using –all). This is useful as some plugin options may completely change its behaviour from the regular behaviour based on options (e.g. listing images inside a provision plugin).
- class tmt.steps.PhaseQueue(name: str, logger: Logger)
Bases:
Queue[ActionTask|PluginTask[StepDataT,PluginReturnValueT]]Queue class for running phases on guests
- enqueue_plugin(*, phase: Plugin[StepDataT, PluginReturnValueT], guests: list[Guest]) None
- class tmt.steps.Plugin(*, step: Step, data: StepDataT, workdir: Literal[True] | Path | None = None, logger: Logger)
Bases:
BasePlugin[StepDataT,PluginReturnValueT]Common parent of all step plugins that do work against a particular guest
Store plugin name, data and parent step
- cli_invocation: 'tmt.cli.CliInvocation' | None = None
- go(*, guest: Guest, environment: Environment | None = None, logger: Logger) PluginReturnValueT
Perform actions shared among plugins when beginning their tasks
- class tmt.steps.PluginReturnValueT
A type variable representing a return value of plugin’s
go()method.alias of TypeVar(‘PluginReturnValueT’)
- class tmt.steps.PluginTask(logger: Logger, guests: list[Guest], phase: Plugin[StepDataT, PluginReturnValueT], **kwargs: Any)
Bases:
MultiGuestTask[PluginReturnValueT],Generic[StepDataT,PluginReturnValueT]A task to run a phase on a given set of guests
- property name: str
A name of this task.
Left for child classes to implement, because the name depends on the actual task.
- phase: Plugin[StepDataT, PluginReturnValueT]
- property phase_name: str
- run_on_guest(guest: Guest, logger: Logger) None
Perform the task.
Called from
go()once for every guest to run on. Subclasses ofGuestlessTaskshould implement their logic in this method rather than ingo()which is already provided. If your task requires different handling ingo, it might be better derived directly fromTask.
- class tmt.steps.PullTask(logger: Logger, guests: list[Guest], source: Path | None = None, **kwargs: Any)
Bases:
MultiGuestTask[None]Task performing a workdir pull from a guest
- property name: str
A name of this task.
Left for child classes to implement, because the name depends on the actual task.
- run_on_guest(guest: Guest, logger: Logger) None
Perform the task.
Called from
go()once for every guest to run on. Subclasses ofGuestlessTaskshould implement their logic in this method rather than ingo()which is already provided. If your task requires different handling ingo, it might be better derived directly fromTask.
- source: Path | None
- class tmt.steps.PushTask(logger: Logger, guests: list[Guest], **kwargs: Any)
Bases:
MultiGuestTask[None]Task performing a workdir push to a guest
- property name: str
A name of this task.
Left for child classes to implement, because the name depends on the actual task.
- run_on_guest(guest: Guest, logger: Logger) None
Perform the task.
Called from
go()once for every guest to run on. Subclasses ofGuestlessTaskshould implement their logic in this method rather than ingo()which is already provided. If your task requires different handling ingo, it might be better derived directly fromTask.
- class tmt.steps.Reboot(*, step: Step, order: int, logger: Logger)
Bases:
ActionReboot guest
Initialize relations, store the reboot order
- cli_invocation: 'tmt.cli.CliInvocation' | None = None
- cli_invocations: list['tmt.cli.CliInvocation'] = []
- classmethod command(method_class: Method | None = None, usage: str | None = None) Command
Create the reboot command
- go() None
Reboot the guest(s)
- class tmt.steps.ResultT
A type variable representing a result type.
alias of TypeVar(‘ResultT’, bound=
BaseResult)
- class tmt.steps.Step(*, plan: Plan, data: _RawStepData | list[_RawStepData] | None = None, name: str | None = None, workdir: Literal[True] | Path | None = None, logger: Logger)
Bases:
MultiInvokableCommon,Exportable[Step]Common parent of all test steps
Initialize and check the step data
- DEFAULT_HOW: str = 'shell'
- actions() None
Run all loaded Login or Reboot action instances of the step
- property allowed_methods_pattern: Pattern[str]
Return a pattern allowed methods must match
- cli_invocation: 'tmt.cli.CliInvocation' | None = None
- cli_invocations: list['tmt.cli.CliInvocation'] = []
- property enabled: bool | None
True if the step is enabled
- go(force: bool = False) None
Execute the test step
- load() None
Load status and step data from the workdir
- phases(classes: None = None) list[Phase]
- phases(classes: type[PhaseT]) list[PhaseT]
- phases(classes: tuple[type[PhaseT], ...]) list[PhaseT]
Iterate over phases by their order
By default iterates over all available phases. Optional filter ‘classes’ can be used to iterate only over instances of given class (single class or tuple of classes).
- property plugins_in_standalone_mode: int
The number of plugins in standalone mode.
Stand-alone mode means that only this step should be run as a part of the run (and not any other even if requested using –all). This is useful as some step options may completely change its behaviour from the regular behaviour based on options (e.g. listing images inside provision).
- save() None
Save status and step data to the workdir
- setup_actions() None
Insert login and reboot plugins if requested
- show() None
Show step details
- status(status: str | None = None) str | None
Get and set current step status
The meaning of the status is as follows: todo … config, data and command line processed (we know what to do) done … the final result of the step stored to workdir (we are done)
- property step_name: str
- summary() None
Give a concise summary about the step result
To be implemented by each step.
- classmethod usage(method_overview: str) str
Prepare general usage message for the step
- wake() None
Wake up the step (process workdir and command line)
- class tmt.steps.StepData(name: str, how: str, order: int = 50, summary: str | None = None)
Bases:
SpecBasedContainer[_RawStepData,_RawStepData],NormalizeKeysMixin,SerializableContainerKeys necessary to describe, create, save and restore a step.
Very basic set of keys shared across all steps.
Provides basic functionality for transition between “raw” step data, which consists of fmf nodes and CLI options, and this container representation with keys and types more suitable for internal use.
Implementation expects simple 1:1 relation between
StepDataattributes - keys - and their fmf/CLI sources, where keys replace options’ dashes (-) with underscores (_). For example, to hold value of an fmf keyfoo-bar- or value of a corresponding CLI option,--foo-bar, a step data class should declare key namedfoo_data. AllStepDatamethods would honor this mapping.- classmethod from_spec(raw_data: _RawStepData, logger: Logger) StepDataT
Convert from a specification file or from a CLI option
- how: str
- name: str
- order: int = 50
- post_normalization(raw_data: _RawStepData, logger: Logger) None
Called after normalization, useful for tweaking normalized data
- classmethod pre_normalization(raw_data: _RawStepData, logger: Logger) None
Called before normalization, useful for tweaking raw data
- summary: str | None = None
- to_spec() _RawStepData
Convert to a form suitable for saving in a specification file
- class tmt.steps.Topology(guests: list[Guest])
Bases:
SerializableContainerDescribes the topology of provisioned tmt guests
- guest: GuestTopology | None
- guest_names: list[str]
- guests: dict[str, GuestTopology]
- push(*, dirpath: Path, guest: Guest, filename_base: Path | None = None, logger: Logger) Environment
Save and push topology to a given guest
- role_names: list[str]
- roles: dict[str, list[str]]
- save(*, dirpath: Path, filename_base: Path | None = None) list[Path]
Save the topology in files.
- Parameters:
dirpath – a directory to save into.
filename_base – if set, it would be used as a base for filenames, correct suffixes would be added.
- Returns:
list of paths to saved files.
- save_bash(dirpath: Path, filename: Path | None = None) Path
Save the topology in a Bash-sourceable file.
- Parameters:
dirpath – a directory to save into.
filename – if set, it would be used, otherwise a filename is created from
TEST_TOPOLOGY_FILENAME_BASEand.shsuffix.
- Returns:
path to the saved file.
- save_yaml(dirpath: Path, filename: Path | None = None) Path
Save the topology in a YAML file.
- Parameters:
dirpath – a directory to save into.
filename – if set, it would be used, otherwise a filename is created from
TEST_TOPOLOGY_FILENAME_BASEand.yamlsuffix.
- Returns:
path to the saved file.
- to_dict() dict[str, Any]
Convert to a mapping.
See https://tmt.readthedocs.io/en/stable/code/classes.html#class-conversions for more details.
- class tmt.steps.WhereableStepData(where: list[str] = <factory>)
Bases:
objectKeys shared by step data that may be limited to a particular guest.
To be used as a mixin class, adds necessary keys.
See [1] and [2] for specification.
- where: list[str]
- tmt.steps.provides_method(name: str, doc: str | None = None, order: int = 50) Callable[[type[BasePlugin]], type[BasePlugin]]
A plugin class decorator to register plugin’s method with tmt steps.
In the following example, developer marks
SomePluginas providing two discover methods,fooandbar, withbarbeing sorted to later position among methods:@tmt.steps.provides_method('foo') @tmt.steps.provides_method('bar', order=80) class SomePlugin(tmt.steps.discover.DicoverPlugin): ...
- Parameters:
name – name of the method.
doc – method documentation. If not specified, docstring of the decorated class is used.
order – order of the method among other step methods.
- tmt.steps.safe_filename(template: str, phase: Phase, guest: Guest, **variables: Any) Path
Construct a non-conflicting filename safe for parallel tasks.
Function adds enough uniqueness to a given template by adding a phase name and a guest name that the eventual filename would be safe against conflicting access from a phase running on multiple guests, and against reuse when created by the same plugin in different phases.
At first glance, the name might be an overkill: at one moment, there is just one phase running on the given guest, why bother? No other phase would touch the file on the guest. But:
filenames are created locally. One phase, running against multiple guests, still needs the filename to be unique on the tmt runner. Otherwise, phase running in different threads would contest a single file.
while the scenario is unlikely, user may eventually convince tmt to recognize two different names for the same machine, via
-h connect --guest $IP. Therefore it may happen that one phase, running against two guests, would actually run on the very same HW. Therefore even the remote per-guest uniqueness is needed.the phase name is included to avoid reuse of the filename by different phases. A plugin may be invoked by multiple phases, and it might use a “constant” name for the file. That would lead to the filename being re-used by different plugin executions. Adding the phase name should lower confusion: it would be immediately clear which phase used which filename, or whether a filename was or was not created by given phase.
- Parameters:
template – filename template. It is enhanced with
phaseandguestsafe name, but may use other variables provided invariables.phase – a phase owning the resulting filename.
guest – a guest on which the filename would be used.
variables – additional variables
templateneed when rendering the filename.
- tmt.steps.sync_with_guests(step: Step, action: str, task: GuestSyncTaskT, logger: Logger) None
Push and pull stuff from guests in a parallel manner.
Used by steps that run their plugins against one or more guest. Based on a
PhaseQueueprimitive, parallelized push/pull operations are needed, and this function handles the details.