syft/test/integration/distro_test.go
Alex Goodman 706f291679
Replace distro type (#742)
* remove strong distro type

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* bump json schema to v3 (breaking distro shape)

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* fix linting

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* allow for v2 decoding of distro idLikes field in v3 json decoder

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* fix casing in simple linux release name

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* use discovered name as pretty name in simple linux release

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2022-01-12 12:13:42 -05:00

25 lines
476 B
Go

package integration
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/anchore/syft/syft/linux"
)
func TestDistroImage(t *testing.T) {
sbom, _ := catalogFixtureImage(t, "image-distro-id")
expected := &linux.Release{
PrettyName: "BusyBox v1.31.1",
Name: "busybox",
ID: "busybox",
IDLike: []string{"busybox"},
Version: "1.31.1",
VersionID: "1.31.1",
}
assert.Equal(t, expected, sbom.Artifacts.LinuxDistribution)
}