8166837: [TESTBUG] Fix tests on Linux/s390x
authorgoetz
Mon, 31 Oct 2016 11:43:07 +0100
changeset 42508 e63749e2c454
parent 42010 13940eebb34f
child 42509 ef65c68a17f1
8166837: [TESTBUG] Fix tests on Linux/s390x Reviewed-by: kvn, simonis
test/lib/jdk/test/lib/Platform.java
--- a/test/lib/jdk/test/lib/Platform.java	Tue Oct 25 14:49:48 2016 +0300
+++ b/test/lib/jdk/test/lib/Platform.java	Mon Oct 31 11:43:07 2016 +0100
@@ -160,9 +160,8 @@
         return vmVersion;
     }
 
-    // Returns true for sparc and sparcv9.
-    public static boolean isSparc() {
-        return isArch("sparc.*");
+    public static boolean isAArch64() {
+        return isArch("aarch64");
     }
 
     public static boolean isARM() {
@@ -173,9 +172,14 @@
         return isArch("ppc.*");
     }
 
-    public static boolean isX86() {
-        // On Linux it's 'i386', Windows 'x86' without '_64' suffix.
-        return isArch("(i386)|(x86(?!_64))");
+    // Returns true for IBM z System running linux.
+    public static boolean isS390x() {
+        return isArch("s390.*") || isArch("s/390.*") || isArch("zArch_64");
+    }
+
+    // Returns true for sparc and sparcv9.
+    public static boolean isSparc() {
+        return isArch("sparc.*");
     }
 
     public static boolean isX64() {
@@ -183,8 +187,9 @@
         return isArch("(amd64)|(x86_64)");
     }
 
-    public static boolean isAArch64() {
-        return isArch("aarch64");
+    public static boolean isX86() {
+        // On Linux it's 'i386', Windows 'x86' without '_64' suffix.
+        return isArch("(i386)|(x86(?!_64))");
     }
 
     public static String getOsArch() {
@@ -200,6 +205,7 @@
         if (isAix()) {
             return false;   // SA not implemented.
         } else if (isLinux()) {
+            if (isS390x()) { return false; }   // SA not implemented.
             return canPtraceAttachLinux();
         } else if (isOSX()) {
             return canAttachOSX();