Skip to content

depsolvednf unit tests don't PASS with DNF5 solver #2256

@thozza

Description

@thozza

Downstream Jira issue: https://issues.redhat.com/browse/HMS-10324

The osbuild repository runs the depsolvednf unit tests against its version of the depsolver. There is a CI test that can run the unit tests with DNF4 and DNF5, but the DNF5 version is currently disabled, because the tests are failing. Specifically:

One can simply run the following command in an osbuild repository checkout:

./test/cases/images-depsolve-dnf-tests --images-ref "main" --use-dnf5

You'll get the following errors:

=== RUN   TestErrorRepoInfo
=== RUN   TestErrorRepoInfo/V2
=== RUN   TestErrorRepoInfo/V2/0

(process:82152): librepo-WARNING **: 13:50:27.457: LRO_METALINKURL processing failed: Curl error (7): Could not connect to server for https://0.0.0.0/baseos/metalink [Failed to connect to 0.0.0.0 port 443 after 0 ms: Could not connect to server]
RepoError: There was a problem reading a repository: Failed to download metadata (metalink: "https://0.0.0.0/baseos/metalink") for repository "446aa191a2ffd36e7fb2caaeb056b3921083671e8b9e4aae898d2d9002db5939": Cannot prepare internal mirrorlist: Curl error (7): Could not connect to server for https://0.0.0.0/baseos/metalink [Failed to connect to 0.0.0.0 port 443 after 0 ms: Could not connect to server]
=== NAME  TestErrorRepoInfo/V2
    depsolvednf_test.go:986: 
        	Error Trace:	/tmp/tmp0hmi6ql_/images/pkg/depsolvednf/depsolvednf_test.go:986
        	Error:      	"DNF error occurred: RepoError: There was a problem reading a repository: Failed to download metadata (metalink: \"https://0.0.0.0/baseos/metalink\") for repository \"446aa191a2ffd36e7fb2caaeb056b3921083671e8b9e4aae898d2d9002db5939\": Cannot prepare internal mirrorlist: Curl error (7): Could not connect to server for https://0.0.0.0/baseos/metalink [Failed to connect to 0.0.0.0 port 443 after 0 ms: Could not connect to server]" does not contain "https://0.0.0.0/baseos/repo"
        	Test:       	TestErrorRepoInfo/V2
=== RUN   TestErrorRepoInfo/V2/1

(process:82154): librepo-WARNING **: 13:50:27.556: LRO_METALINKURL processing failed: Curl error (7): Could not connect to server for https://0.0.0.0/baseos/metalink [Failed to connect to 0.0.0.0 port 443 after 0 ms: Could not connect to server]
RepoError: There was a problem reading a repository: Failed to download metadata (metalink: "https://0.0.0.0/baseos/metalink") for repository "446aa191a2ffd36e7fb2caaeb056b3921083671e8b9e4aae898d2d9002db5939": Cannot prepare internal mirrorlist: Curl error (7): Could not connect to server for https://0.0.0.0/baseos/metalink [Failed to connect to 0.0.0.0 port 443 after 0 ms: Could not connect to server]
=== NAME  TestErrorRepoInfo/V2
    depsolvednf_test.go:986: 
        	Error Trace:	/tmp/tmp0hmi6ql_/images/pkg/depsolvednf/depsolvednf_test.go:986
        	Error:      	"DNF error occurred: RepoError: There was a problem reading a repository: Failed to download metadata (metalink: \"https://0.0.0.0/baseos/metalink\") for repository \"446aa191a2ffd36e7fb2caaeb056b3921083671e8b9e4aae898d2d9002db5939\": Cannot prepare internal mirrorlist: Curl error (7): Could not connect to server for https://0.0.0.0/baseos/metalink [Failed to connect to 0.0.0.0 port 443 after 0 ms: Could not connect to server]" does not contain "https://0.0.0.0/baseos/repo"
        	Test:       	TestErrorRepoInfo/V2
=== RUN   TestErrorRepoInfo/V2/2

(process:82156): librepo-WARNING **: 13:50:27.661: LRO_METALINKURL processing failed: Curl error (7): Could not connect to server for https://0.0.0.0/f35/metalink [Failed to connect to 0.0.0.0 port 443 after 0 ms: Could not connect to server]
RepoError: There was a problem reading a repository: Failed to download metadata (metalink: "https://0.0.0.0/f35/metalink") for repository "2d021dc3a4cd71ba24167000ebb593c063cc321e6eca1139d2060557e882ee8f": Cannot prepare internal mirrorlist: Curl error (7): Could not connect to server for https://0.0.0.0/f35/metalink [Failed to connect to 0.0.0.0 port 443 after 0 ms: Could not connect to server]
=== RUN   TestErrorRepoInfo/V2/3

