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

Update dnf4 tests for Fedora 41+ #1569

Merged
merged 5 commits into from
Oct 31, 2024
Merged
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
12 changes: 11 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,19 @@ RUN set -x && \
# copy test suite
COPY ./dnf-behave-tests/ /opt/ci/dnf-behave-tests

# remove dnf5 and exclude it to ensure we test old dnf
RUN set -x && \
dnf -y remove dnf5 --setopt=protected_packages=,; \
echo "excludepkgs=dnf5*" >> /etc/dnf/dnf.conf

# On Fedora > 40 the symlinks to dnf-3 and yum are missing (because dnf5 provides dnf), add them manually
RUN set -x && \
ln -sf /usr/bin/dnf-3 /usr/bin/dnf; \
ln -sf /usr/bin/dnf-3 /usr/bin/yum

jan-kolarik marked this conversation as resolved.
Show resolved Hide resolved
# install test suite dependencies
RUN set -x && \
dnf -y builddep /opt/ci/dnf-behave-tests/requirements.spec --exclude=dnf5 && \
dnf -y builddep /opt/ci/dnf-behave-tests/requirements.spec && \
pip3 install -r /opt/ci/dnf-behave-tests/requirements.txt

# install local RPMs if available
Expand Down
4 changes: 3 additions & 1 deletion dnf-behave-tests/dnf/config.feature
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ Scenario: Dnf can use config file from remote location


@bz1721091
# Since the Curl error messages were updated in f41 run the test only there
@not.with_os=fedora__lt__41
Scenario: Dnf prints reasonable error when remote config file is not downloadable
Given I create directory "/remotedir"
And I set up a http server for directory "/remotedir"
Expand All @@ -203,7 +205,7 @@ Scenario: Dnf prints reasonable error when remote config file is not downloadabl
And stderr matches line by line
"""
Config error: Configuration file URL "http://the_host:[\d]+/does-not-exist\.conf" could not be downloaded:
Curl error \(6\): Couldn't resolve host name for http://the_host:[\d]+/does-not-exist\.conf \[Could not resolve host: the_host\]
Curl error \(6\): Could not resolve hostname for http://the_host:[\d]+/does-not-exist\.conf \[Could not resolve host: the_host\]
"""


Expand Down
2 changes: 2 additions & 0 deletions dnf-behave-tests/dnf/dnf-automatic/error-report.feature
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@not.with_os=fedora__ge__41
# dnf-automatic disabled by https://github.com/rpm-software-management/dnf/pull/2129
@no_installroot
Feature: dnf-automatic reports an error when transaction failed

Expand Down
2 changes: 2 additions & 0 deletions dnf-behave-tests/dnf/dnf-automatic/update.feature
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@not.with_os=fedora__ge__41
# dnf-automatic disabled by https://github.com/rpm-software-management/dnf/pull/2129
@no_installroot
Feature: dnf-automatic performs update

Expand Down
10 changes: 5 additions & 5 deletions dnf-behave-tests/dnf/download-source.feature
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ Given I create directory "/baseurlrepo"
And stderr is empty


# @dnf5
# TODO(nsella) Unknown argument "makecache" for command "microdnf"
# Since the Curl error messages were updated in f41 run the test only there
@not.with_os=fedora__lt__41
Scenario: no working donwload source result in an error
Given I create directory "/baseurlrepo"
And I execute "createrepo_c {context.dnf.installroot}/baseurlrepo"
Expand All @@ -71,9 +71,9 @@ Given I create directory "/baseurlrepo"
When I execute dnf with args "makecache"
Then the exit code is 1
And stderr contains "Errors during downloading metadata for repository 'testrepo':"
And stderr contains "- Curl error \(37\): Couldn't read a file:// file for file:///nonexistent.repo/repodata/repomd.xml \[Couldn't open file /nonexistent.repo/repodata/repomd.xml\]"
And stderr contains "- Curl error \(7\): Couldn't connect to server for http://127.0.0.1:5000/nonexistent/repodata/repomd.xml \[Failed to connect to 127.0.0.1 port 5000 after 0 ms: Couldn't connect to server]"
And stderr contains "- Curl error \(37\): Couldn't read a file:// file for file:///tmp/dnf_ci_installroot_.*/I_dont_exist/repodata/repomd.xml \[Couldn't open file /tmp/dnf_ci_installroot_.*/I_dont_exist/repodata/repomd.xml\]"
And stderr contains "- Curl error \(37\): Could not read a file:// file for file:///nonexistent.repo/repodata/repomd.xml \[Couldn't open file /nonexistent.repo/repodata/repomd.xml\]"
And stderr contains "- Curl error \(7\): Could not connect to server for http://127.0.0.1:5000/nonexistent/repodata/repomd.xml \[Failed to connect to 127.0.0.1 port 5000 after 0 ms: Could not connect to server]"
And stderr contains "- Curl error \(37\): Could not read a file:// file for file:///tmp/dnf_ci_installroot_.*/I_dont_exist/repodata/repomd.xml \[Couldn't open file /tmp/dnf_ci_installroot_.*/I_dont_exist/repodata/repomd.xml\]"
And stderr contains "Error: Failed to download metadata for repo 'testrepo': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried"


