github.com/noqcks/syft@v0.0.0-20230920222752-a9e2c4e288e5/test/integration/regression_photon_package_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 TestPhotonPackageRegression(t *testing.T) { // Regression: https://github.com/anchore/syft/pull/1997
    11  	sbom, _ := catalogFixtureImage(t, "image-photon-all-layers", source.AllLayersScope, nil)
    12  	var packages []pkg.Package
    13  	for p := range sbom.Artifacts.Packages.Enumerate() {
    14  		packages = append(packages, p)
    15  	}
    16  
    17  	if len(packages) < 1 {
    18  		t.Errorf("failed to find packages for photon distro; wanted > 0 got 0")
    19  	}
    20  }