Skip to content

Commit

Permalink
repoquery: add file tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kontura authored and jan-kolarik committed Jan 8, 2024
1 parent e4d3dd3 commit 340407e
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
48 changes: 48 additions & 0 deletions dnf-behave-tests/dnf/repoquery/files.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
@dnf5
Feature: Repoquery tests working with files


Scenario: list files in an rpm including files in filelists.xml
Given I use repository "repoquery-files"
When I execute dnf with args "repoquery a.x86_64 --files"
Then the exit code is 0
And stdout is
"""
<REPOSYNC>
/root-file
/usr/bin/a-binary
"""


Scenario: list files using --queryformat in an rpm including files in filelists.xml
Given I use repository "repoquery-files"
When I execute dnf with args "repoquery a.x86_64 --qf %{{files}}"
Then the exit code is 0
And stdout is
"""
<REPOSYNC>
/root-file
/usr/bin/a-binary
"""


Scenario: filter by file in primary.xml
Given I use repository "repoquery-files"
When I execute dnf with args "repoquery --file /usr/bin/a-binary"
Then the exit code is 0
And stdout is
"""
<REPOSYNC>
a-0:1.0-1.fc29.x86_64
"""


Scenario: filter by file in filelists.xml
Given I use repository "repoquery-files"
When I execute dnf with args "repoquery --file /root-file"
Then the exit code is 0
And stdout is
"""
<REPOSYNC>
a-0:1.0-1.fc29.x86_64
"""
21 changes: 21 additions & 0 deletions dnf-behave-tests/fixtures/specs/repoquery-files/a-1.0-1.fc29.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Name: a
Version: 1.0
Release: 1.fc29
Summary: Made up package

License: GPLv3+
Url: None

%description
a description

%install
mkdir -p %{buildroot}%{_bindir}
touch %{buildroot}%{_bindir}/a-binary
touch %{buildroot}/root-file

%files
%{_bindir}/a-binary
/root-file

%changelog

0 comments on commit 340407e

Please sign in to comment.