Skip to content

Commit

Permalink
Add scenarios for install with destdir option set
Browse files Browse the repository at this point in the history
  • Loading branch information
m-blaha authored and pkratoch committed Aug 16, 2024
1 parent 6e76572 commit 4363030
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions dnf-behave-tests/dnf/install.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
@dnf5
Feature: RPM installation tests

Background: Set repositories
Given I use repository "simple-base"

# https://github.com/rpm-software-management/dnf5/issues/1620
Scenario: Install an RPM with `destdir` option set
When I execute dnf with args "install labirinto --setopt=destdir={context.dnf.tempdir}/SomeDestination"
Then the exit code is 0
And Transaction is following
| Action | Package |
| install | labirinto-0:1.0-1.fc29.x86_64 |
When I execute "find -type f -name '*.rpm'" in "{context.dnf.tempdir}/SomeDestination"
Then stdout is empty


Scenario: RPMs downloaded with `keepcache` and `destdir` options set are not removed
When I execute dnf with args "install labirinto --setopt=destdir={context.dnf.tempdir}/SomeDestination --setopt=keepcache=true"
Then the exit code is 0
And Transaction is following
| Action | Package |
| install | labirinto-0:1.0-1.fc29.x86_64 |
When I execute "find -type f -name '*.rpm'" in "{context.dnf.tempdir}/SomeDestination"
Then stdout matches line by line
"""
\./labirinto-1\.0-1\.fc29\.x86_64\.rpm
"""


Scenario: Install an RPM with `destdir` option set and `--downloadonly` switch works
When I execute dnf with args "install labirinto --setopt=destdir={context.dnf.tempdir}/SomeDestination --downloadonly"
Then the exit code is 0
And DNF Transaction is following
| Action | Package |
| install | labirinto-0:1.0-1.fc29.x86_64 |
And RPMDB Transaction is empty
When I execute "find -type f -name '*.rpm'" in "{context.dnf.tempdir}/SomeDestination"
Then stdout matches line by line
"""
\./labirinto-1\.0-1\.fc29\.x86_64\.rpm
"""

0 comments on commit 4363030

Please sign in to comment.