tmt icon indicating copy to clipboard operation
tmt copied to clipboard

The `feature` plugin for `epel` does not work on command line

Open psss opened this issue 1 year ago • 1 comments

Seems that the feature plugin for epel is broken when called from the command line:

tmt run provision --how container --image centos:stream9 prepare --how feature --epel enabled login finish

Results into:

prepare
    prepare task #1: default-0 on default-0
    how: feature
    Enable EPEL
    fail: 

Works nicely when provided as a plan:

provision:
    how: container
    image: centos:stream9
prepare:
  - how: feature
    epel: enabled
  - how: install
    package: beakerlib
execute:
    how: tmt
    script: rpm -q beakerlib

psss avatar Jun 20 '24 14:06 psss

The issue appears to be caused by a missing fmf root. When the command-line option is used and the .fmf directory is not found, the root is set to None, leading to a failure at this line. The root is required when creating a relative path to the playbook here and here.

If we run the same command in a directory where the fmf tree exists, it seems to work correctly.

tmt init
tmt run provision --how container --image centos:stream9 prepare --how feature --epel enabled login finish

Results into:

prepare
    queued push task #1: push to default-0
    
    push task #1: push to default-0

    queued prepare task #1: default-0 on default-0
    queued prepare task #2: requires on default-0
    
    prepare task #1: default-0 on default-0
    how: feature
    Enable EPEL
    
    prepare task #2: requires on default-0
    how: install
    summary: Install required packages
    name: requires
    where: default-0
    package: /usr/bin/flock

    queued pull task #1: pull from default-0
    
    pull task #1: pull from default-0

    summary: 2 preparations applied

How should we handle this? Should we improve the error message or use a different path when the fmf root is not found?

therazix avatar Jul 10 '24 11:07 therazix

Keeping open as per https://github.com/teemtee/tmt/pull/3126#issuecomment-2322094388

martinhoyer avatar Sep 04 '24 09:09 martinhoyer

Just verified with tmt-1.36 that applying the epel playbook works nicely even outside of an fmf tree. The use case above has been fixed by 3126 and now works as expected.

psss avatar Sep 13 '24 14:09 psss