Expand Down
2 changes: 2 additions & 0 deletions dnf-behave-tests/dnf/encoding.feature
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Scenario: UTF-8 characters in .repo filename
# @dnf5
# TODO(nsella) different stderr
@bz1803038
# Reported as https://github.com/swig/swig/issues/3051
@not.with_os=fedora__ge__41
Scenario: non-UTF-8 characters in .repo filename
Given I configure dnf with
| key | value |
Expand Down
4 changes: 3 additions & 1 deletion dnf-behave-tests/dnf/microdnf/makecache.feature
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ Scenario: Tests that "repoquery" downloads metadata (creates a cache) and then "
"""


# Since the Curl error messages were updated in f41 run the test only there
@not.with_os=fedora__lt__41
Scenario: makecache with skip_if_unavailable=0 repo doesn't succeed
Given I configure a new repository "non-existent" with
| key | value |
Expand All @@ -48,5 +50,5 @@ Given I configure a new repository "non-existent" with
"""
And stderr is
"""
error: cannot update repo 'non-existent': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried; Last error: Curl error (6): Couldn't resolve host name for https://www.not-available-repo.com/repodata/repomd.xml [Could not resolve host: www.not-available-repo.com]
error: cannot update repo 'non-existent': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried; Last error: Curl error (6): Could not resolve hostname for https://www.not-available-repo.com/repodata/repomd.xml [Could not resolve host: www.not-available-repo.com]
"""
4 changes: 3 additions & 1 deletion dnf-behave-tests/dnf/microdnf/reinstall4.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Feature: Reinstall


# Since the Curl error messages were updated in f41 run the test only there
@not.with_os=fedora__lt__41
Scenario: Try to reinstall a pkg if repo not available
Given I use repository "simple-base"
And I successfully execute microdnf with args "install labirinto"
Expand All @@ -12,5 +14,5 @@ Scenario: Try to reinstall a pkg if repo not available
Then the exit code is 1
And stderr is
"""
error: cannot update repo 'simple-base': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried; Last error: Curl error (6): Couldn't resolve host name for https://www.not-available-repo.com/repodata/repomd.xml [Could not resolve host: www.not-available-repo.com]
error: cannot update repo 'simple-base': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried; Last error: Curl error (6): Could not resolve hostname for https://www.not-available-repo.com/repodata/repomd.xml [Could not resolve host: www.not-available-repo.com]
"""
4 changes: 3 additions & 1 deletion dnf-behave-tests/dnf/microdnf/reinstall5.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Feature: Reinstall


# Since the Curl error messages were updated in f41 run the test only there
@not.with_os=fedora__lt__41
Scenario: Try to reinstall a pkg if repo not available
Given I use repository "simple-base"
And I successfully execute microdnf with args "install labirinto"
Expand All @@ -14,5 +16,5 @@ Scenario: Try to reinstall a pkg if repo not available
Then the exit code is 1
And stderr is
"""
error: cannot update repo 'non-existent': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried; Last error: Curl error (6): Couldn't resolve host name for https://www.not-available-repo.com/repodata/repomd.xml [Could not resolve host: www.not-available-repo.com]
error: cannot update repo 'non-existent': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried; Last error: Curl error (6): Could not resolve hostname for https://www.not-available-repo.com/repodata/repomd.xml [Could not resolve host: www.not-available-repo.com]
"""
2 changes: 2 additions & 0 deletions dnf-behave-tests/dnf/plugins-core/debug-dump.feature
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@not.with_os=fedora__ge__41
# The plugin was disabled by https://github.com/rpm-software-management/dnf-plugins-core/pull/541
Feature: Test for debug plugin - dumping


Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@not.with_os=fedora__ge__41
# The plugin was disabled by https://github.com/rpm-software-management/dnf-plugins-core/pull/541
Feature: Test for debug plugin - restoring obsoleted package


