Skip to content

Commit 3647454

Browse files
committed
e2e: fix tests with latest vuln data (#1999)
1 parent 04df8a0 commit 3647454

3 files changed

Lines changed: 27 additions & 17 deletions

File tree

cmd/clair/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ func Boot(config *Config, slimMode bool) {
114114
go func() {
115115
defer wg.Add(-1)
116116
var err error
117-
db, err = database.OpenWithRetries(config.Database, true, 30, 10*time.Second)
117+
// Wait for the DB to be ready: 10 minutes.
118+
db, err = database.OpenWithRetries(config.Database, true, 60, 10*time.Second)
118119
if err != nil {
119120
log.WithError(err).Fatal("Failed to open database despite multiple retries...")
120121
}

e2etests/testcase_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4028,7 +4028,7 @@ All OpenShift Container Platform 4.10 users are advised to upgrade to these upda
40284028
Name: "tomcat",
40294029
VersionFormat: component.JavaSourceType.String(),
40304030
Version: "9.0.59",
4031-
FixedBy: "9.0.99",
4031+
FixedBy: "9.0.106",
40324032
Location: "tomcat-embed-core-9.0.59.jar",
40334033
Vulnerabilities: []apiV1.Vulnerability{
40344034
{
@@ -4794,7 +4794,7 @@ All OpenShift Container Platform 4.10 users are advised to upgrade to these upda
47944794
NamespaceName: "rhel:8",
47954795
VersionFormat: "rpm",
47964796
Version: "1:17.0.11.0.9-2.el8.x86_64",
4797-
FixedBy: "1:17.0.15.0.6-2.el8",
4797+
FixedBy: "1:17.0.16.0.8-2.el8",
47984798
AddedBy: "sha256:06c7a3d491f551a56296ccb9bee8a68c83776991e73a9005e8b5ebb533002097",
47994799
},
48004800
},
@@ -4813,7 +4813,7 @@ All OpenShift Container Platform 4.10 users are advised to upgrade to these upda
48134813
NamespaceName: "rhel:8",
48144814
VersionFormat: "rpm",
48154815
Version: "1:17.0.13.0.11-3.el8.x86_64",
4816-
FixedBy: "1:17.0.15.0.6-2.el8",
4816+
FixedBy: "1:17.0.16.0.8-2.el8",
48174817
AddedBy: "sha256:2f7b9495af5ddc85b0be7ca9411fddb54f37999ea73b03cbf1115dd0c5bd4f95",
48184818
},
48194819
},

e2etests/vuln_test.go

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -142,16 +142,23 @@ func TestStackroxVulnImages(t *testing.T) {
142142
image: "quay.io/rhacs-eng/qa:rails-cve-2016-2098",
143143
expectedFeatures: []feature{
144144
{"rails", "4.2.5.1", []expectedVuln{
145-
{name: "CVE-2016-2098"},
146-
{name: "CVE-2016-6316"},
147-
{name: "CVE-2016-6317"},
148145
{name: "CVE-2018-16476", fixedBy: "4.2.11"},
149146
{name: "CVE-2019-5418", fixedBy: "4.2.11.1"},
150147
{name: "CVE-2019-5419", fixedBy: "4.2.11.1"},
151148
{name: "CVE-2019-5420", fixedBy: "5.2.2.1"},
152149
},
153150
},
154151
},
152+
unexpectedVulns: []feature{
153+
{"rails", "4.2.5.1", []expectedVuln{
154+
// These three vulns should exist, but NVD set these to deferred.
155+
// Placing them here until they are no longer deferred.
156+
{name: "CVE-2016-2098"},
157+
{name: "CVE-2016-6316"},
158+
{name: "CVE-2016-6317"},
159+
},
160+
},
161+
},
155162
},
156163
{
157164
// docker.io/1and1internet/ubuntu-16-customerssh:latest
@@ -177,10 +184,6 @@ func TestStackroxVulnImages(t *testing.T) {
177184
{name: "CVE-2019-10086", fixedBy: ""},
178185
},
179186
},
180-
{"commons_fileupload", "1.3.2", []expectedVuln{
181-
{name: "CVE-2016-1000031", fixedBy: ""},
182-
},
183-
},
184187
{"guava", "18.0", []expectedVuln{
185188
{name: "CVE-2018-10237", fixedBy: "24.1.1"},
186189
},
@@ -194,6 +197,12 @@ func TestStackroxVulnImages(t *testing.T) {
194197
{name: "CVE-2015-2512"},
195198
},
196199
},
200+
{"commons_fileupload", "1.3.2", []expectedVuln{
201+
// This vuln should exist, but NVD set it to deferred.
202+
// Placing it here until they are no longer deferred.
203+
{name: "CVE-2016-1000031", fixedBy: ""},
204+
},
205+
},
197206
},
198207
},
199208
{
@@ -209,17 +218,17 @@ func TestStackroxVulnImages(t *testing.T) {
209218
{
210219
// docker.io/library/cassandra:latest
211220
image: "quay.io/rhacs-eng/qa:cassandra",
212-
expectedFeatures: []feature{
213-
{"logback", "1.1.3", []expectedVuln{
214-
{name: "CVE-2017-5929", fixedBy: ""},
215-
},
216-
},
217-
},
218221
unexpectedVulns: []feature{
219222
{"slingshot", "0.10.3", []expectedVuln{
220223
{name: "CVE-2015-5711"},
221224
},
222225
},
226+
{"logback", "1.1.3", []expectedVuln{
227+
// This vuln should exist, but NVD set it to deferred.
228+
// Placing it here until they are no longer deferred.
229+
{name: "CVE-2017-5929", fixedBy: ""},
230+
},
231+
},
223232
},
224233
},
225234
{

0 commit comments

Comments
 (0)