Skip to content

Commit

Permalink
test: add coverage for new rpmdb paths (anchore#1999)
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
  • Loading branch information
spiffcs committed Aug 4, 2023
1 parent 4c410f3 commit 56c46c6
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions syft/pkg/cataloger/rpm/cataloger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ func Test_DBCataloger_Globs(t *testing.T) {
"var/lib/rpm/Packages.db",
"var/lib/rpm/rpmdb.sqlite",
"var/lib/rpmmanifest/container-manifest-2",
"usr/lib/sysimage/rpm/Packages",
"usr/lib/sysimage/rpm/Packages.db",
"usr/lib/sysimage/rpm/rpmdb.sqlite",
},
},
}
Expand Down
Empty file.
Empty file.
Empty file.
20 changes: 20 additions & 0 deletions test/integration/regression_photon_package_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package integration

import (
"testing"

"github.com/anchore/syft/syft/pkg"
"github.com/anchore/syft/syft/source"
)

func TestPhotonPackageRegression(t *testing.T) { // Regression: https://github.com/anchore/syft/pull/1997
sbom, _ := catalogFixtureImage(t, "image-photon-all-layers", source.AllLayersScope, nil)
var packages []pkg.Package
for p := range sbom.Artifacts.Packages.Enumerate() {
packages = append(packages, p)
}

if len(packages) < 1 {
t.Errorf("failed to find packages for photon distro; wanted > 0 got 0")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM photon:5.0-20230729

0 comments on commit 56c46c6

Please sign in to comment.