Skip to content

Commit

Permalink
Fix recommended packages handling for rpm-ostree
Browse files Browse the repository at this point in the history
Bugfix for missing packages install failure on recommends fmf
request, missing should retrieve parent.missing attribute not
packages. Extend the test coverage for fedora-coreos as well.

Co-authored-by: Petr Šplíchal <[email protected]>
  • Loading branch information
BeeGrech and psss committed Oct 10, 2022
1 parent 2d11678 commit b04414f
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
11 changes: 11 additions & 0 deletions tests/prepare/recommend/main.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,14 @@ description:
Run a simple test which recommends two packages. Check that
the existing one is installed and the other one is ignored. No
error should be reported.
environment:
METHODS: container
adjust:
- when: trigger == commit
environment:
METHODS: container local
because: the pipeline does not support nested virtualization
- when: how == full
environment:
METHODS: container virtual local
because: local/virtual provision needs root/full virtualization
25 changes: 22 additions & 3 deletions tests/prepare/recommend/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,29 @@ rlJournalStart
rlRun "pushd data"
rlPhaseEnd

for image in centos:7 centos:stream8 fedora; do
rlPhaseStartTest "Test $image"
rlRun "tmt run -ar provision -h container -i $image"
for method in ${METHODS:-container}; do
tmt="tmt run --all --remove provision --how $method"

# Verify against the default provision image
rlPhaseStartTest "Test the default image ($method)"
rlRun "$tmt"
rlPhaseEnd

# Check CentOS images for container provision
if [[ "$method" == "container" ]]; then
for image in centos:7 centos:stream8; do
rlPhaseStartTest "Test $image ($method)"
rlRun "$tmt --image $image"
rlPhaseEnd
done
fi

# Add one extra CoreOS run for virtual provision
if [[ "$method" == "virtual" ]]; then
rlPhaseStartTest "Test fedora-coreos ($method)"
rlRun "$tmt --image fedora-coreos"
rlPhaseEnd
fi
done

rlPhaseStartCleanup
Expand Down
2 changes: 1 addition & 1 deletion tmt/steps/prepare/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def sort_packages(self) -> None:

def prepare_command(self) -> None:
""" Prepare installation command for rpm-ostree"""
missing = cast(tmt.steps.prepare.PreparePlugin, self.parent).get("package")
missing = cast(tmt.steps.prepare.PreparePlugin, self.parent).get("missing")
self.skip = True if missing == 'skip' else False
self.command = f"{self.sudo}rpm-ostree"
self.options = '--apply-live --idempotent --allow-inactive'
Expand Down

0 comments on commit b04414f

Please sign in to comment.