mirror of
https://github.com/anchore/syft.git
synced 2026-10-30 22:12:28 +01:00
Merge PR #4044: recursive nested-archive scanning at the resolver layer
Adds recursive archive indexing/traversal in the fileresolver and source provider layers. Original work by @Rupikz in anchore/syft#4044. # Conflicts: # cmd/syft/internal/options/source.go # syft/internal/fileresolver/directory.go # syft/internal/fileresolver/filetree_resolver.go # syft/internal/fileresolver/filetree_resolver_test.go # syft/pkg/cataloger/java/internal/maven/resolver_test.go # syft/source/directorysource/directory_source.go # test/cli/archive_test.go
This commit is contained in:
@@ -10,6 +10,8 @@ import (
|
||||
)
|
||||
|
||||
func TestArchiveScan(t *testing.T) {
|
||||
archive := createArchive(t, "testdata/archive", t.TempDir())
|
||||
nestedArchive := createArchive(t, filepath.Dir(archive), t.TempDir())
|
||||
tests := []struct {
|
||||
name string
|
||||
args []string
|
||||
@@ -23,7 +25,21 @@ func TestArchiveScan(t *testing.T) {
|
||||
"scan",
|
||||
"-o",
|
||||
"json",
|
||||
"file:" + createArchive(t, "testdata/archive", t.TempDir()),
|
||||
"file:" + archive,
|
||||
},
|
||||
assertions: []traitAssertion{
|
||||
assertSuccessfulReturnCode,
|
||||
assertJsonReport,
|
||||
assertPackageCount(1),
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "scan an nested archive within the temp dir",
|
||||
args: []string{
|
||||
"scan",
|
||||
"-o",
|
||||
"json",
|
||||
"file:" + nestedArchive,
|
||||
},
|
||||
assertions: []traitAssertion{
|
||||
assertSuccessfulReturnCode,
|
||||
|
||||
Reference in New Issue
Block a user