Expand Down
2 changes: 2 additions & 0 deletions dnf-behave-tests/dnf/plugins-core/debug-restore.feature
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@not.with_os=fedora__ge__41
# The plugin was disabled by https://github.com/rpm-software-management/dnf-plugins-core/pull/541
Feature: Test for debug plugin - restoring


Expand Down
46 changes: 30 additions & 16 deletions dnf-behave-tests/dnf/repo-sync.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Feature: Tests for the repository syncing functionality
@bz1763663
@bz1679509
@bz1692452
# Since the Curl error messages were updated in f41 run the test only there
@not.with_os=fedora__lt__41
Scenario: The default value of skip_if_unavailable is False
Given I configure dnf with
| key | value |
Expand All @@ -17,11 +19,13 @@ Scenario: The default value of skip_if_unavailable is False
And stderr is
"""
Errors during downloading metadata for repository 'testrepo':
- Curl error (37): Couldn't read a file:// file for file:///non/existent/repo/repodata/repomd.xml [Couldn't open file /non/existent/repo/repodata/repomd.xml]
- Curl error (37): Could not read a file:// file for file:///non/existent/repo/repodata/repomd.xml [Couldn't open file /non/existent/repo/repodata/repomd.xml]
Error: Failed to download metadata for repo 'testrepo': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
"""


# Since the Curl error messages were updated in f41 run the test only there
@not.with_os=fedora__lt__41
@bz1689931
Scenario: There is global skip_if_unavailable option
Given I configure dnf with
Expand All @@ -41,12 +45,14 @@ Scenario: There is global skip_if_unavailable option
And stderr is
"""
Errors during downloading metadata for repository 'testrepo':
- Curl error (37): Couldn't read a file:// file for file:///non/existent/repo/repodata/repomd.xml [Couldn't open file /non/existent/repo/repodata/repomd.xml]
- Curl error (37): Could not read a file:// file for file:///non/existent/repo/repodata/repomd.xml [Couldn't open file /non/existent/repo/repodata/repomd.xml]
Error: Failed to download metadata for repo 'testrepo': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
Ignoring repositories: testrepo
"""


# Since the Curl error messages were updated in f41 run the test only there
@not.with_os=fedora__lt__41
Scenario: Per repo skip_if_unavailable configuration
Given I configure dnf with
| key | value |
Expand All @@ -65,13 +71,15 @@ Scenario: Per repo skip_if_unavailable configuration
And stderr is
"""
Errors during downloading metadata for repository 'testrepo':
- Curl error (37): Couldn't read a file:// file for file:///non/existent/repo/repodata/repomd.xml [Couldn't open file /non/existent/repo/repodata/repomd.xml]
- Curl error (37): Could not read a file:// file for file:///non/existent/repo/repodata/repomd.xml [Couldn't open file /non/existent/repo/repodata/repomd.xml]
Error: Failed to download metadata for repo 'testrepo': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
Ignoring repositories: testrepo
"""


@bz1689931
# Since the Curl error messages were updated in f41 run the test only there
@not.with_os=fedora__lt__41
Scenario: The repo configuration takes precedence over the global one
Given I configure dnf with
| key | value |
Expand All @@ -86,22 +94,24 @@ Scenario: The repo configuration takes precedence over the global one
And stderr is
"""
Errors during downloading metadata for repository 'testrepo':
- Curl error (37): Couldn't read a file:// file for file:///non/existent/repo/repodata/repomd.xml [Couldn't open file /non/existent/repo/repodata/repomd.xml]
- Curl error (37): Could not read a file:// file for file:///non/existent/repo/repodata/repomd.xml [Couldn't open file /non/existent/repo/repodata/repomd.xml]
Error: Failed to download metadata for repo 'testrepo': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
"""


