From 2997ff8c84119d9ccd0f1e64e660c0a0ff540ee6 Mon Sep 17 00:00:00 2001 From: Jaroslav Mracek Date: Fri, 16 Feb 2024 14:16:45 +0100 Subject: [PATCH] Create a test for cost install and reinstall Upstream commit: e80830a1ea4065ffda53daa976e3af8c912be464 For: https://issues.redhat.com/browse/RHEL-25005 --- dnf-behave-tests/dnf/repo-cost.feature | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 dnf-behave-tests/dnf/repo-cost.feature diff --git a/dnf-behave-tests/dnf/repo-cost.feature b/dnf-behave-tests/dnf/repo-cost.feature new file mode 100644 index 000000000..7e1ff8cd1 --- /dev/null +++ b/dnf-behave-tests/dnf/repo-cost.feature @@ -0,0 +1,27 @@ +@dnf5 +Feature: Repositories with cost + + +Background: Use repository with cost 1000 + Given I use repository "dnf-ci-priority-1" with configuration + | key | value | + | cost | 1000 | + + +Scenario: Install and reinstall RPM from the lower-cost repository + When I execute dnf with args "--nogpgcheck install flac --repofrompath=cost_900,{context.scenario.repos_location}/dnf-ci-priority-1 --setopt=cost_900.cost=900 --repofrompath=cost_1100,{context.scenario.repos_location}/dnf-ci-priority-1 --setopt=cost_1100.cost=1100" + Then the exit code is 0 + And Transaction is following + | Action | Package | + | install | flac-0:1.3.3-2.fc29.x86_64 | + When I execute dnf with args "repoquery --installed flac --qf='%{{name}} %{{from_repo}}'" + Then the exit code is 0 + And stdout contains "flac cost_900" + When I execute dnf with args "--nogpgcheck reinstall flac --repofrompath=cost_900,{context.scenario.repos_location}/dnf-ci-priority-1 --setopt=cost_900.cost=900 --repofrompath=cost_1100,{context.scenario.repos_location}/dnf-ci-priority-1 --setopt=cost_1100.cost=1100" + Then the exit code is 0 + And Transaction is following + | Action | Package | + | reinstall | flac-0:1.3.3-2.fc29.x86_64 | + When I execute dnf with args "repoquery --installed flac --qf='%{{name}} %{{from_repo}}'" + Then the exit code is 0 + And stdout contains "flac cost_900"