Alex Goodman e0e1c4ba0a
Internalize majority of cmd package (#2533)
* internalize majority of cmd package and migrate integration tests

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* add internal api encoder

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* create internal representation of all formats

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* export capability to get default encoders

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* restore test fixtures

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

---------

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
2024-01-24 13:29:51 -05:00

26 lines
537 B
Go

package integration
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/anchore/syft/syft/linux"
"github.com/anchore/syft/syft/source"
)
func TestDistroImage(t *testing.T) {
sbom, _ := catalogFixtureImage(t, "image-distro-id", source.SquashedScope)
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)
}