mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 20:38:08 +08:00
fix(ci): trivy test to expect 3 CVEs instead of 2 in the vulnerable test layer (#1623)
Trivy started detecting CVE-2023-2975, so one of the checks expecting only 2 CVEs was failing Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
This commit is contained in:
@@ -73,6 +73,7 @@ func TestScanningByDigest(t *testing.T) {
|
||||
So(err, ShouldBeNil)
|
||||
So(cveMap, ShouldContainKey, test.Vulnerability1ID)
|
||||
So(cveMap, ShouldContainKey, test.Vulnerability2ID)
|
||||
So(cveMap, ShouldContainKey, test.Vulnerability3ID)
|
||||
|
||||
cveMap, err = scanner.ScanImage("multi-arch@" + simpleDigest.String())
|
||||
So(err, ShouldBeNil)
|
||||
@@ -82,11 +83,13 @@ func TestScanningByDigest(t *testing.T) {
|
||||
So(err, ShouldBeNil)
|
||||
So(cveMap, ShouldContainKey, test.Vulnerability1ID)
|
||||
So(cveMap, ShouldContainKey, test.Vulnerability2ID)
|
||||
So(cveMap, ShouldContainKey, test.Vulnerability3ID)
|
||||
|
||||
cveMap, err = scanner.ScanImage("multi-arch:multi-arch-tag")
|
||||
So(err, ShouldBeNil)
|
||||
So(cveMap, ShouldContainKey, test.Vulnerability1ID)
|
||||
So(cveMap, ShouldContainKey, test.Vulnerability2ID)
|
||||
So(cveMap, ShouldContainKey, test.Vulnerability3ID)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -181,6 +184,9 @@ func TestVulnerableLayer(t *testing.T) {
|
||||
|
||||
cveMap, err := scanner.ScanImage("repo@" + imgDigest.String())
|
||||
So(err, ShouldBeNil)
|
||||
So(len(cveMap), ShouldEqual, 2)
|
||||
t.Logf("cveMap: %v", cveMap)
|
||||
// As of July 15 2023 there are 3 CVEs: CVE-2023-1255, CVE-2023-2650, CVE-2023-2975
|
||||
// There may be more discovered in the future
|
||||
So(len(cveMap), ShouldBeGreaterThanOrEqualTo, 3)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user