tmt.steps.prepare.artifact package

Subpackages

Module contents

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

Bases: PreparePlugin[PrepareArtifactData]

Prepare artifacts on the guest.

Note

This is a tech preview feature.

This plugin makes a given artifact available on the guest. This can consist of downloading the artifacts and creating a preferred repository on the guest.

The goal is to make sure these exact artifacts are being used when requested in one of the test require, test recommend, or prepare install. Exact NVR should not be used in those requests, instead this plugin will take care of disambiguating the requested package based on the provided artifacts.

Currently, the following artifact providers are supported:

Koji

Builds from the Fedora Koji build system.

  • koji.build:<build-id> - Koji build by build ID

  • koji.task:<task-id> - Koji task (including scratch builds)

  • koji.nvr:<nvr> - Koji build by NVR (name-version-release)

Example usage:

prepare:
    how: artifact
    provide:
      - koji.build:123456
      - koji.task:654321
      - koji.nvr:openssl-3.2.6-2.fc42

Brew (Red Hat internal)

Builds from the Red Hat Brew build system.

  • brew.build:<build-id> - Brew build by build ID

  • brew.task:<task-id> - Brew task (including scratch builds)

  • brew.nvr:<nvr> - Brew build by NVR

Example usage:

prepare:
    how: artifact
    provide:
      - brew.build:123456
      - brew.task:654321
      - brew.nvr:openssl-3.2.6-2.el10

Copr

Builds from the Fedora Copr build system.

  • copr.build:<build-id>:<chroot> - Copr build by ID and chroot

Example usage:

prepare:
    how: artifact
    provide:
      - copr.build:1784470:fedora-43-x86_64

File

RPMs from local files or remote URLs.

  • file:<path> - Local RPM file(s) specified via path or a glob pattern

  • file:<directory> - All RPMs from a local directory

  • file:<url> - Remote RPM file URL (http/https)

Example usage:

prepare:
    how: artifact
    provide:
      - file:/tmp/my-package.rpm
      - file:/tmp/rpms/*.rpm
      - file:/tmp/rpms
      - file:https://example.com/my-package.rpm

Repository

Remote dnf repositories.

  • repository-file:<url> - URL to a .repo file

Note

The repository-file provider only adds the dnf repository to the guest system, and does not download the RPMs from the repository.

Example usage:

prepare:
    how: artifact
    provide:
      - repository-file:https://example.com/my-repo.repo

Store plugin name, data and parent step

SHARED_REPO_DIR_NAME: ClassVar[str] = 'artifact-shared-repo'
SHARED_REPO_NAME: ClassVar[str] = 'tmt-artifact-shared'
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.

go(*, guest: Guest, environment: Environment | None = None, logger: Logger) PluginOutcome

Prepare the guest (common actions)

class tmt.steps.prepare.artifact.PrepareArtifactData(name: str, how: str, order: int = 50, when: list[str] = <factory>, summary: str | None = None, where: list[str] = <factory>, provide: list[str] = <factory>, default_repository_priority: int = 50)

Bases: PrepareStepData

default_repository_priority: int = 50
provide: list[str]
class tmt.steps.prepare.artifact.RpmArtifactInfo(_raw_artifact: dict[str, str])

Bases: ArtifactInfo

Represents a single RPM package.

property id: str

RPM identifier

property location: str
tmt.steps.prepare.artifact.get_artifact_provider(provider_id: str) type[ArtifactProvider[ArtifactInfo]]