Skip to content

Commit

Permalink
Enable history-undo-dependant.feature and history-undo-obsoletes.feature
Browse files Browse the repository at this point in the history
- Undoing install of dependecies that are not used by anything else is
  now described as `remove-unused`.
- The `undo` command now has `allow_erasing` set which allows to remove
  `postgresql-test-9.6.8-1.module_1710+b535a823.x86_64` but it requires
  the `--ignore-extras` flag because it is not part of the original transaction
  • Loading branch information
kontura committed Jun 10, 2024
1 parent 008e9d7 commit 0fe4515
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
25 changes: 16 additions & 9 deletions dnf-behave-tests/dnf/history-undo-dependant.feature
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
@dnf5
Feature: Transaction history undo

@bz1700529
Scenario: Undo module install with dependent userinstalled package
Given I use repository "dnf-ci-fedora"
And I use repository "dnf-ci-fedora-modular"
# install module that contains postgresql-server
When I execute dnf with args "module install postgresql/server"
Then the exit code is 0
And Transaction contains
| Action | Package |
| install-group | postgresql-server-0:9.6.8-1.module_1710+b535a823.x86_64 |
And I successfully execute dnf with args "module enable postgresql/server"
And I successfully execute dnf with args "install postgresql-server-0:9.6.8-1.module_1710+b535a823.x86_64"
# install package, that requires postgresql-server
When I execute dnf with args "install postgresql-test"
Then the exit code is 0
And I successfully execute dnf with args "install postgresql-test"
# try to undo module install transaction
When I execute dnf with args "history undo last-1"
# the transaction is not supposed to reinstall required packages, but to fail
Then the exit code is 1
And stdout does not contain "Reinstalling\s+: postgresql-server-9\.6\.8-1\.module_1710\+b535a823"
And stderr contains "package postgresql-test-9\.6\.8-1\.module_1710\+b535a823\.x86_64 requires postgresql-server\(x86-64\) = 9\.6\.8-1\.module_1710\+b535a823, but none of the providers can be installed"
And stdout is
"""
<REPOSYNC>
"""
And stderr is
"""
Failed to resolve the transaction:
Extra package 'postgresql-test-9.6.8-1.module_1710+b535a823.x86_64' (with action 'Remove') which is not present in the stored transaction was pulled into the transaction.
You can try to add to command line:
--ignore-extras to allow extra packages in the transaction
"""
9 changes: 5 additions & 4 deletions dnf-behave-tests/dnf/history-undo-obsoletes.feature
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@dnf5
Feature: Transaction history undo with obsoletes

# Package glibc-all-langpacks requires glibc
Expand Down Expand Up @@ -30,10 +31,10 @@ Scenario: Undo with obsoletes
And Transaction is following
| Action | Package |
| remove | glibc-all-langpacks-0:2.28-9.fc29.x86_64 |
| remove-dep | setup-0:2.12.1-1.fc29.noarch |
| remove-unused | setup-0:2.12.1-1.fc29.noarch |
| remove | glibc-0:2.28-9.fc29.x86_64 |
| remove-dep | glibc-common-0:2.28-9.fc29.x86_64 |
| remove-dep | filesystem-0:3.9-2.fc29.x86_64 |
| remove-dep | basesystem-0:11-6.fc29.noarch |
| remove-unused | glibc-common-0:2.28-9.fc29.x86_64 |
| remove-unused | filesystem-0:3.9-2.fc29.x86_64 |
| remove-unused | basesystem-0:11-6.fc29.noarch |
| install | glibc-profile-0:2.3.1-10.x86_64 |

0 comments on commit 0fe4515

Please sign in to comment.