Skip to content

Commit

Permalink
Add tests for history rollback between states with the same version o…
Browse files Browse the repository at this point in the history
…f a package installed

- dnf5 history list doesn't fill in actions: https://github.com/rpm-software-management/dnf5/iss
- There is a change in one `Altered` count because dnf4 doesn't
  count/list `Upgraded` and `Downgraded` actions. dnf5 on the other hand
  shows the `Replaced` action which is their equivalent.
  • Loading branch information
jan-kolarik authored and evan-goode committed Jul 2, 2024
1 parent 8b19282 commit 7e3e2ca
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions dnf-behave-tests/dnf/history-rollback-same-package.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
@dnf5
Feature: Transaction history rollback between states with the same version of a package installed


Background:
Given I use repository "dnf-ci-fedora"
And I successfully execute dnf with args "install flac"


# https://github.com/rpm-software-management/dnf/issues/2031
@GH-2031
Scenario: Rollback removal and installation of the same package
Given I successfully execute dnf with args "remove flac"
And I successfully execute dnf with args "install flac"
And I successfully execute dnf with args "history list"
Then stdout is history list
| Id | Command | Action | Altered |
| 3 | | | 1 |
| 2 | | | 1 |
| 1 | | | 1 |
Given I successfully execute dnf with args "history rollback 1"
Then Transaction is empty


# https://issues.redhat.com/browse/RHEL-17494
@RHEL-17494
Scenario: Two rollbacks of the package upgrade
Given I use repository "dnf-ci-fedora-updates"
And I successfully execute dnf with args "upgrade flac"
And I successfully execute dnf with args "history list"
Then stdout is history list
| Id | Command | Action | Altered |
| 2 | | | 2 |
| 1 | | | 1 |
Given I successfully execute dnf with args "history rollback 1"
Then Transaction is following
| Action | Package |
| downgrade | flac-1.3.2-8.fc29.x86_64 |
Given I successfully execute dnf with args "history rollback 1"
Then Transaction is empty

0 comments on commit 7e3e2ca

Please sign in to comment.