Skip to content

Artifact install plugin does not update an already installed package #4838

@psss

Description

@psss

When a required package is already installed on the system, the artifact install plugin does not update or replace it and fails. Here's a simple reproducer:

/plan:
    discover:
        how: fmf
    provision:
        how: container
        image: fedora:43
    prepare:
        how: artifact
        provide: koji.build:2971867
    execute:
        how: tmt

/test:
    test: rpm -q vim-minimal
    require: vim-minimal

This is caused by the rpm -q check causing the install command to be completely skipped. But even if we drop the check, which is one of the solutions proposed in #4421, dnf5 install would just report the package is already installed and do nothing.

    prepare task #3: requires on default-0
    how: install
    summary: Install required packages
    name: requires
    order: 70
    where: default-0
    package: 1 package requested
        vim-minimal
        cmd: false || dnf5 install -y  vim-minimal
        stderr: Updating and loading repositories:
        stderr:  tmt-artifact-shared                    100% |   2.5 MiB/s |  10.2 KiB |  00m00s
        stderr: Repositories loaded.
        stderr: Package "vim-minimal-2:9.2.390-1.fc43.x86_64" is already installed.
        stdout: Nothing to do.
        stderr: 

    prepare task #4: verify-artifact-packages on default-0
    how: verify-installation
    summary: Verify test requirement packages were installed from the correct artifact repositories
    name: verify-artifact-packages
    order: 79
    1 package
        cmd: dnf5 repoquery --installed --queryformat '%{name} %{from_repo}\n' vim-minimal
        stdout: vim-minimal 4dc5ee694bfc47f9bbc228ba4d3c714d
    Package source verification failed for: vim-minimal
report
    how: display
    order: 50
    prepare
        ..:..:.. fail verify-artifact-packages / vim-minimal
            Note: Package 'vim-minimal': expected repo 'tmt-artifact-shared', actual '4dc5ee694bfc47f9bbc228ba4d3c714d'.

Metadata

Metadata

Assignees

Labels

plugin | artifactRelated to the `prepare/artifact` plugin.step | prepareStuff related to the prepare step

Type

Projects

Status

backlog

Status

triaged

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions