diff --git a/hotspot/test/TEST.groups b/hotspot/test/TEST.groups index c55ef8d17b9..03f6c0b6e4c 100644 --- a/hotspot/test/TEST.groups +++ b/hotspot/test/TEST.groups @@ -130,6 +130,9 @@ hotspot_wbapitest = \ hotspot_compiler = \ sanity/ExecuteInternalVMTests.java +hotspot_containers = \ + containers + hotspot_gc = \ sanity/ExecuteInternalVMTests.java \ -gc/g1/TestGreyReclaimedHumongousObjects.java @@ -260,6 +263,7 @@ compact1_minimal = \ testlibrary/ \ sanity/ \ runtime/ \ + containers/ \ gc/ \ -:needs_full_vm_compact1 \ -:needs_full_vm_compact2 \ diff --git a/hotspot/test/runtime/containers/cgroup/CgroupSubsystemFactory.java b/hotspot/test/containers/cgroup/CgroupSubsystemFactory.java similarity index 100% rename from hotspot/test/runtime/containers/cgroup/CgroupSubsystemFactory.java rename to hotspot/test/containers/cgroup/CgroupSubsystemFactory.java diff --git a/hotspot/test/runtime/containers/cgroup/PlainRead.java b/hotspot/test/containers/cgroup/PlainRead.java similarity index 100% rename from hotspot/test/runtime/containers/cgroup/PlainRead.java rename to hotspot/test/containers/cgroup/PlainRead.java diff --git a/hotspot/test/runtime/containers/docker/AttemptOOM.java b/hotspot/test/containers/docker/AttemptOOM.java similarity index 100% rename from hotspot/test/runtime/containers/docker/AttemptOOM.java rename to hotspot/test/containers/docker/AttemptOOM.java diff --git a/hotspot/test/runtime/containers/docker/CPUSetsReader.java b/hotspot/test/containers/docker/CPUSetsReader.java similarity index 100% rename from hotspot/test/runtime/containers/docker/CPUSetsReader.java rename to hotspot/test/containers/docker/CPUSetsReader.java diff --git a/hotspot/test/runtime/containers/docker/CheckContainerized.java b/hotspot/test/containers/docker/CheckContainerized.java similarity index 100% rename from hotspot/test/runtime/containers/docker/CheckContainerized.java rename to hotspot/test/containers/docker/CheckContainerized.java diff --git a/hotspot/test/runtime/containers/docker/CheckOperatingSystemMXBean.java b/hotspot/test/containers/docker/CheckOperatingSystemMXBean.java similarity index 100% rename from hotspot/test/runtime/containers/docker/CheckOperatingSystemMXBean.java rename to hotspot/test/containers/docker/CheckOperatingSystemMXBean.java diff --git a/hotspot/test/runtime/containers/docker/DockerBasicTest.java b/hotspot/test/containers/docker/DockerBasicTest.java similarity index 100% rename from hotspot/test/runtime/containers/docker/DockerBasicTest.java rename to hotspot/test/containers/docker/DockerBasicTest.java diff --git a/hotspot/test/runtime/containers/docker/HelloDocker.java b/hotspot/test/containers/docker/HelloDocker.java similarity index 100% rename from hotspot/test/runtime/containers/docker/HelloDocker.java rename to hotspot/test/containers/docker/HelloDocker.java diff --git a/hotspot/test/runtime/containers/docker/PrintContainerInfo.java b/hotspot/test/containers/docker/PrintContainerInfo.java similarity index 100% rename from hotspot/test/runtime/containers/docker/PrintContainerInfo.java rename to hotspot/test/containers/docker/PrintContainerInfo.java diff --git a/hotspot/test/runtime/containers/docker/TEST.properties b/hotspot/test/containers/docker/TEST.properties similarity index 100% rename from hotspot/test/runtime/containers/docker/TEST.properties rename to hotspot/test/containers/docker/TEST.properties diff --git a/hotspot/test/runtime/containers/docker/TestCPUAwareness.java b/hotspot/test/containers/docker/TestCPUAwareness.java similarity index 100% rename from hotspot/test/runtime/containers/docker/TestCPUAwareness.java rename to hotspot/test/containers/docker/TestCPUAwareness.java diff --git a/hotspot/test/runtime/containers/docker/TestCPUSets.java b/hotspot/test/containers/docker/TestCPUSets.java similarity index 100% rename from hotspot/test/runtime/containers/docker/TestCPUSets.java rename to hotspot/test/containers/docker/TestCPUSets.java diff --git a/hotspot/test/runtime/containers/docker/TestMemoryAwareness.java b/hotspot/test/containers/docker/TestMemoryAwareness.java similarity index 100% rename from hotspot/test/runtime/containers/docker/TestMemoryAwareness.java rename to hotspot/test/containers/docker/TestMemoryAwareness.java diff --git a/hotspot/test/runtime/containers/docker/TestMisc.java b/hotspot/test/containers/docker/TestMisc.java similarity index 100% rename from hotspot/test/runtime/containers/docker/TestMisc.java rename to hotspot/test/containers/docker/TestMisc.java diff --git a/test/lib/jdk/test/lib/containers/docker/DockerTestUtils.java b/test/lib/jdk/test/lib/containers/docker/DockerTestUtils.java index dc3baaeefe7..ec5f2689961 100644 --- a/test/lib/jdk/test/lib/containers/docker/DockerTestUtils.java +++ b/test/lib/jdk/test/lib/containers/docker/DockerTestUtils.java @@ -42,6 +42,7 @@ import jdk.test.lib.Utils; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; +import jtreg.SkippedException; public class DockerTestUtils { @@ -90,9 +91,7 @@ public static boolean canTestDocker() throws Exception { if (isDockerEngineAvailable()) { return true; } else { - System.out.println("Docker engine is not available on this system"); - System.out.println("This test is SKIPPED"); - return false; + throw new SkippedException("Docker engine is not available on this system"); } } @@ -171,8 +170,17 @@ private static boolean isDockerEngineAvailableCheck() throws Exception { DockerfileConfig.getBaseImageVersion()); // Build the docker - execute(Container.ENGINE_COMMAND, "build", "--no-cache", "--tag", imageName, buildDir.toString()) - .shouldHaveExitValue(0); + try { + // Build the docker + execute(Container.ENGINE_COMMAND, "build", "--no-cache", "--tag", imageName, buildDir.toString()) + .shouldHaveExitValue(0) + .shouldContain("Successfully built"); + } 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. + throw new SkippedException("Building docker image failed. Details: \n" + e.getMessage()); + } }