mirror of
https://github.com/anchore/syft.git
synced 2026-10-31 14:36:33 +01:00
add symlink content fetching support
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
// +build integration
|
||||
|
||||
package integration
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/anchore/go-testutils"
|
||||
"github.com/anchore/imgbom/imgbom"
|
||||
"github.com/anchore/imgbom/imgbom/distro"
|
||||
"github.com/go-test/deep"
|
||||
)
|
||||
|
||||
func TestDistroImage(t *testing.T) {
|
||||
img, cleanup := testutils.GetFixtureImage(t, "docker-archive", "image-distro-id")
|
||||
defer cleanup()
|
||||
|
||||
actual := imgbom.IdentifyDistro(img)
|
||||
if actual == nil {
|
||||
t.Fatalf("could not find distro")
|
||||
}
|
||||
|
||||
expected, err := distro.NewDistro(distro.Busybox, "1.31.1")
|
||||
if err != nil {
|
||||
t.Fatalf("could not create distro: %+v", err)
|
||||
}
|
||||
|
||||
diffs := deep.Equal(*actual, expected)
|
||||
if len(diffs) != 0 {
|
||||
for _, d := range diffs {
|
||||
t.Errorf("found distro difference: %+v", d)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
"github.com/anchore/go-testutils"
|
||||
"github.com/anchore/imgbom/imgbom"
|
||||
"github.com/anchore/imgbom/imgbom/cataloger"
|
||||
"github.com/anchore/imgbom/imgbom/pkg"
|
||||
"github.com/anchore/imgbom/imgbom/scope"
|
||||
)
|
||||
@@ -137,4 +138,9 @@ func TestLanguageImage(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
// ensure that integration test cases stay in sync with the available catalogers
|
||||
if len(cataloger.Catalogers()) < len(cases) {
|
||||
t.Fatalf("probably missed a cataloger during testing, double check that all catalogers are included in testing")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
FROM busybox:1.31.1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user