--- old/test/lib/jdk/test/lib/containers/docker/DockerTestUtils.java 2019-07-17 14:12:25.882663727 +0200 +++ new/test/lib/jdk/test/lib/containers/docker/DockerTestUtils.java 2019-07-17 14:12:25.566663135 +0200 @@ -37,6 +37,8 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.Map; +import jdk.test.lib.Platform; import jdk.test.lib.Utils; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; @@ -54,11 +56,6 @@ // diagnostic information. private static final int MAX_LINES_TO_COPY_FOR_CHILD_STDOUT = 100; - // Use this property to specify docker location on your system. - // E.g.: "/usr/local/bin/docker". - private static final String DOCKER_COMMAND = - System.getProperty("jdk.test.docker.command", "docker"); - // Set this property to true to retain image after test. By default // images are removed after test execution completes. // Retaining the image can be useful for diagnostics and image inspection. @@ -116,7 +113,7 @@ */ private static boolean isDockerEngineAvailableCheck() throws Exception { try { - execute(DOCKER_COMMAND, "ps") + execute(Platform.DOCKER_COMMAND, "ps") .shouldHaveExitValue(0) .shouldContain("CONTAINER") .shouldContain("IMAGE"); @@ -179,9 +176,8 @@ DockerfileConfig.getBaseImageVersion()); try { // Build the docker - execute(DOCKER_COMMAND, "build", "--no-cache", "--tag", imageName, buildDir.toString()) - .shouldHaveExitValue(0) - .shouldContain("Successfully built"); + execute(Platform.DOCKER_COMMAND, "build", "--no-cache", "--tag", imageName, buildDir.toString()) + .shouldHaveExitValue(0); } catch (Exception e) { // If docker image building fails there is a good chance it happens due to environment and/or // configuration other than product failure. Throw jtreg skipped exception in such case @@ -202,7 +198,7 @@ public static List buildJavaCommand(DockerRunOptions opts) throws Exception { List cmd = new ArrayList<>(); - cmd.add(DOCKER_COMMAND); + cmd.add(Platform.DOCKER_COMMAND); cmd.add("run"); if (opts.tty) cmd.add("--tty=true"); @@ -244,7 +240,7 @@ * @throws Exception */ public static void removeDockerImage(String imageNameAndTag) throws Exception { - execute(DOCKER_COMMAND, "rmi", "--force", imageNameAndTag); + execute(Platform.DOCKER_COMMAND, "rmi", "--force", imageNameAndTag); }