8196590: Enable docker container related tests for linux AARCH64
authordsamersoff
Sat, 03 Mar 2018 10:15:23 +0000
changeset 49344 e55d7a31cfa7
parent 49343 d3b6dd4bd7b8
child 49345 2a12ff1fff68
8196590: Enable docker container related tests for linux AARCH64 Summary: Add test bits required for aarch64 Reviewed-by: mseledtsov, mbaesken, sspitsyn
test/hotspot/jtreg/runtime/containers/docker/Dockerfile-BasicTest-aarch64
test/jtreg-ext/requires/VMProps.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/runtime/containers/docker/Dockerfile-BasicTest-aarch64	Sat Mar 03 10:15:23 2018 +0000
@@ -0,0 +1,8 @@
+# Use generic ubuntu Linux on AArch64
+FROM aarch64/ubuntu
+
+COPY /jdk /jdk
+
+ENV JAVA_HOME=/jdk
+
+CMD ["/bin/bash"]
--- a/test/jtreg-ext/requires/VMProps.java	Mon Mar 05 13:10:31 2018 -0800
+++ b/test/jtreg-ext/requires/VMProps.java	Sat Mar 03 10:15:23 2018 +0000
@@ -366,18 +366,34 @@
      * @return true if docker is supported in a given environment
      */
     protected String dockerSupport() {
-        // currently docker testing is only supported for Linux-x64, Linux-s390x and Linux-ppc64le
-        String arch = System.getProperty("os.arch");
-        if (! (Platform.isLinux() && (Platform.isX64() || Platform.isS390x() || arch.equals("ppc64le")))) {
-            return "false";
+        boolean isSupported = false;
+        if (Platform.isLinux()) {
+           // currently docker testing is only supported for Linux,
+           // on certain platforms
+
+           String arch = System.getProperty("os.arch");
+
+           if (Platform.isX64()) {
+              isSupported = true;
+           }
+           else if (Platform.isAArch64()) {
+              isSupported = true;
+           }
+           else if (Platform.isS390x()) {
+              isSupported = true;
+           }
+           else if (arch.equals("ppc64le")) {
+              isSupported = true;
+           }
         }
 
-        boolean isSupported;
-        try {
-            isSupported = checkDockerSupport();
-        } catch (Exception e) {
-            isSupported = false;
-        }
+        if (isSupported) {
+           try {
+              isSupported = checkDockerSupport();
+           } catch (Exception e) {
+              isSupported = false;
+           }
+         }
 
         return (isSupported) ? "true" : "false";
     }