test/sbom/spdx: test using custom license index file

Add unit test for testing the use of custom license index file with
`SpdxLicenseExpressionFactory`.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
Tomáš Hozza 2025-01-31 16:39:58 +01:00 committed by Tomáš Hozza
parent dbb7aa0051
commit cce8ee31c4
3 changed files with 73 additions and 6 deletions

View file

@ -1,3 +1,4 @@
# This directory contains SPDX-related files used for testing
- `spdx-schema-v2.3.1.json` is the SPDX 2.3.1 JSON schema file from the [spdx-spec upstream](https://github.com/spdx/spdx-spec/blob/62f3e7cbd448a19f0099fdbd707d8b9b4fbddfdd/schemas/spdx-schema.json)
- `custom-license-index.json` is a custom license DB JSON file which includes only definition for `MIT` license and a new non-existent license `GPLv2` at the end of the file. The latest actual license DB JSON files can be downloaded from the [ScanCode LicenseDB JSON index](https://scancode-licensedb.aboutcode.org/index.json). See also [SPDX licenses](https://spdx.org/licenses/) and [ScanCode LicenseDB help](https://scancode-licensedb.aboutcode.org/help.html).

View file

@ -0,0 +1,31 @@
[
{
"license_key": "mit",
"category": "Permissive",
"spdx_license_key": "MIT",
"other_spdx_license_keys": [
"LicenseRef-MIT-Bootstrap",
"LicenseRef-MIT-Discord",
"LicenseRef-MIT-TC",
"LicenseRef-MIT-Diehl"
],
"is_exception": false,
"is_deprecated": false,
"json": "mit.json",
"yaml": "mit.yml",
"html": "mit.html",
"license": "mit.LICENSE"
},
{
"license_key": "GPLv2",
"category": "Permissive",
"spdx_license_key": "GPLv2",
"other_spdx_license_keys": [],
"is_exception": false,
"is_deprecated": false,
"json": "GPLv2.json",
"yaml": "GPLv2.yml",
"html": "GPLv2.html",
"license": "GPLv2.LICENSE"
}
]