mirror of
https://github.com/anchore/syft.git
synced 2026-10-30 14:02:26 +01:00
detect license ID from full text when incidentally provided as a value (#3876)
--------- Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com> Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> Co-authored-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
co-authored by
Alex Goodman
parent
b4d717fb30
commit
f77d503892
@@ -20,9 +20,9 @@ func Test_Licenses(t *testing.T) {
|
||||
assertSuccessfulReturnCode,
|
||||
},
|
||||
},
|
||||
|
||||
// deprecated LICENSE_INCLUDE_UNKNOWN_LICENSE_CONTENT
|
||||
{
|
||||
name: "licenses with content",
|
||||
name: "licenses with content works without deprecated LICENSE_INCLUDE_UNKNOWN_LICENSE_CONTENT",
|
||||
args: []string{"scan", "-o", "json", testImage, "--from", "docker-archive"},
|
||||
env: map[string]string{"SYFT_FORMAT_PRETTY": "true", "SYFT_LICENSE_INCLUDE_UNKNOWN_LICENSE_CONTENT": "true"},
|
||||
assertions: []traitAssertion{
|
||||
@@ -31,6 +31,17 @@ func Test_Licenses(t *testing.T) {
|
||||
assertSuccessfulReturnCode,
|
||||
},
|
||||
},
|
||||
// use new license content configuration
|
||||
{
|
||||
name: "licenses with content works with new CONTENT configuration",
|
||||
args: []string{"scan", "-o", "json", testImage, "--from", "docker-archive"},
|
||||
env: map[string]string{"SYFT_FORMAT_PRETTY": "true", "SYFT_LICENSE_CONTENT": "unknown"},
|
||||
assertions: []traitAssertion{
|
||||
assertJsonReport,
|
||||
assertUnknownLicenseContent(true),
|
||||
assertSuccessfulReturnCode,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
|
||||
Reference in New Issue
Block a user