Skip to content

Commit

Permalink
Add test with require(pre/post/preun/postun) to repoquery/deps.feature
Browse files Browse the repository at this point in the history
  • Loading branch information
kontura committed Mar 4, 2020
1 parent ed0026f commit 88390ae
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 1 deletion.
51 changes: 50 additions & 1 deletion dnf-behave-tests/features/repoquery/deps.feature
@@ -1,5 +1,5 @@
Feature: Tests for the basic repoquery dependencies functionality:
--requires, --provides, --conflicts, --obsoletes
--requires, --provides, --conflicts, --obsoletes, --requires-pre
--whatrequires, --whatprovides, --whatconflicts, --whatobsoletes

Background:
Expand Down Expand Up @@ -121,6 +121,30 @@ Scenario: repoquery --requires NAMEGLOB-VERSION NAME
bottom3-prov1
"""

Scenario: repoquery --requires with requires(pre/post/preun/postun)
When I execute dnf with args "repoquery --requires middle3-1.0-1"
Then the exit code is 0
And stdout is
"""
bottom1-prov1
bottom3-prov1
bottom4-prov1
bottom5-prov1
"""

# Using --qf .. is a diffrent code path in repoquery
Scenario: repoquery --requires with requires(pre/post/preun/postun)
When I execute dnf with args "repoquery --qf '%{{requires}}' middle3-1.0-1"
Then the exit code is 0
And stdout is
"""
bottom1-prov1
bottom3-prov1
bottom4-prov1
bottom5-prov1
"""


# --provides
Scenario: repoquery --provides NAME
Expand Down Expand Up @@ -264,6 +288,7 @@ Scenario: repoquery --whatrequires NAME (file provide)
And stdout is
"""
middle1-1:2.0-1.x86_64
middle3-1:1.0-1.x86_64
"""

Scenario: repoquery --whatrequires PROVIDE_NAME
Expand Down Expand Up @@ -569,3 +594,27 @@ Scenario: repoquery --whatobsoletes NAME, NAME = VERSION
middle2-1:1.0-1.x86_64
middle2-1:2.0-1.x86_64
"""


# --requires-pre
Scenario: repoquery --requires-pre
When I execute dnf with args "repoquery --requires-pre middle3"
Then the exit code is 0
And stdout is
"""
bottom1-prov1
bottom3-prov1
"""

Scenario: repoquery --requires-pre with installed pkg show all %pre, %post, %preun, %postun deps
Given I successfully execute dnf with args "install middle3"
And I drop repository "repoquery-deps"
When I execute dnf with args "repoquery --installed --requires-pre middle3"
Then the exit code is 0
And stdout is
"""
bottom1-prov1
bottom3-prov1
bottom4-prov1
bottom5-prov1
"""
@@ -0,0 +1,18 @@
Name: bottom5
Epoch: 1
Version: 1.0
Release: 1

License: Public Domain
URL: None

Provides: bottom5-prov1

Summary: Bottom level package (other packages depend on it).

%description
Dummy.

%files

%changelog
@@ -0,0 +1,21 @@
Name: middle3
Epoch: 1
Version: 1.0
Release: 1

License: Public Domain
URL: None

Requires(post): bottom1-prov1
Requires(pre): bottom3-prov1
Requires(postun): bottom4-prov1
Requires(preun): bottom5-prov1

Summary: Mid level package.

%description
Dummy.

%files

%changelog

0 comments on commit 88390ae

Please sign in to comment.