osbuild-depsolve-dnf: add SBOM support for DNF5
Enable generating SBOM documents for depsolved transactions when using DNF5. Enable SBOM testing with DNF5 in unit tests. Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
parent
def6a9fabd
commit
562a30ce93
3 changed files with 18 additions and 17 deletions
|
|
@ -161,15 +161,6 @@ def validate_request(request):
|
|||
|
||||
sbom = request["arguments"].get("sbom")
|
||||
if sbom is not None:
|
||||
# NB: check the DNF5 flag here, instead of in the dnf5 module,
|
||||
# to consistently return this error message, even if there are other
|
||||
# potential errors in the request, such as broken repository.
|
||||
if config.get("use_dnf5", False):
|
||||
return {
|
||||
"kind": "InvalidRequest",
|
||||
"reason": "SBOM support for DNF5 is not implemented"
|
||||
}
|
||||
|
||||
if command != "depsolve":
|
||||
return {
|
||||
"kind": "InvalidRequest",
|
||||
|
|
|
|||
|
|
@ -1280,13 +1280,6 @@ def test_depsolve(tmp_path, repo_servers, dnf_config, detect_fn, with_sbom, test
|
|||
res, exit_code = depsolve(transactions, repo_configs, root_dir,
|
||||
cache_dir, dnf_config, opt_metadata, with_sbom)
|
||||
|
||||
# NB: dnf5 implementation does not support SBOM yet
|
||||
if dnf_config.get("use_dnf5", False) and with_sbom:
|
||||
assert exit_code != 0
|
||||
assert res["kind"] == "InvalidRequest"
|
||||
assert res["reason"] == "SBOM support for DNF5 is not implemented"
|
||||
continue
|
||||
|
||||
if test_case.get("error", False):
|
||||
assert exit_code != 0
|
||||
assert res["kind"] == test_case["error_kind"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue