-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests for optional filelists metadata
Basic tests for optional filelists metadata functionality taken and reworked from the existing dnf5 tests.
- Loading branch information
1 parent
b8ef23b
commit 681726c
Showing
1 changed file
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
Feature: Tests for optional metadata loading functionality | ||
|
||
|
||
Background: | ||
Given I use repository "dnf-ci-fedora" | ||
And I successfully execute dnf with args "makecache --setopt=optional_metadata_types=," | ||
And I execute "find | sort" in "{context.dnf.installroot}/var/cache/dnf" | ||
Then stdout matches line by line | ||
""" | ||
\. | ||
\./dnf-ci-fedora-[0-9a-f]{16} | ||
\./dnf-ci-fedora-[0-9a-f]{16}/repodata | ||
\./dnf-ci-fedora-[0-9a-f]{16}/repodata/primary\.xml\.* | ||
\./dnf-ci-fedora-[0-9a-f]{16}/repodata/repomd\.xml | ||
\./dnf-ci-fedora\.solv | ||
\./expired_repos\.json | ||
""" | ||
|
||
|
||
Scenario: Optional metadata are loaded when explicitly requested by the option | ||
Given I successfully execute dnf with args "makecache --setopt=optional_metadata_types=,filelists" | ||
When I execute "find | sort" in "{context.dnf.installroot}/var/cache/dnf" | ||
Then stdout matches line by line | ||
""" | ||
\. | ||
\./dnf-ci-fedora-[0-9a-f]{16} | ||
\./dnf-ci-fedora-[0-9a-f]{16}/repodata | ||
\./dnf-ci-fedora-[0-9a-f]{16}/repodata/filelists\.xml\.zst | ||
\./dnf-ci-fedora-[0-9a-f]{16}/repodata/primary\.xml\.* | ||
\./dnf-ci-fedora-[0-9a-f]{16}/repodata/repomd\.xml | ||
\./dnf-ci-fedora-filenames\.solvx | ||
\./dnf-ci-fedora\.solv | ||
\./expired_repos\.json | ||
""" | ||
|
||
|
||
Scenario: Invalid metadata type is ignored when processing the option | ||
Given I successfully execute dnf with args "makecache --setopt=optional_metadata_types=,abcdef" | ||
When I execute "find | sort" in "{context.dnf.installroot}/var/cache/dnf" | ||
Then stdout matches line by line | ||
""" | ||
\. | ||
\./dnf-ci-fedora-[0-9a-f]{16} | ||
\./dnf-ci-fedora-[0-9a-f]{16}/repodata | ||
\./dnf-ci-fedora-[0-9a-f]{16}/repodata/primary\.xml\.* | ||
\./dnf-ci-fedora-[0-9a-f]{16}/repodata/repomd\.xml | ||
\./dnf-ci-fedora\.solv | ||
\./expired_repos\.json | ||
""" | ||
|
||
|
||
Scenario: Optional metadata are loaded when requested by command | ||
Given I successfully execute dnf with args "provides basesystem --setopt=optional_metadata_types=," | ||
When I execute "find | sort" in "{context.dnf.installroot}/var/cache/dnf" | ||
Then stdout matches line by line | ||
""" | ||
\. | ||
\./dnf-ci-fedora-[0-9a-f]{16} | ||
\./dnf-ci-fedora-[0-9a-f]{16}/repodata | ||
\./dnf-ci-fedora-[0-9a-f]{16}/repodata/filelists\.xml\.zst | ||
\./dnf-ci-fedora-[0-9a-f]{16}/repodata/primary\.xml\.* | ||
\./dnf-ci-fedora-[0-9a-f]{16}/repodata/repomd\.xml | ||
\./dnf-ci-fedora-filenames\.solvx | ||
\./dnf-ci-fedora\.solv | ||
\./expired_repos\.json | ||
""" | ||
|
||
|
||
Scenario: Operation returns an error when metadata are not present in cacheonly mode | ||
Given I execute dnf with args "provides basesystem --cacheonly --setopt=optional_metadata_types=," | ||
Then the exit code is 1 | ||
And stderr contains "Error: Cache-only enabled but no cache for 'dnf-ci-fedora'" | ||
|
||
|
||
Scenario: Filelists metadata are loaded when filepath spec is provided | ||
Given I successfully execute dnf with args "repoquery /some/file --setopt=optional_metadata_types=," | ||
When I execute "find | sort" in "{context.dnf.installroot}/var/cache/dnf" | ||
Then stdout matches line by line | ||
""" | ||
\. | ||
\./dnf-ci-fedora-[0-9a-f]{16} | ||
\./dnf-ci-fedora-[0-9a-f]{16}/repodata | ||
\./dnf-ci-fedora-[0-9a-f]{16}/repodata/filelists\.xml\.zst | ||
\./dnf-ci-fedora-[0-9a-f]{16}/repodata/primary\.xml\.* | ||
\./dnf-ci-fedora-[0-9a-f]{16}/repodata/repomd\.xml | ||
\./dnf-ci-fedora-filenames\.solvx | ||
\./dnf-ci-fedora\.solv | ||
\./expired_repos\.json | ||
""" |