JDK-8181975 : Run sun/security/pkcs11 tests on Mac
  • Type: Bug
  • Component: security-libs
  • Sub-Component: javax.crypto:pkcs11
  • Affected Version: 8
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • Submitted: 2017-06-12
  • Updated: 2018-02-08
  • Resolved: 2017-06-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8u161 b01Fixed
Description
sun/security/pkcs11 tests checks if NSS libs are available on the machine, and run it an appropriate libs were found. The tests use the following mapping to find a path to libs on specific platforms:

http://hg.openjdk.java.net/jdk9/dev/jdk/file/42f18c931bd4/test/sun/security/pkcs11/PKCS11Test.java#l613

See that tests for 9 support Mac. But tests for 8 don't:

http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/file/9c692f857417/test/sun/security/pkcs11/PKCS11Test.java#l496

The tests are pretty much the same for both JDK 8 and 9, so the tests for 8 may be probably updated to be run on Mac as well.
Comments
Review : http://mail.openjdk.java.net/pipermail/security-dev/2017-June/016031.html
22-06-2017

Patch diff -r 9c692f857417 test/sun/security/pkcs11/PKCS11Test.java --- a/test/sun/security/pkcs11/PKCS11Test.java Sun Jun 11 07:45:24 2017 -0700 +++ b/test/sun/security/pkcs11/PKCS11Test.java Mon Jun 12 18:54:32 2017 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -509,6 +509,8 @@ PKCS11_BASE + "/nss/lib/windows-i586/".replace('/', SEP)}); osMap.put("Windows-amd64-64", new String[]{ PKCS11_BASE + "/nss/lib/windows-amd64/".replace('/', SEP)}); + osMap.put("MacOSX-x86_64-64", new String[]{ + PKCS11_BASE + "/nss/lib/macosx-x86_64/"}); } private final static char[] hexDigits = "0123456789abcdef".toCharArray();
13-06-2017