Skip to content

Commit

Permalink
Adjust test to stderr containing resolve hints
Browse files Browse the repository at this point in the history
  • Loading branch information
m-blaha committed Mar 19, 2024
1 parent ba3fb59 commit 84426a7
Show file tree
Hide file tree
Showing 14 changed files with 44 additions and 33 deletions.
3 changes: 1 addition & 2 deletions dnf-behave-tests/dnf/comps-group.feature
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ Scenario: Install installed group when group is not available
| group-install | DNF-CI-Testgroup |
When I execute dnf with args "group install --disable-repo=dnf-ci-thirdparty dnf-ci-testgroup"
Then the exit code is 1
And dnf4 stderr contains "Module or Group 'dnf-ci-testgroup' is not available."
And dnf5 stderr is
And stderr contains lines
"""
Failed to resolve the transaction:
No match for argument: dnf-ci-testgroup
Expand Down
2 changes: 1 addition & 1 deletion dnf-behave-tests/dnf/comps-upgrade.feature
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ Scenario: Upgrade nonexistent group
When I execute dnf with args "group upgrade nonexistent"
Then the exit code is 1
And Transaction is empty
And stderr is
And stderr contains lines
"""
Failed to resolve the transaction:
No match for argument: nonexistent
Expand Down
2 changes: 2 additions & 0 deletions dnf-behave-tests/dnf/distro-sync.feature
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ Scenario: distro-sync list of packages, one of them is not available
"""
Failed to resolve the transaction:
No match for argument: nosuchpkg
You can try to add to command line:
--skip-unavailable to skip unavailable packages
"""
And Transaction is empty

Expand Down
6 changes: 6 additions & 0 deletions dnf-behave-tests/dnf/downgrade.feature
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ Scenario: Downgrade list of packages, one of them is not available
"""
Failed to resolve the transaction:
No match for argument: nosuchpkg
You can try to add to command line:
--skip-unavailable to skip unavailable packages
"""
And Transaction is empty

Expand Down Expand Up @@ -170,6 +172,8 @@ Scenario: Downgrade mixture of not available/not installed/not downgradable/down
No match for argument: nosuchpkg
The lowest available version of the "wget.x86_64" package is already installed, cannot downgrade it.
Packages for argument 'abcde' available, but not installed.
You can try to add to command line:
--skip-unavailable to skip unavailable packages
"""
And Transaction is empty

Expand Down Expand Up @@ -201,6 +205,8 @@ Scenario Outline: Check <command> exit code - package does not exist
"""
Failed to resolve the transaction:
No match for argument: non-existent-package
You can try to add to command line:
--skip-unavailable to skip unavailable packages
"""

Examples:
Expand Down
4 changes: 2 additions & 2 deletions dnf-behave-tests/dnf/download-binary.feature
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ Scenario: Download an existing RPM with dependencies
@bz1844925
Scenario: Error when failed to resolve dependencies
When I execute dnf with args "download filesystem --resolve --exclude setup"
Then the exit code is 1
And stderr is
Then stderr is
"""
Failed to resolve the transaction:
Problem: package filesystem-3.9-2.fc29.x86_64 requires setup, but none of the providers can be installed
- conflicting requests
- package setup-2.12.1-1.fc29.noarch is filtered out by exclude filtering
"""
Then the exit code is 1


Scenario: Download an existing RPM with dependencies into a --destdir
Expand Down
2 changes: 2 additions & 0 deletions dnf-behave-tests/dnf/install-exclude.feature
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Scenario: Install an RPM that requires excluded RPM
Problem: package filesystem-3.9-2.fc29.x86_64 requires setup, but none of the providers can be installed
- conflicting requests
- package setup-2.12.1-1.fc29.noarch is filtered out by exclude filtering
You can try to add to command line:
--skip-broken to skip uninstallable packages
"""


Expand Down
4 changes: 4 additions & 0 deletions dnf-behave-tests/dnf/install-non-existent.feature
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Scenario: Try to install a non-existent package
"""
Failed to resolve the transaction:
No match for argument: non-existent-package
You can try to add to command line:
--skip-unavailable to skip unavailable packages
"""


Expand All @@ -33,6 +35,8 @@ Scenario: Install an existent and an non-existent package
"""
Failed to resolve the transaction:
No match for argument: non-existent-package
You can try to add to command line:
--skip-unavailable to skip unavailable packages
"""


