github.com/noqcks/syft@v0.0.0-20230920222752-a9e2c4e288e5/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, nil)
    12  
    13  	expectedPkgs := 12
    14  	actualPkgs := 0
    15  	for range sbom.Artifacts.Packages.Enumerate(pkg.RpmPkg) {
    16  		actualPkgs += 1
    17  	}
    18  
    19  	if actualPkgs != expectedPkgs {
    20  		t.Errorf("unexpected number of RPM packages: %d != %d", expectedPkgs, actualPkgs)
    21  	}
    22  }