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:
Stephane Nicoll 2020-12-07 10:33:29 +01:00
parent ff0725f6bf
commit a5a8545801
4 changed files with 19 additions and 6 deletions

View File

@ -20,6 +20,7 @@ import java.io.File;
import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Predicate;
import org.assertj.core.api.Condition;
import org.testcontainers.containers.GenericContainer;
@ -49,11 +50,13 @@ abstract class AbstractLaunchScriptIT {
this.scriptsDir = scriptsDir;
}
static List<Object[]> parameters() {
static List<Object[]> parameters(Predicate<File> osFilter) {
List<Object[]> parameters = new ArrayList<>();
for (File os : new File("src/test/resources/conf").listFiles()) {
for (File version : os.listFiles()) {
parameters.add(new Object[] { os.getName(), version.getName() });
if (osFilter.test(os)) {
for (File version : os.listFiles()) {
parameters.add(new Object[] { os.getName(), version.getName() });
}
}
}
return parameters;

View File

@ -16,6 +16,8 @@
package org.springframework.boot.launchscript;
import java.util.List;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
@ -33,6 +35,10 @@ class JarLaunchScriptIT extends AbstractLaunchScriptIT {
super("jar/");
}
static List<Object[]> parameters() {
return parameters((file) -> true);
}
@ParameterizedTest(name = "{0} {1}")
@MethodSource("parameters")
void basicLaunch(String os, String version) throws Exception {

View File

@ -16,6 +16,7 @@
package org.springframework.boot.launchscript;
import java.util.List;
import java.util.regex.Pattern;
import org.junit.jupiter.api.Assumptions;
@ -39,6 +40,10 @@ class SysVinitLaunchScriptIT extends AbstractLaunchScriptIT {
super("init.d/");
}
static List<Object[]> parameters() {
return parameters((file) -> !file.getName().contains("CentOS"));
}
@ParameterizedTest(name = "{0} {1}")
@MethodSource("parameters")
void statusWhenStopped(String os, String version) throws Exception {

View File

@ -1,7 +1,6 @@
# CentOS 6.9 from 02/06/2017
FROM centos@sha256:a23bced61701af9a0a758e94229676d9f09996a3ff0f3d26955b06bac8c282e0
# CentOS 7.9 from 18/11/2020
FROM centos@sha256:27525fe9e8a84f95baf88459070124628bf83da7216052ea9365fe46e93a102f
RUN yum install -y wget && \
yum install -y system-config-services && \
yum install -y curl && \
wget --output-document jdk.rpm \
https://cdn.azul.com/zulu/bin/zulu8.21.0.1-jdk8.0.131-linux.x86_64.rpm && \