mirror of
https://github.com/anchore/syft
synced 2024-11-13 23:57:07 +00:00
5f3d4d285b
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
26 lines
672 B
Go
26 lines
672 B
Go
package integration
|
|
|
|
import (
|
|
"testing"
|
|
|
|
_ "modernc.org/sqlite"
|
|
|
|
"github.com/anchore/syft/syft/pkg"
|
|
"github.com/anchore/syft/syft/source"
|
|
)
|
|
|
|
func TestSqliteRpm(t *testing.T) {
|
|
// This is a regression test for issue #469 (https://github.com/anchore/syft/issues/469). Recent RPM
|
|
// based distribution store package data in an sqlite database
|
|
sbom, _ := catalogFixtureImage(t, "image-sqlite-rpmdb", source.SquashedScope, nil)
|
|
|
|
expectedPkgs := 139
|
|
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)
|
|
}
|
|
}
|