mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
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
This commit is contained in:
parent
ff0725f6bf
commit
a5a8545801
@ -20,6 +20,7 @@ import java.io.File;
|
|||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
import org.assertj.core.api.Condition;
|
import org.assertj.core.api.Condition;
|
||||||
import org.testcontainers.containers.GenericContainer;
|
import org.testcontainers.containers.GenericContainer;
|
||||||
@ -49,13 +50,15 @@ abstract class AbstractLaunchScriptIT {
|
|||||||
this.scriptsDir = scriptsDir;
|
this.scriptsDir = scriptsDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
static List<Object[]> parameters() {
|
static List<Object[]> parameters(Predicate<File> osFilter) {
|
||||||
List<Object[]> parameters = new ArrayList<>();
|
List<Object[]> parameters = new ArrayList<>();
|
||||||
for (File os : new File("src/test/resources/conf").listFiles()) {
|
for (File os : new File("src/test/resources/conf").listFiles()) {
|
||||||
|
if (osFilter.test(os)) {
|
||||||
for (File version : os.listFiles()) {
|
for (File version : os.listFiles()) {
|
||||||
parameters.add(new Object[] { os.getName(), version.getName() });
|
parameters.add(new Object[] { os.getName(), version.getName() });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return parameters;
|
return parameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
package org.springframework.boot.launchscript;
|
package org.springframework.boot.launchscript;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.junit.jupiter.params.ParameterizedTest;
|
import org.junit.jupiter.params.ParameterizedTest;
|
||||||
import org.junit.jupiter.params.provider.MethodSource;
|
import org.junit.jupiter.params.provider.MethodSource;
|
||||||
|
|
||||||
@ -33,6 +35,10 @@ class JarLaunchScriptIT extends AbstractLaunchScriptIT {
|
|||||||
super("jar/");
|
super("jar/");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static List<Object[]> parameters() {
|
||||||
|
return parameters((file) -> true);
|
||||||
|
}
|
||||||
|
|
||||||
@ParameterizedTest(name = "{0} {1}")
|
@ParameterizedTest(name = "{0} {1}")
|
||||||
@MethodSource("parameters")
|
@MethodSource("parameters")
|
||||||
void basicLaunch(String os, String version) throws Exception {
|
void basicLaunch(String os, String version) throws Exception {
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package org.springframework.boot.launchscript;
|
package org.springframework.boot.launchscript;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Assumptions;
|
import org.junit.jupiter.api.Assumptions;
|
||||||
@ -39,6 +40,10 @@ class SysVinitLaunchScriptIT extends AbstractLaunchScriptIT {
|
|||||||
super("init.d/");
|
super("init.d/");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static List<Object[]> parameters() {
|
||||||
|
return parameters((file) -> !file.getName().contains("CentOS"));
|
||||||
|
}
|
||||||
|
|
||||||
@ParameterizedTest(name = "{0} {1}")
|
@ParameterizedTest(name = "{0} {1}")
|
||||||
@MethodSource("parameters")
|
@MethodSource("parameters")
|
||||||
void statusWhenStopped(String os, String version) throws Exception {
|
void statusWhenStopped(String os, String version) throws Exception {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
# CentOS 6.9 from 02/06/2017
|
# CentOS 7.9 from 18/11/2020
|
||||||
FROM centos@sha256:a23bced61701af9a0a758e94229676d9f09996a3ff0f3d26955b06bac8c282e0
|
FROM centos@sha256:27525fe9e8a84f95baf88459070124628bf83da7216052ea9365fe46e93a102f
|
||||||
RUN yum install -y wget && \
|
RUN yum install -y wget && \
|
||||||
yum install -y system-config-services && \
|
|
||||||
yum install -y curl && \
|
yum install -y curl && \
|
||||||
wget --output-document jdk.rpm \
|
wget --output-document jdk.rpm \
|
||||||
https://cdn.azul.com/zulu/bin/zulu8.21.0.1-jdk8.0.131-linux.x86_64.rpm && \
|
https://cdn.azul.com/zulu/bin/zulu8.21.0.1-jdk8.0.131-linux.x86_64.rpm && \
|
Loading…
Reference in New Issue
Block a user