@bz1741442
@bz1752362
# Since the Curl error messages were updated in f41 run the test only there
@not.with_os=fedora__lt__41
Scenario: Test repo_gpgcheck=1 error if repomd.xml.asc is not present
Given I use repository "dnf-ci-fedora" with configuration
| key | value |
| repo_gpgcheck | 1 |
When I execute dnf with args "makecache"
Then the exit code is 1
And stderr contains "Errors during downloading metadata for repository 'dnf-ci-fedora':"
And stderr contains " - Curl error \(37\): Couldn't read a file:// file for file://.*/dnf-ci-fedora/repodata/repomd.xml.asc \[Couldn't open file .*/dnf-ci-fedora/repodata/repomd.xml.asc\]"
And stderr contains "Error: Failed to download metadata for repo 'dnf-ci-fedora': GPG verification is enabled, but GPG signature is not available. This may be an error or the repository does not support GPG verification: Curl error \(37\): Couldn't read a file:// file for file://.*/dnf-ci-fedora/repodata/repomd.xml.asc \[Couldn't open file .*/dnf-ci-fedora/repodata/repomd.xml.asc\]"
And stderr contains " - Curl error \(37\): Could not read a file:// file for file://.*/dnf-ci-fedora/repodata/repomd.xml.asc \[Couldn't open file .*/dnf-ci-fedora/repodata/repomd.xml.asc\]"
And stderr contains "Error: Failed to download metadata for repo 'dnf-ci-fedora': GPG verification is enabled, but GPG signature is not available. This may be an error or the repository does not support GPG verification: Curl error \(37\): Could not read a file:// file for file://.*/dnf-ci-fedora/repodata/repomd.xml.asc \[Couldn't open file .*/dnf-ci-fedora/repodata/repomd.xml.asc\]"


@bz1713627
Expand All @@ -125,6 +135,8 @@ Scenario: Missing baseurl/metalink/mirrorlist

@bz1605117
@bz1713627
# Since the Curl error messages were updated in f41 run the test only there
@not.with_os=fedora__lt__41
Scenario: Nonexistent GPG key
Given I use repository "dnf-ci-fedora" with configuration
| key | value |
Expand All @@ -133,19 +145,21 @@ Scenario: Nonexistent GPG key
When I execute dnf with args "makecache"
Then the exit code is 1
And stderr contains "Errors during downloading metadata for repository 'dnf-ci-fedora':"
And stderr contains " - Curl error \(37\): Couldn't read a file:// file for file:///nonexistentkey \[Couldn't open file /nonexistentkey\]"
And stderr contains " - Curl error \(37\): Couldn't read a file:// file for .*repomd.xml.asc \[Couldn't open file .*repomd.xml.asc\]"
And stderr contains " - Curl error \(37\): Could not read a file:// file for file:///nonexistentkey \[Couldn't open file /nonexistentkey\]"
And stderr contains " - Curl error \(37\): Could not read a file:// file for .*repomd.xml.asc \[Couldn't open file .*repomd.xml.asc\]"
And stderr contains "Error: Failed to retrieve GPG key for repo 'dnf-ci-fedora'"
When I execute dnf with args "makecache --setopt=*.skip_if_unavailable=1"
Then the exit code is 0
And stderr contains "Errors during downloading metadata for repository 'dnf-ci-fedora':"
And stderr contains " - Curl error \(37\): Couldn't read a file:// file for file:///nonexistentkey \[Couldn't open file /nonexistentkey\]"
And stderr contains " - Curl error \(37\): Couldn't read a file:// file for .*repomd.xml.asc \[Couldn't open file .*repomd.xml.asc\]"
And stderr contains " - Curl error \(37\): Could not read a file:// file for file:///nonexistentkey \[Couldn't open file /nonexistentkey\]"
And stderr contains " - Curl error \(37\): Could not read a file:// file for .*repomd.xml.asc \[Couldn't open file .*repomd.xml.asc\]"
And stderr contains "Error: Failed to retrieve GPG key for repo 'dnf-ci-fedora'"
And stderr contains "Ignoring repositories: dnf-ci-fedora"