Expand Down
8 changes: 4 additions & 4 deletions dnf-behave-tests/dnf/mark.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Scenario Outline: Marking non-existent package as <type> fails
Given I use repository "dnf-ci-fedora"
When I execute dnf with args "mark <type> nosuchpkg"
Then the exit code is 1
And stderr is
And stderr contains lines
"""
Failed to resolve the transaction:
No match for argument: nosuchpkg
Expand All @@ -33,7 +33,7 @@ Scenario: Marking as group for non-existent package or non-existent group fails
When I execute dnf with args "install lame"
And I execute dnf with args "mark group nosuchgrp lame"
Then the exit code is 1
And stderr is
And stderr contains lines
"""
Group state for "nosuchgrp" not found.
"""
Expand All @@ -44,7 +44,7 @@ Scenario: Marking available but not installed package fails
Given I use repository "dnf-ci-fedora"
When I execute dnf with args "mark user lame"
Then the exit code is 1
And stderr is
And stderr contains lines
"""
Failed to resolve the transaction:
No match for argument: lame
Expand All @@ -60,7 +60,7 @@ Scenario: Marking as dependency a list of pkgs when one of them is not available
And package reasons are
| Package | Reason |
| lame-3.100-4.fc29.x86_64 | user |
And stderr is
And stderr contains lines
"""
Failed to resolve the transaction:
No match for argument: nosuchpkg
Expand Down
12 changes: 4 additions & 8 deletions dnf-behave-tests/dnf/obsoletes.feature
Original file line number Diff line number Diff line change
Expand Up @@ -305,17 +305,13 @@ Scenario: Obsoleted package is not installed when group contains both obsoleter
Scenario: Both packages are installed when group contains both obsoleter and obsoleted packages and obsoletes are switched off
When I execute dnf with args "group install obsoleter-obsoleted --setopt=obsoletes=False"
Then the exit code is 1
And dnf4 stderr is
"""
Error:
Problem: package PackageD-2.0-1.x86_64 obsoletes PackageC < 2.0 provided by PackageC-1.0-1.x86_64
- cannot install the best candidate for the job
- conflicting requests
"""
And dnf5 stderr is
And stderr is
"""
Failed to resolve the transaction:
Problem: package PackageD-2.0-1.x86_64 obsoletes PackageC < 2.0 provided by PackageC-1.0-1.x86_64
- cannot install the best candidate for the job
- conflicting requests
You can try to add to command line:
--no-best to not limit the transaction to the best candidates
--skip-broken to skip uninstallable packages
"""
12 changes: 5 additions & 7 deletions dnf-behave-tests/dnf/plugins-core/builddep.feature
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ Scenario: Builddep with simple dependency (non-existent)
"""
Failed to resolve the transaction:
No match for argument: flac = 15
You can try to add to command line:
--skip-unavailable to skip unavailable packages
"""

@dnf5
Expand Down Expand Up @@ -152,16 +154,12 @@ Scenario: Builddep with unavailable build dependency
Given I use repository "dnf-ci-fedora"
When I execute dnf with args "builddep {context.dnf.fixturesdir}/repos/dnf-ci-builddep/src/unavailable-requirement-1.0-1.src.rpm"
Then the exit code is 1
And dnf4 stderr is
"""
No matching package to install: 'this-lib-is-not-available'
Not all dependencies satisfied
Error: Some packages could not be found.
"""
And dnf5 stderr is
And stderr is
"""
Failed to resolve the transaction:
No match for argument: this-lib-is-not-available
You can try to add to command line:
--skip-unavailable to skip unavailable packages
"""
When I execute dnf with args "builddep --skip-unavailable {context.dnf.fixturesdir}/repos/dnf-ci-builddep/src/unavailable-requirement-1.0-1.src.rpm"
Then the exit code is 0
Expand Down
4 changes: 4 additions & 0 deletions dnf-behave-tests/dnf/protect-running-kernel.feature
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ Scenario: Running kernel is protected against obsoleting
"""
Failed to resolve the transaction:
Problem: The operation would result in removing of running kernel: dnf-ci-kernel-0:1.0-1.x86_64
You can try to add to command line:
--skip-broken to skip uninstallable packages
"""


Expand All @@ -71,6 +73,8 @@ Scenario: Running kernel is protected against removal as conflict
Problem: problem with installed package
- package dnf-ci-conflict-1.0-1.x86_64 conflicts with dnf-ci-kernel = 1.0-1 provided by dnf-ci-kernel-1.0-1.x86_64
- conflicting requests
You can try to add to command line:
--skip-broken to skip uninstallable packages
"""

@bz1698145
Expand Down
2 changes: 2 additions & 0 deletions dnf-behave-tests/dnf/reinstall.feature
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ Scenario: Reinstall list of packages, one of them is not available
"""
Failed to resolve the transaction:
No match for argument: nosuchpkg
You can try to add to command line:
--skip-unavailable to skip unavailable packages
"""
And Transaction is empty

Expand Down
12 changes: 3 additions & 9 deletions dnf-behave-tests/dnf/security-upgrade.feature
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,15 @@ Given I use repository "security-upgrade-noarch"
| install | json-c-0:1-1.x86_64 |
When I execute dnf with args "upgrade --security"
Then the exit code is 1
And dnf4 stderr is
"""
Error:
Problem: cannot install both json-c-2-2.x86_64 and json-c-2-2.noarch
- package bind-libs-lite-2-2.x86_64 requires libjson-c.so.4()(64bit), but none of the providers can be installed
- cannot install the best update candidate for package json-c-1-1.x86_64
- cannot install the best update candidate for package bind-libs-lite-1-1.x86_64
"""
And dnf5 stderr is
And stderr is
"""
Failed to resolve the transaction:
Problem: cannot install both json-c-2-2.noarch and json-c-2-2.x86_64
- package bind-libs-lite-2-2.x86_64 requires libjson-c.so.4()(64bit), but none of the providers can be installed
- cannot install the best update candidate for package json-c-1-1.x86_64
- cannot install the best update candidate for package bind-libs-lite-1-1.x86_64
You can try to add to command line:
--no-best to not limit the transaction to the best candidates
"""


Expand Down
4 changes: 4 additions & 0 deletions dnf-behave-tests/dnf/upgrade.feature
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ Scenario: Upgrade list of packages, one of them is not available
"""
Failed to resolve the transaction:
No match for argument: nosuchpkg
You can try to add to command line:
--skip-unavailable to skip unavailable packages
"""
And Transaction is empty

Expand Down Expand Up @@ -164,6 +166,8 @@ Scenario: Upgrade all RPMs from multiple repositories with best=True
Failed to resolve the transaction:
Problem: cannot install the best update candidate for package SuperRipper-1.0-1.x86_64
- nothing provides unsatisfiable needed by SuperRipper-1.3-1.x86_64
You can try to add to command line:
--no-best to not limit the transaction to the best candidates
"""
When I execute dnf with args "upgrade --no-best"
Then the exit code is 0
Expand Down

0 comments on commit 84426a7

Please sign in to comment.