Skip to content

Commit 3433fdb

Browse files
author
Andrew Lu
committed
8314283: Support for NSS tests on aarch64 platforms
Backport-of: 2a8016096000de5836251f2ca9bc8ad6479e6942
1 parent 0606e5a commit 3433fdb

File tree

2 files changed

+38
-17
lines changed

2 files changed

+38
-17
lines changed

test/jdk/sun/security/pkcs11/KeyStore/ClientAuth.java

+4
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,10 @@ void startClient (boolean newThread) {
389389
* Our client thread just died.
390390
*/
391391
System.err.println("Client died...");
392+
// if the exception is thrown before connecting to the
393+
// server, the test will time out and the exception will
394+
// be lost/hidden.
395+
e.printStackTrace(System.err);
392396
clientException = e;
393397
}
394398
});

test/jdk/sun/security/pkcs11/PKCS11Test.java

+34-17
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ public abstract class PKCS11Test {
7474
private static final String PKCS11_REL_PATH = "sun/security/pkcs11";
7575
private static final char[] HEX_DIGITS = "0123456789abcdef".toCharArray();
7676

77+
// Version of the NSS artifact. This coincides with the version of
78+
// the NSS version
79+
private static final String NSS_BUNDLE_VERSION = "3.91";
80+
private static final String NSSLIB = "jpg.tests.jdk.nsslib";
81+
7782
static double nss_version = -1;
7883
static ECCState nss_ecc_status = ECCState.Basic;
7984

@@ -744,18 +749,21 @@ static byte[] generateData(int length) {
744749

745750
private static String fetchNssLib(String osId) {
746751
switch (osId) {
747-
case "Windows-x86-32":
748-
return fetchNssLib(WINDOWS_X86.class);
749-
750752
case "Windows-amd64-64":
751753
return fetchNssLib(WINDOWS_X64.class);
752754

753755
case "MacOSX-x86_64-64":
754756
return fetchNssLib(MACOSX_X64.class);
755757

758+
case "MacOSX-aarch64-64":
759+
return fetchNssLib(MACOSX_AARCH64.class);
760+
756761
case "Linux-amd64-64":
757762
return fetchNssLib(LINUX_X64.class);
758763

764+
case "Linux-aarch64-64":
765+
return fetchNssLib(LINUX_AARCH64.class);
766+
759767
default:
760768
return null;
761769
}
@@ -765,8 +773,8 @@ private static String fetchNssLib(Class<?> clazz) {
765773
String path = null;
766774
try {
767775
path = ArtifactResolver.resolve(clazz).entrySet().stream()
768-
.findAny().get().getValue() + File.separator + "nsslib"
769-
+ File.separator;
776+
.findAny().get().getValue() + File.separator + "nss"
777+
+ File.separator + "lib" + File.separator;
770778
} catch (ArtifactResolverException e) {
771779
Throwable cause = e.getCause();
772780
if (cause == null) {
@@ -868,34 +876,43 @@ protected void copyNssCertKeyToClassesDir(Path dbPath) throws IOException {
868876
public static enum ECCState {None, Basic, Extended}
869877

870878
@Artifact(
871-
organization = "jpg.tests.jdk.nsslib",
879+
organization = NSSLIB,
872880
name = "nsslib-windows_x64",
873-
revision = "3.46-VS2017",
881+
revision = NSS_BUNDLE_VERSION,
874882
extension = "zip")
875883
private static class WINDOWS_X64 {
876884
}
877885

878886
@Artifact(
879-
organization = "jpg.tests.jdk.nsslib",
880-
name = "nsslib-windows_x86",
881-
revision = "3.46-VS2017",
887+
organization = NSSLIB,
888+
name = "nsslib-macosx_x64",
889+
revision = NSS_BUNDLE_VERSION,
882890
extension = "zip")
883-
private static class WINDOWS_X86 {
891+
private static class MACOSX_X64 {
884892
}
885893

886894
@Artifact(
887-
organization = "jpg.tests.jdk.nsslib",
888-
name = "nsslib-macosx_x64",
889-
revision = "3.46",
895+
organization = NSSLIB,
896+
name = "nsslib-macosx_aarch64",
897+
revision = NSS_BUNDLE_VERSION,
890898
extension = "zip")
891-
private static class MACOSX_X64 {
899+
private static class MACOSX_AARCH64 {
892900
}
893901

894902
@Artifact(
895-
organization = "jpg.tests.jdk.nsslib",
903+
organization = NSSLIB,
896904
name = "nsslib-linux_x64",
897-
revision = "3.46",
905+
revision = NSS_BUNDLE_VERSION,
898906
extension = "zip")
899907
private static class LINUX_X64 {
900908
}
909+
910+
@Artifact(
911+
organization = NSSLIB,
912+
name = "nsslib-linux_aarch64",
913+
revision = NSS_BUNDLE_VERSION,
914+
extension = "zip"
915+
)
916+
private static class LINUX_AARCH64{
917+
}
901918
}

0 commit comments

Comments
 (0)