Skip to content

Commit f6460a1

Browse files
committed
Prepare test data and add failing test for glvd/issues/153
This should reproduce the actual issue. The failing test is intentional as it reproduces the bug. The fix/workaround should make this test pass without affecting any other tests.
1 parent 37b01a8 commit f6460a1

File tree

3 files changed

+73
-27
lines changed

3 files changed

+73
-27
lines changed

src/test/java/io/gardenlinux/glvd/GlvdControllerTest.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ public void shouldGetCveDetailsWithContextsForKernelCveIsResolved() {
231231
.body("details.kernelLtsVersion[0]", equalTo("6.6"))
232232
.body("details.kernelLtsVersion[1]", equalTo("6.12"))
233233
// This CVE is not fixed in any kernel, so all are vulnerable
234-
.body("details.isVulnerable", is(List.of(true, true, true, true, true, true, true, true)))
234+
.body("details.isVulnerable", is(List.of(true, true, true, true, true, true, true)))
235235
// Is explicitly marked as "resolved"
236236
.body("contexts.resolved", hasItems(true));
237237
}
@@ -275,6 +275,16 @@ public void shouldGenerateEmptyPatchReleaseNotesForDistWithNoSourcePackages() {
275275
.body("packageList", empty());
276276
}
277277

278+
@Test
279+
public void reproduceIssue153() {
280+
// Reproducer for https://github.com/gardenlinux/glvd/issues/153
281+
given(this.spec).accept("application/json")
282+
.when().port(this.port).get("/v1/patchReleaseNotes/1443.20")
283+
.then().statusCode(200)
284+
.body("version", equalTo("1443.20"))
285+
.body("packageList", empty());
286+
}
287+
278288
@Test
279289
public void shouldReportExpectedTriagesForGardenlinuxVersion() {
280290
given(this.spec).accept("application/json")

src/test/resources/test-data/01-schema.sql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
--
44

55
-- Dumped from database version 17.4 (Debian 17.4-1.pgdg120+2)
6-
-- Dumped by pg_dump version 17.4 (Debian 17.4-1.pgdg120+2)
6+
-- Dumped by pg_dump version 17.5 (Debian 17.5-1)
77

88
SET statement_timeout = 0;
99
SET lock_timeout = 0;
@@ -640,4 +640,5 @@ ALTER TABLE ONLY public.debsrc
640640

641641
--
642642
-- PostgreSQL database dump complete
643-
--
643+
--
644+

0 commit comments

Comments
 (0)