Skip to content

Commit a5a8545

Browse files
committed
Switch integration tests to CentOS 7
This commit upgrades the docker image for CentOS to Centos 7.9 as CentOs 6 is EOL since November 30. Given that CentOS 7 does no longer support SysVinit, this commit also updates the integration tests to not test this OS anymore. Closes gh-24344
1 parent ff0725f commit a5a8545

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed

spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/java/org/springframework/boot/launchscript/AbstractLaunchScriptIT.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import java.time.Duration;
2121
import java.util.ArrayList;
2222
import java.util.List;
23+
import java.util.function.Predicate;
2324

2425
import org.assertj.core.api.Condition;
2526
import org.testcontainers.containers.GenericContainer;
@@ -49,11 +50,13 @@ protected AbstractLaunchScriptIT(String scriptsDir) {
4950
this.scriptsDir = scriptsDir;
5051
}
5152

52-
static List<Object[]> parameters() {
53+
static List<Object[]> parameters(Predicate<File> osFilter) {
5354
List<Object[]> parameters = new ArrayList<>();
5455
for (File os : new File("src/test/resources/conf").listFiles()) {
55-
for (File version : os.listFiles()) {
56-
parameters.add(new Object[] { os.getName(), version.getName() });
56+
if (osFilter.test(os)) {
57+
for (File version : os.listFiles()) {
58+
parameters.add(new Object[] { os.getName(), version.getName() });
59+
}
5760
}
5861
}
5962
return parameters;

spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/java/org/springframework/boot/launchscript/JarLaunchScriptIT.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
package org.springframework.boot.launchscript;
1818

19+
import java.util.List;
20+
1921
import org.junit.jupiter.params.ParameterizedTest;
2022
import org.junit.jupiter.params.provider.MethodSource;
2123

@@ -33,6 +35,10 @@ class JarLaunchScriptIT extends AbstractLaunchScriptIT {
3335
super("jar/");
3436
}
3537

38+
static List<Object[]> parameters() {
39+
return parameters((file) -> true);
40+
}
41+
3642
@ParameterizedTest(name = "{0} {1}")
3743
@MethodSource("parameters")
3844
void basicLaunch(String os, String version) throws Exception {

spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/java/org/springframework/boot/launchscript/SysVinitLaunchScriptIT.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package org.springframework.boot.launchscript;
1818

19+
import java.util.List;
1920
import java.util.regex.Pattern;
2021

2122
import org.junit.jupiter.api.Assumptions;
@@ -39,6 +40,10 @@ class SysVinitLaunchScriptIT extends AbstractLaunchScriptIT {
3940
super("init.d/");
4041
}
4142

43+
static List<Object[]> parameters() {
44+
return parameters((file) -> !file.getName().contains("CentOS"));
45+
}
46+
4247
@ParameterizedTest(name = "{0} {1}")
4348
@MethodSource("parameters")
4449
void statusWhenStopped(String os, String version) throws Exception {
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
# CentOS 6.9 from 02/06/2017
2-
FROM centos@sha256:a23bced61701af9a0a758e94229676d9f09996a3ff0f3d26955b06bac8c282e0
1+
# CentOS 7.9 from 18/11/2020
2+
FROM centos@sha256:27525fe9e8a84f95baf88459070124628bf83da7216052ea9365fe46e93a102f
33
RUN yum install -y wget && \
4-
yum install -y system-config-services && \
54
yum install -y curl && \
65
wget --output-document jdk.rpm \
76
https://cdn.azul.com/zulu/bin/zulu8.21.0.1-jdk8.0.131-linux.x86_64.rpm && \

0 commit comments

Comments
 (0)