(process:82158): librepo-WARNING **: 13:50:27.765: LRO_MIRRORLISTURL processing failed: Curl error (7): Could not connect to server for https://0.0.0.0/baseos/mirrors [Failed to connect to 0.0.0.0 port 443 after 0 ms: Could not connect to server]
RepoError: There was a problem reading a repository: Failed to download metadata (mirrorlist: "https://0.0.0.0/baseos/mirrors") for repository "c38202787e185186f8eaf72839024f7b07a4c6e54c97061cbee16fd313a68e8f": Cannot prepare internal mirrorlist: Curl error (7): Could not connect to server for https://0.0.0.0/baseos/mirrors [Failed to connect to 0.0.0.0 port 443 after 0 ms: Could not connect to server]
--- FAIL: TestErrorRepoInfo (0.41s)
    --- FAIL: TestErrorRepoInfo/V2 (0.41s)
        --- PASS: TestErrorRepoInfo/V2/0 (0.10s)
        --- PASS: TestErrorRepoInfo/V2/1 (0.10s)
        --- PASS: TestErrorRepoInfo/V2/2 (0.11s)
        --- PASS: TestErrorRepoInfo/V2/3 (0.10s)

and

=== RUN   TestSolverDepsolveAll/V2/multi-chain-error-first
libdnf5::OptionChild<libdnf5::OptionBool>& libdnf5::repo::ConfigRepo::get_gpgcheck_option() is deprecated: Use get_pkg_gpgcheck_option()
error install_specs
MarkingErrors: Error occurred when marking packages for installation: No match for argument: does-not-exist
    depsolvednf_test.go:448: 
        	Error Trace:	/tmp/tmp0hmi6ql_/images/pkg/depsolvednf/depsolvednf_test.go:448
        	Error:      	"error depsolving package sets for \"first\": DNF error occurred: MarkingErrors: Error occurred when marking packages for installation: No match for argument: does-not-exist" does not contain "missing packages: does-not-exist"
        	Test:       	TestSolverDepsolveAll/V2/multi-chain-error-first
=== RUN   TestSolverDepsolveAll/V2/multi-chain-error-second
libdnf5::OptionChild<libdnf5::OptionBool>& libdnf5::repo::ConfigRepo::get_gpgcheck_option() is deprecated: Use get_pkg_gpgcheck_option()
libdnf5::OptionChild<libdnf5::OptionBool>& libdnf5::repo::ConfigRepo::get_gpgcheck_option() is deprecated: Use get_pkg_gpgcheck_option()
error install_specs
MarkingErrors: Error occurred when marking packages for installation: No match for argument: does-not-exist
    depsolvednf_test.go:448: 
        	Error Trace:	/tmp/tmp0hmi6ql_/images/pkg/depsolvednf/depsolvednf_test.go:448
        	Error:      	"error depsolving package sets for \"second\": DNF error occurred: MarkingErrors: Error occurred when marking packages for installation: No match for argument: does-not-exist" does not contain "missing packages: does-not-exist"
        	Test:       	TestSolverDepsolveAll/V2/multi-chain-error-second
=== RUN   TestSolverDepsolveAll/V2/multi-chain-with-sbom
libdnf5::OptionChild<libdnf5::OptionBool>& libdnf5::repo::ConfigRepo::get_gpgcheck_option() is deprecated: Use get_pkg_gpgcheck_option()
libdnf5::OptionChild<libdnf5::OptionBool>& libdnf5::repo::ConfigRepo::get_gpgcheck_option() is deprecated: Use get_pkg_gpgcheck_option()
--- FAIL: TestSolverDepsolveAll (3.47s)
    --- FAIL: TestSolverDepsolveAll/V2 (3.47s)
        --- PASS: TestSolverDepsolveAll/V2/flat (0.49s)
        --- PASS: TestSolverDepsolveAll/V2/chain (0.41s)
        --- PASS: TestSolverDepsolveAll/V2/multi-chain (0.80s)
        --- FAIL: TestSolverDepsolveAll/V2/multi-chain-error-first (0.19s)
        --- FAIL: TestSolverDepsolveAll/V2/multi-chain-error-second (0.58s)
        --- PASS: TestSolverDepsolveAll/V2/multi-chain-with-sbom (1.00s)

It seems that DNF5 behavior slightly differs from DNF4. These unit tests need to be investigated and ideally modified to work and pass with both, DNF4 and DNF5 version of the solver.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions