mirror of
https://github.com/anchore/syft.git
synced 2026-10-30 22:12:28 +01:00
fix realPath for first nested archives
Signed-off-by: Kudryavcev Nikolay <kydry.nikolau@gmail.com>
This commit is contained in:
@@ -10,6 +10,8 @@ import (
|
||||
)
|
||||
|
||||
func TestArchiveScan(t *testing.T) {
|
||||
archive := createArchive(t, "test-fixtures/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, "test-fixtures/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