Skip to content

Commit

Permalink
Add extended test for installonly packages
Browse files Browse the repository at this point in the history
The original test is ok, but this test is for a random behavior of the code,
therefore it uses more additional packages in test to triger random behavior.

Required for: https://issues.redhat.com/browse/RHEL-15902
  • Loading branch information
j-mracek committed Mar 11, 2024
1 parent 3c34da3 commit 93098a3
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions dnf-behave-tests/dnf/installonly.feature
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,58 @@ Scenario: Do not remove or change reason after remove of one of installonly pack
| action | package | reason | repository |
| Remove | kernel-core-0:4.19.15-300.fc29.x86_64 | User | @System |

# https://issues.redhat.com/browse/RHEL-15902
# The test expects that installed packages in pool are in order in which they were installed. This is required for fail
# without patch but it is not guaranteed by RPM
Scenario: Do not remove or change reason after remove of one of installonly packages - more complex
When I execute dnf with args "install abcde"
Then the exit code is 0
And Transaction is following
| Action | Package |
| install | abcde-0:2.9.2-1.fc29.noarch |
| install-dep | wget-0:1.19.5-5.fc29.x86_64 |
| install-weak | flac-0:1.3.2-8.fc29.x86_64 |
When I execute dnf with args "mark remove abcde"
Then the exit code is 0
And package reasons are
| Package | Reason |
| abcde-2.9.2-1.fc29.noarch | dependency |
| flac-1.3.2-8.fc29.x86_64 | weak-dependency |
| wget-1.19.5-5.fc29.x86_64 | dependency |
Given I use repository "dnf-ci-fedora-updates"
When I execute dnf with args "install kernel-core-0:4.18.16-300.fc29.x86_64 kernel-core-0:4.19.15-300.fc29.x86_64"
Then the exit code is 0
And Transaction is following
| Action | Package |
| install | kernel-core-0:4.18.16-300.fc29.x86_64 |
| install | kernel-core-0:4.19.15-300.fc29.x86_64 |
When I execute dnf with args "upgrade kernel-core"
Then the exit code is 0
And package reasons are
| Package | Reason |
| abcde-2.9.2-1.fc29.noarch | dependency |
| flac-1.3.2-8.fc29.x86_64 | weak-dependency |
| kernel-core-4.18.16-300.fc29.x86_64 | user |
| kernel-core-4.19.15-300.fc29.x86_64 | user |
| wget-1.19.5-5.fc29.x86_64 | dependency |
And dnf5 transaction items for transaction "last" are
| action | package | reason | repository |
| Install | kernel-core-0:4.19.15-300.fc29.x86_64 | User | dnf-ci-fedora-updates |
When I execute dnf with args "remove kernel-core-0:4.19.15-300.fc29.x86_64"
Then the exit code is 0
And Transaction is following
| Action | Package |
| remove | kernel-core-0:4.19.15-300.fc29.x86_64 |
| unchanged | kernel-core-0:4.18.16-300.fc29.x86_64 |
And package reasons are
| Package | Reason |
| abcde-2.9.2-1.fc29.noarch | dependency |
| flac-1.3.2-8.fc29.x86_64 | weak-dependency |
| kernel-core-4.18.16-300.fc29.x86_64 | user |
| wget-1.19.5-5.fc29.x86_64 | dependency |
And dnf5 transaction items for transaction "last" are
| action | package | reason | repository |
| Remove | kernel-core-0:4.19.15-300.fc29.x86_64 | User | @System |

# TODO(jkolarik): autoremove not yet available in dnf5
# @dnf5
Expand Down

0 comments on commit 93098a3

Please sign in to comment.