8164322: Test sun/security/pkcs11/PKCS11Test.java shall be updated to run on ARM platforms
authortidu
Thu, 13 Oct 2016 00:45:38 -0700
changeset 41485 15a87b8ccd06
parent 41484 834b7539ada3
child 41486 95980c6371d6
8164322: Test sun/security/pkcs11/PKCS11Test.java shall be updated to run on ARM platforms Reviewed-by: xuelei Contributed-by: Tim Du <tiantian.du@oracle.com>
jdk/test/sun/security/pkcs11/PKCS11Test.java
--- a/jdk/test/sun/security/pkcs11/PKCS11Test.java	Wed Oct 12 15:41:00 2016 -0700
+++ b/jdk/test/sun/security/pkcs11/PKCS11Test.java	Thu Oct 13 00:45:38 2016 -0700
@@ -299,11 +299,12 @@
                 + props.getProperty("os.arch") + "-" + props.getProperty("sun.arch.data.model");
         String[] nssLibDirs = osMap.get(osid);
         if (nssLibDirs == null) {
-            System.out.println("Unsupported OS, skipping: " + osid);
+            System.out.println("Warning: unsupported OS: " + osid
+                    + ", please initialize NSS librarys location firstly, skipping test");
             return null;
         }
         if (nssLibDirs.length == 0) {
-            System.out.println("NSS not supported on this platform, skipping test");
+            System.out.println("Warning: NSS not supported on this platform, skipping test");
             return null;
         }
         String nssLibDir = null;
@@ -315,6 +316,10 @@
                 break;
             }
         }
+        if (nssLibDir == null) {
+            System.out.println("Warning: can't find NSS librarys on this machine, skipping test");
+            return null;
+        }
         return nssLibDir;
     }
 
@@ -624,6 +629,11 @@
             PKCS11_BASE + "/nss/lib/windows-amd64/".replace('/', SEP)});
         osMap.put("MacOSX-x86_64-64", new String[]{
             PKCS11_BASE + "/nss/lib/macosx-x86_64/"});
+        osMap.put("Linux-arm-32", new String[]{
+            "/usr/lib/arm-linux-gnueabi/nss/",
+            "/usr/lib/arm-linux-gnueabihf/nss/"});
+        osMap.put("Linux-aarch64-64", new String[]{
+            "/usr/lib/aarch64-linux-gnu/nss/"});
     }
 
     private final static char[] hexDigits = "0123456789abcdef".toCharArray();