mirror of
https://github.com/anchore/syft.git
synced 2026-03-30 21:53:27 +02:00
* fix ELF package types to be honored Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * prefer OS packages over binary packages when there are duplicates Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> --------- Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
24 lines
557 B
Go
24 lines
557 B
Go
package integration
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/anchore/syft/syft/pkg"
|
|
"github.com/anchore/syft/syft/source"
|
|
)
|
|
|
|
func TestMarinerDistroless(t *testing.T) {
|
|
sbom, _ := catalogFixtureImage(t, "image-mariner-distroless", source.SquashedScope)
|
|
|
|
// 12 RPMs + 2 binaries with ELF package notes claiming to be RPMs
|
|
expectedPkgs := 14
|
|
actualPkgs := 0
|
|
for range sbom.Artifacts.Packages.Enumerate(pkg.RpmPkg) {
|
|
actualPkgs += 1
|
|
}
|
|
|
|
if actualPkgs != expectedPkgs {
|
|
t.Errorf("unexpected number of RPM packages: %d != %d", expectedPkgs, actualPkgs)
|
|
}
|
|
}
|