@bz1713627
# Since the Curl error messages were updated in f41 run the test only there
@not.with_os=fedora__lt__41
Scenario: Mirrorlist with invalid mirrors
Given I create file "/tmp/mirrorlist" with
"""
Expand All @@ -160,16 +174,16 @@ Scenario: Mirrorlist with invalid mirrors
When I execute dnf with args "makecache"
Then the exit code is 1
And stderr contains "Errors during downloading metadata for repository 'dnf-ci-fedora':"
And stderr contains " - Curl error \(37\): Couldn't read a file:// file for file:///nonexistent.repo/repodata/repomd.xml \[Couldn't open file /nonexistent.repo/repodata/repomd.xml\]"
And stderr contains " - Curl error \(7\): Couldn't connect to server for http://127.0.0.1:5000/nonexistent/repodata/repomd.xml \[Failed to connect to 127.0.0.1 port 5000 after 0 ms: Couldn't connect to server\]"
And stderr contains " - Curl error \(37\): Couldn't read a file:// file for file:///nonexistent.repo/repodata/repomd.xml \[Couldn't open file /nonexistent.repo/repodata/repomd.xml\]"
And stderr contains " - Curl error \(37\): Could not read a file:// file for file:///nonexistent.repo/repodata/repomd.xml \[Couldn't open file /nonexistent.repo/repodata/repomd.xml\]"
And stderr contains " - Curl error \(7\): Could not connect to server for http://127.0.0.1:5000/nonexistent/repodata/repomd.xml \[Failed to connect to 127.0.0.1 port 5000 after 0 ms: Could not connect to server\]"
And stderr contains " - Curl error \(37\): Could not read a file:// file for file:///nonexistent.repo/repodata/repomd.xml \[Couldn't open file /nonexistent.repo/repodata/repomd.xml\]"
And stderr contains "Error: Failed to download metadata for repo 'dnf-ci-fedora': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried"
When I execute dnf with args "makecache --setopt=*.skip_if_unavailable=1"
Then the exit code is 0
And stderr contains "Errors during downloading metadata for repository 'dnf-ci-fedora':"
And stderr contains " - Curl error \(37\): Couldn't read a file:// file for file:///nonexistent.repo/repodata/repomd.xml \[Couldn't open file /nonexistent.repo/repodata/repomd.xml\]"
And stderr contains " - Curl error \(7\): Couldn't connect to server for http://127.0.0.1:5000/nonexistent/repodata/repomd.xml \[Failed to connect to 127.0.0.1 port 5000 after 0 ms: Couldn't connect to server\]"
And stderr contains " - Curl error \(37\): Couldn't read a file:// file for file:///nonexistent.repo/repodata/repomd.xml \[Couldn't open file /nonexistent.repo/repodata/repomd.xml\]"
And stderr contains " - Curl error \(37\): Could not read a file:// file for file:///nonexistent.repo/repodata/repomd.xml \[Couldn't open file /nonexistent.repo/repodata/repomd.xml\]"
And stderr contains " - Curl error \(7\): Could not connect to server for http://127.0.0.1:5000/nonexistent/repodata/repomd.xml \[Failed to connect to 127.0.0.1 port 5000 after 0 ms: Could not connect to server\]"
And stderr contains " - Curl error \(37\): Could not read a file:// file for file:///nonexistent.repo/repodata/repomd.xml \[Couldn't open file /nonexistent.repo/repodata/repomd.xml\]"
And stderr contains "Error: Failed to download metadata for repo 'dnf-ci-fedora': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried"
And stderr contains "Ignoring repositories: dnf-ci-fedora"

Expand Down
10 changes: 5 additions & 5 deletions dnf-behave-tests/dnf/transaction-output.feature
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ Scenario: Packages in transaction are sorted by NEVRA
Installing : glibc-all-langpacks-2.28-9.fc29.x86_64 4/11
Installing : glibc-common-2.28-9.fc29.x86_64 5/11
Installing : glibc-2.28-9.fc29.x86_64 6/11
Installing : FlacBetterEncoder-1.0-1.x86_64 7/11
Installing : flac-1.3.2-8.fc29.x86_64 8/11
Installing : wget-1.19.5-5.fc29.x86_64 9/11
Installing : abcde-2.9.2-1.fc29.noarch 10/11
Installing : SuperRipper-1.0-1.x86_64 11/11
Installing : *
Installing : *
Installing : *
Installing : *
Installing : *

Installed:
FlacBetterEncoder-1.0-1.x86_64 SuperRipper-1.0-1.x86_64
Expand Down
Loading
Loading