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

repoquery: enable --recursive and update --resolve tests #1354

Merged
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
20 changes: 5 additions & 15 deletions dnf-behave-tests/dnf/repoquery/deps.feature
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@ Scenario: repoquery --requires NAME-VERSION
bottom3
"""

# missing --resolve option
@xfail
Scenario: repoquery --requires --resolve NAME
When I execute dnf with args "repoquery --requires --resolve middle1"
When I execute dnf with args "repoquery --setopt=optional_metadata_types=filelists --providers-of=requires middle1"
Then the exit code is 0
And stdout is
"""
Expand All @@ -48,10 +46,8 @@ Scenario: repoquery --requires --resolve NAME
bottom4-1:1.0-1.x86_64
"""

# missing --resolve option
@xfail
Scenario: repoquery --requires --resolve NAMEGLOB
When I execute dnf with args "repoquery --requires --resolve middle[1]"
When I execute dnf with args "repoquery --setopt=optional_metadata_types=filelists --providers-of=requires middle[1]"
Then the exit code is 0
And stdout is
"""
Expand All @@ -62,10 +58,8 @@ Scenario: repoquery --requires --resolve NAMEGLOB
bottom4-1:1.0-1.x86_64
"""

# missing --recursive and --resolve option
@xfail
Scenario: repoquery --requires --resolve --recursive NAME
When I execute dnf with args "repoquery --requires --resolve --recursive top1"
When I execute dnf with args "repoquery --setopt=optional_metadata_types=filelists --providers-of=requires --recursive top1"
Then the exit code is 0
And stdout is
"""
Expand All @@ -78,10 +72,8 @@ Scenario: repoquery --requires --resolve --recursive NAME
middle2-1:2.0-1.x86_64
"""

# missing --recursive and --resolve option
@xfail
Scenario: repoquery --requires --resolve --recursive NAME-VERSION
When I execute dnf with args "repoquery --requires --resolve --recursive top1-2.0"
When I execute dnf with args "repoquery --setopt=optional_metadata_types=filelists --providers-of=requires --recursive top1-2.0"
Then the exit code is 0
And stdout is
"""
Expand All @@ -93,7 +85,7 @@ Scenario: repoquery --requires --resolve --recursive NAME-VERSION
middle2-1:2.0-1.x86_64
"""

# missing --recursive, --resolve and --tree option
# missing --tree option
@xfail
Scenario: repoquery --requires --resolve --recursive --tree NAME-VERSION
When I execute dnf with args "repoquery --requires --resolve --recursive --tree top1-2.0"
Expand Down Expand Up @@ -345,8 +337,6 @@ Scenario: repoquery --whatrequires PROVIDE_NAME = VERSION
middle1-1:2.0-1.x86_64
"""

# missing --recursive option
@xfail
Scenario: repoquery --whatrequires --recursive PROVIDE_NAME
When I execute dnf with args "repoquery --recursive --whatrequires bottom1-prov2"
Then the exit code is 0
Expand Down
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
Loading