Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review tests in microdnf directory #1579

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion dnf-behave-tests/dnf/microdnf/config-with-repos.feature
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@dnf5
@no_installroot
# no bug, PR https://github.com/rpm-software-management/libdnf/pull/882
Feature: Repositories configured in main configuration file

Expand Down
12 changes: 8 additions & 4 deletions dnf-behave-tests/dnf/microdnf/config.feature
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@no_installroot
@destructive
@dnf5
Feature: Respect main config options


Expand Down Expand Up @@ -32,7 +31,7 @@ Given I copy repository "simple-base" for modification
Then the exit code is 0
And HTTP log contains
"""
GET /repodata/primary.xml.gz
GET /repodata/primary.xml.zst
"""


Expand All @@ -46,5 +45,10 @@ Given I use repository "simple-base"
"""
When I execute microdnf with args "--config {context.dnf.installroot}/test/microdnf.conf install labirinto"
Then the exit code is 1
And stderr contains "error: No package matches 'labirinto'"
And stderr is
"""
<REPOSYNC>
Failed to resolve the transaction:
Argument 'labirinto' matches only excluded packages.
"""
And stdout is empty
7 changes: 7 additions & 0 deletions dnf-behave-tests/dnf/microdnf/error_messages.feature
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
@dnf5
Feature: Test error messages


@xfail
# reported as
# https://github.com/rpm-software-management/dnf5/issues/1003
@bz1888946
Scenario: Global option 'proxy_username' is set but not 'proxy_password'
Given I use repository "dnf-ci-fedora"
Expand All @@ -13,6 +17,9 @@ Scenario: Global option 'proxy_username' is set but not 'proxy_password'
And stderr contains "'proxy_username' is set but not 'proxy_password'"


@xfail
# reported as
# https://github.com/rpm-software-management/dnf5/issues/1003
@bz1888946
Scenario: Repository option 'proxy_username' is set but not 'proxy_password'
Given I use repository "dnf-ci-fedora" with configuration
Expand Down
26 changes: 12 additions & 14 deletions dnf-behave-tests/dnf/microdnf/exclude_from_weak.feature
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@dnf5
Feature: Skip exclude_from_weak for weak deps and autodetected exclude_from_weak for unmet weak dependencies of installed packages

Background: Prepare /user dir
Expand All @@ -9,18 +10,17 @@ Scenario: Install step also installs weak deps
Given I use repository "dnf-ci-fedora"
When I execute microdnf with args "install abcde"
Then the exit code is 0
And microdnf transaction is
And transaction is following
| Action | Package |
| install | abcde-0:2.9.2-1.fc29.noarch |
| install-weak | flac-0:1.3.2-8.fc29.x86_64 |
| install-dep | wget-0:1.19.5-5.fc29.x86_64 |
Given I use repository "dnf-ci-fedora-updates"
When I execute microdnf with args "upgrade abcde"
Then the exit code is 0
And microdnf transaction is
And transaction is following
| Action | Package |
| upgrade | abcde-0:2.9.3-1.fc29.noarch |
| upgraded | abcde-0:2.9.2-1.fc29.noarch |

@bz2005305
@bz1699672
Expand All @@ -32,25 +32,24 @@ Scenario: Install without weak dependencies, upgrades ignores unmet weak depende
| exclude_from_weak_autodetect | True |
And I execute microdnf with args "install abcde"
Then the exit code is 0
And microdnf transaction is
And transaction is following
| Action | Package |
| install | abcde-0:2.9.2-1.fc29.noarch |
| install | wget-0:1.19.5-5.fc29.x86_64 |
| install-dep | wget-0:1.19.5-5.fc29.x86_64 |
Given I use repository "dnf-ci-fedora-updates"
When I configure dnf with
| key | value |
| exclude_from_weak | |
| exclude_from_weak_autodetect | True |
And I execute microdnf with args "upgrade abcde"
Then the exit code is 0
And microdnf transaction is
And transaction is following
| Action | Package |
| upgrade | abcde-0:2.9.3-1.fc29.noarch |
| upgraded | abcde-0:2.9.2-1.fc29.noarch |
# Install excluded_from_weak package from exclude_from_weak_autodetect
When I execute microdnf with args "install flac"
Then the exit code is 0
And microdnf transaction is
And transaction is following
| Action | Package |
| install | flac-0:1.3.3-3.fc29.x86_64 |

Expand All @@ -64,20 +63,19 @@ Scenario: Install exclude_from_weak package
| exclude_from_weak_autodetect | True |
And I execute microdnf with args "install abcde"
Then the exit code is 0
And microdnf transaction is
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 |
Given I use repository "dnf-ci-fedora-updates"
When I execute microdnf with args "upgrade abcde"
Then the exit code is 0
And microdnf transaction is
And transaction is following
| Action | Package |
| upgrade | abcde-0:2.9.3-1.fc29.noarch |
| upgraded | abcde-0:2.9.2-1.fc29.noarch |
And I execute microdnf with args "install flac"
Then the exit code is 0
And microdnf transaction is
And transaction is following
| Action | Package |
| install | flac-0:1.3.3-3.fc29.x86_64 |

Expand All @@ -87,7 +85,7 @@ Scenario: Obsoletes are not disabled by exclude_from_weak
Given I use repository "dnf-ci-obsoletes"
When I execute microdnf with args "install PackageB-1.0-1"
Then the exit code is 0
And microdnf transaction is
And transaction is following
| Action | Package |
| install | PackageB-0:1.0-1.x86_64 |
When I configure dnf with
Expand All @@ -96,7 +94,7 @@ Scenario: Obsoletes are not disabled by exclude_from_weak
| exclude_from_weak_autodetect | True |
When I execute microdnf with args "upgrade"
Then the exit code is 0
And microdnf transaction is
And transaction is following
| Action | Package |
| install | PackageB-Obsoleter-0:1.0-1.x86_64 |
| obsoleted | PackageB-0:1.0-1.x86_64 |
Expand Down
1 change: 1 addition & 0 deletions dnf-behave-tests/dnf/microdnf/gpg.feature
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@dnf5
Feature: GPG signatures


Expand Down
13 changes: 0 additions & 13 deletions dnf-behave-tests/dnf/microdnf/install-nodocs-1.feature

This file was deleted.

14 changes: 0 additions & 14 deletions dnf-behave-tests/dnf/microdnf/install-nodocs-2.feature

This file was deleted.

14 changes: 0 additions & 14 deletions dnf-behave-tests/dnf/microdnf/install-nodocs-3.feature

This file was deleted.

35 changes: 35 additions & 0 deletions dnf-behave-tests/dnf/microdnf/install-nodocs.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@dnf5
Feature: microdnf install command on packages


Scenario: Install a documentation package from local repodata
Given I use repository "microdnf-install-nodocs"
When I execute microdnf with args "install man-pages"
Then the exit code is 0
And transaction is following
| Action | Package |
| install | man-pages-0:4.16-3.fc29.x86_64 |
And file "/usr/share/doc/man-pages/README" exists


@bz1769831
Scenario: Install package with option from local repodata with local packages
Given I use repository "microdnf-install-nodocs"
When I execute microdnf with args "--setopt=tsflags=nodocs install man-pages"
Then the exit code is 0
And transaction is following
| Action | Package |
| install | man-pages-0:4.16-3.fc29.x86_64 |
And file "/usr/share/doc/man-pages/README" does not exist


@bz1771012
Scenario: Install package with --nodocs option from local repodata with local packages
Given I use repository "microdnf-install-nodocs"
And I execute microdnf with args "--nodocs install man-pages"
Then the exit code is 0
And transaction is following
| Action | Package |
| install | man-pages-0:4.16-3.fc29.x86_64 |
And file "/usr/share/doc/man-pages/README" does not exist

110 changes: 110 additions & 0 deletions dnf-behave-tests/dnf/microdnf/install.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
@dnf5
Feature: microdnf install command on packages


@bz1734350
@bz1779757
Scenario: Install package from local repodata with local packages
#1. local repo with local packages
Given I use repository "dnf-ci-fedora"
When I execute microdnf with args "install kernel"
Then the exit code is 0
And transaction is following
| Action | Package |
| install-dep | kernel-core-0:4.18.16-300.fc29.x86_64 |
| install-dep | kernel-modules-0:4.18.16-300.fc29.x86_64 |
| install | kernel-0:4.18.16-300.fc29.x86_64 |


@bz1734350
Scenario: Install package from local repodata with local xml:base
#2. local repo with local packages (different package location specified using xml:base)
Given I copy repository "dnf-ci-fedora" for modification
And I generate repodata for repository "dnf-ci-fedora" with extra arguments "--baseurl file://{context.dnf.installroot}/xml_base/dnf-ci-fedora"
And I use repository "dnf-ci-fedora"
And I copy directory "{context.dnf.repos[dnf-ci-fedora].path}" to "/xml_base/dnf-ci-fedora"
When I execute microdnf with args "install kernel"
Then the exit code is 0
And transaction is following
| Action | Package |
| install-dep | kernel-core-0:4.18.16-300.fc29.x86_64 |
| install-dep | kernel-modules-0:4.18.16-300.fc29.x86_64 |
| install | kernel-0:4.18.16-300.fc29.x86_64 |
And file "/xml_base/dnf-ci-fedora/x86_64/kernel-4.18.16-300.fc29.x86_64.rpm" exists


@bz1734350
Scenario: Install package from local repodata with xml:base pointing to remote packages
#3. local repo with remote packages (different package location specified using xml:base)
Given I make packages from repository "dnf-ci-fedora" accessible via http
And I copy repository "dnf-ci-fedora" for modification
And I generate repodata for repository "dnf-ci-fedora" with extra arguments "--baseurl http://localhost:{context.dnf.ports[dnf-ci-fedora]}"
And I use repository "dnf-ci-fedora"
When I execute microdnf with args "install kernel"
Then the exit code is 0
And transaction is following
| Action | Package |
| install-dep | kernel-core-0:4.18.16-300.fc29.x86_64 |
| install-dep | kernel-modules-0:4.18.16-300.fc29.x86_64 |
| install | kernel-0:4.18.16-300.fc29.x86_64 |


@bz1734350
Scenario: Install packages from local repodata that have packages with xml:base pointing to a remote as well as local packages
#4. local repo with local and remote packages; installing both at the same time.
Given I make packages from repository "dnf-ci-fedora" accessible via http
And I copy repository "dnf-ci-fedora" for modification
And I copy repository "dnf-ci-thirdparty" for modification
And I generate repodata for repository "dnf-ci-fedora" with extra arguments "--baseurl http://localhost:{context.dnf.ports[dnf-ci-fedora]}"
And I execute "mergerepo_c --repo file://{context.dnf.repos[dnf-ci-fedora].path} --repo file://{context.dnf.repos[dnf-ci-thirdparty].path}" in "{context.dnf.installroot}"
And I configure a new repository "merged-repo" with
| key | value |
| baseurl | file://{context.dnf.installroot}/merged_repo |
When I execute microdnf with args "install kernel alternator"
Then the exit code is 0
And transaction is following
| Action | Package |
| install-dep | kernel-core-0:4.18.16-300.fc29.x86_64 |
| install-dep | kernel-modules-0:4.18.16-300.fc29.x86_64 |
| install | kernel-0:4.18.16-300.fc29.x86_64 |
| install | alternator-0:1.1-1.x86_64 |


@bz1734350
Scenario: Install packages from remote repodata with remote packages
#5. remote repo with remote packages
Given I use repository "dnf-ci-fedora" as http
When I execute microdnf with args "remove lame"
When I execute microdnf with args "install lame"
Then the exit code is 0
And transaction is following
| Action | Package |
| install | lame-0:3.100-4.fc29.x86_64 |
| install-dep | lame-libs-0:3.100-4.fc29.x86_64 |


@bz1734350
Scenario: Install packages from remote repodata with xml:base pointing to packages on different remote
#6. remote repo with remote packages (different package location (different url) specified using xml:base)
Given I make packages from repository "dnf-ci-fedora" accessible via http
And I copy repository "dnf-ci-fedora" for modification
And I generate repodata for repository "dnf-ci-fedora" with extra arguments "--baseurl http://localhost:{context.dnf.ports[dnf-ci-fedora]}"
And I use repository "dnf-ci-fedora" as http
And I execute microdnf with args "install dwm"
Then the exit code is 0
And transaction is following
| Action | Package |
| install | dwm-0:6.1-1.x86_64 |


@bz1855542
@bz1725863
Scenario: Install a package specifying a lower version than currently installed
Given I use repository "dnf-ci-fedora"
And I use repository "dnf-ci-fedora-updates"
And I successfully execute microdnf with args "install flac"
When I execute microdnf with args "install flac-1.3.2-8.fc29"
Then the exit code is 0
And transaction is following
| Action | Package |
| downgrade | flac-0:1.3.2-8.fc29.x86_64 |
16 changes: 0 additions & 16 deletions dnf-behave-tests/dnf/microdnf/install1.feature

This file was deleted.

19 changes: 0 additions & 19 deletions dnf-behave-tests/dnf/microdnf/install2.feature

This file was deleted.

Loading
Loading