< prev index next >

test/lib/jdk/test/lib/containers/docker/DockerTestUtils.java

Print this page
@  rev 55753 : 8228434: jdk/net/Sockets/Test.java fails after JDK-8227642
|  Reviewed-by: duke
~

*** 110,120 **** * @return true if docker engine is available and usable * @throws Exception */ private static boolean isDockerEngineAvailableCheck() throws Exception { try { ! execute(Platform.DOCKER_COMMAND, "ps") .shouldHaveExitValue(0) .shouldContain("CONTAINER") .shouldContain("IMAGE"); } catch (Exception e) { return false; --- 110,120 ---- * @return true if docker engine is available and usable * @throws Exception */ private static boolean isDockerEngineAvailableCheck() throws Exception { try { ! execute(Platform.Docker.DOCKER_COMMAND, "ps") .shouldHaveExitValue(0) .shouldContain("CONTAINER") .shouldContain("IMAGE"); } catch (Exception e) { return false;
*** 173,183 **** generateDockerFile(buildDir.resolve("Dockerfile"), DockerfileConfig.getBaseImageName(), DockerfileConfig.getBaseImageVersion()); try { // Build the docker ! 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 // instead of failing the test. --- 173,183 ---- generateDockerFile(buildDir.resolve("Dockerfile"), DockerfileConfig.getBaseImageName(), DockerfileConfig.getBaseImageVersion()); try { // Build the docker ! execute(Platform.Docker.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 // instead of failing the test.
*** 195,205 **** * @throws Exception */ public static List<String> buildJavaCommand(DockerRunOptions opts) throws Exception { List<String> cmd = new ArrayList<>(); ! cmd.add(Platform.DOCKER_COMMAND); cmd.add("run"); if (opts.tty) cmd.add("--tty=true"); if (opts.removeContainerAfterUse) cmd.add("--rm"); --- 195,205 ---- * @throws Exception */ public static List<String> buildJavaCommand(DockerRunOptions opts) throws Exception { List<String> cmd = new ArrayList<>(); ! cmd.add(Platform.Docker.DOCKER_COMMAND); cmd.add("run"); if (opts.tty) cmd.add("--tty=true"); if (opts.removeContainerAfterUse) cmd.add("--rm");
*** 237,247 **** * * @param DockerRunOptions optins for running docker * @throws Exception */ public static void removeDockerImage(String imageNameAndTag) throws Exception { ! execute(Platform.DOCKER_COMMAND, "rmi", "--force", imageNameAndTag); } /** --- 237,247 ---- * * @param DockerRunOptions optins for running docker * @throws Exception */ public static void removeDockerImage(String imageNameAndTag) throws Exception { ! execute(Platform.Docker.DOCKER_COMMAND, "rmi", "--force", imageNameAndTag); } /**
< prev index next >