github.com/anchore/syft@v1.38.2/cmd/syft/internal/test/integration/mariner_distroless_test.go (about)

     1  package integration
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/anchore/syft/syft/pkg"
     7  	"github.com/anchore/syft/syft/source"
     8  )
     9  
    10  func TestMarinerDistroless(t *testing.T) {
    11  	sbom, _ := catalogFixtureImage(t, "image-mariner-distroless", source.SquashedScope)
    12  
    13  	// 12 RPMs + 2 binaries with ELF package notes claiming to be RPMs
    14  	expectedPkgs := 14
    15  	actualPkgs := 0
    16  	for range sbom.Artifacts.Packages.Enumerate(pkg.RpmPkg) {
    17  		actualPkgs += 1
    18  	}
    19  
    20  	if actualPkgs != expectedPkgs {
    21  		t.Errorf("unexpected number of RPM packages: %d != %d", expectedPkgs, actualPkgs)
    22  	}
    23  }