8164322: Test sun/security/pkcs11/PKCS11Test.java shall be updated to run on ARM platforms

Reviewed-by: xuelei
This commit is contained in:
Tim Du 2016-10-13 00:45:38 -07:00 committed by Tim Du
parent 44a7c1b644
commit 6e9244aea4

View File

@ -299,11 +299,12 @@ public abstract class PKCS11Test {
+ 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 @@ public abstract class PKCS11Test {
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 @@ public abstract class PKCS11Test {
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();