Skip to content

Commit

Permalink
test: add test for fips
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyLewen committed Nov 2, 2024
1 parent 04011de commit a120c5f
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
36 changes: 36 additions & 0 deletions pkg/detector/ospkg/oracle/oracle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,42 @@ func TestScanner_Detect(t *testing.T) {
},
},
},
{
name: "with fips",
fixtures: []string{
"testdata/fixtures/oracle7.yaml",
"testdata/fixtures/data-source.yaml",
},
args: args{
osVer: "7",
pkgs: []ftypes.Package{
{
Name: "gnutls",
Epoch: 10,
Version: "3.6.15",
Release: "4.0.1.el8_fips",
Arch: "x86_64",
SrcEpoch: 2,
SrcName: "gnutls",
SrcVersion: "3.6.15",
SrcRelease: "4.0.1.el8_fips",
},
},
},
want: []types.DetectedVulnerability{
{
VulnerabilityID: "CVE-2021-20232",
PkgName: "gnutls",
InstalledVersion: "10:3.6.15-4.0.1.el8_fips",
FixedVersion: "10:3.6.16-4.0.1.el8_fips",
DataSource: &dbTypes.DataSource{
ID: vulnerability.OracleOVAL,
Name: "Oracle Linux OVAL definitions",
URL: "https://linux.oracle.com/security/oval/",
},
},
},
},
{
name: "malformed",
fixtures: []string{
Expand Down
13 changes: 13 additions & 0 deletions pkg/detector/ospkg/oracle/testdata/fixtures/oracle7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,21 @@
- key: CVE-2020-8177
value:
FixedVersion: "7.29.0-59.0.1.el7_9.1"
Entries:
- FixedVersion: "7.29.0-59.0.1.el7_9.1"
- bucket: glibc
pairs:
- key: CVE-2017-1000364
value:
FixedVersion: "2:2.17-157.ksplice1.el7_3.4"
Entries:
- FixedVersion: "2:2.17-157.ksplice1.el7_3.4"
- bucket: gnutls
pairs:
- key: CVE-2021-20232
value:
FixedVersion: "3.6.16-4.el8"
Entries:
- FixedVersion: "10:3.6.16-4.0.1.el8_fips"
- FixedVersion: "3.6.16-4.el8"

0 comments on commit a120c5f

Please sign in to comment.