Skip to content

Commit

Permalink
8314283: Support for NSS tests on aarch64 platforms
Browse files Browse the repository at this point in the history
Reviewed-by: rhalade
  • Loading branch information
Matthew Donovan committed Oct 11, 2023
1 parent 3f6d016 commit 2a80160
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 17 deletions.
4 changes: 4 additions & 0 deletions test/jdk/sun/security/pkcs11/KeyStore/ClientAuth.java
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,10 @@ void startClient (boolean newThread) {
* Our client thread just died.
*/
System.err.println("Client died...");
// if the exception is thrown before connecting to the
// server, the test will time out and the exception will
// be lost/hidden.
e.printStackTrace(System.err);
clientException = e;
}
});
Expand Down
51 changes: 34 additions & 17 deletions test/jdk/sun/security/pkcs11/PKCS11Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ public abstract class PKCS11Test {
private static final char[] HEX_DIGITS = "0123456789abcdef".toCharArray();
private static final SecureRandom srdm = new SecureRandom();

// Version of the NSS artifact. This coincides with the version of
// the NSS version
private static final String NSS_BUNDLE_VERSION = "3.91";
private static final String NSSLIB = "jpg.tests.jdk.nsslib";

static double nss_version = -1;
static ECCState nss_ecc_status = ECCState.Basic;

Expand Down Expand Up @@ -807,18 +812,21 @@ static byte[] generateData(int length) {

private static String fetchNssLib(String osId) {
switch (osId) {
case "Windows-x86-32":
return fetchNssLib(WINDOWS_X86.class);

case "Windows-amd64-64":
return fetchNssLib(WINDOWS_X64.class);

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

case "MacOSX-aarch64-64":
return fetchNssLib(MACOSX_AARCH64.class);

case "Linux-amd64-64":
return fetchNssLib(LINUX_X64.class);

case "Linux-aarch64-64":
return fetchNssLib(LINUX_AARCH64.class);

default:
return null;
}
Expand All @@ -828,8 +836,8 @@ private static String fetchNssLib(Class<?> clazz) {
String path = null;
try {
path = ArtifactResolver.resolve(clazz).entrySet().stream()
.findAny().get().getValue() + File.separator + "nsslib"
+ File.separator;
.findAny().get().getValue() + File.separator + "nss"
+ File.separator + "lib" + File.separator;
} catch (ArtifactResolverException e) {
Throwable cause = e.getCause();
if (cause == null) {
Expand Down Expand Up @@ -931,34 +939,43 @@ protected void copyNssCertKeyToClassesDir(Path dbPath) throws IOException {
public static enum ECCState {None, Basic, Extended}

@Artifact(
organization = "jpg.tests.jdk.nsslib",
organization = NSSLIB,
name = "nsslib-windows_x64",
revision = "3.46-VS2017",
revision = NSS_BUNDLE_VERSION,
extension = "zip")
private static class WINDOWS_X64 {
}

@Artifact(
organization = "jpg.tests.jdk.nsslib",
name = "nsslib-windows_x86",
revision = "3.46-VS2017",
organization = NSSLIB,
name = "nsslib-macosx_x64",
revision = NSS_BUNDLE_VERSION,
extension = "zip")
private static class WINDOWS_X86 {
private static class MACOSX_X64 {
}

@Artifact(
organization = "jpg.tests.jdk.nsslib",
name = "nsslib-macosx_x64",
revision = "3.46",
organization = NSSLIB,
name = "nsslib-macosx_aarch64",
revision = NSS_BUNDLE_VERSION,
extension = "zip")
private static class MACOSX_X64 {
private static class MACOSX_AARCH64 {
}

@Artifact(
organization = "jpg.tests.jdk.nsslib",
organization = NSSLIB,
name = "nsslib-linux_x64",
revision = "3.46",
revision = NSS_BUNDLE_VERSION,
extension = "zip")
private static class LINUX_X64 {
}

@Artifact(
organization = NSSLIB,
name = "nsslib-linux_aarch64",
revision = NSS_BUNDLE_VERSION,
extension = "zip"
)
private static class LINUX_AARCH64{
}
}

7 comments on commit 2a80160

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin
Copy link
Member

@GoeLin GoeLin commented on 2a80160 Jan 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk21u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 2a80160 Jan 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin the backport was successfully created on the branch backport-GoeLin-2a801609 in my personal fork of openjdk/jdk21u-dev. To create a pull request with this backport targeting openjdk/jdk21u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 2a801609 from the openjdk/jdk repository.

The commit being backported was authored by Matthew Donovan on 11 Oct 2023 and was reviewed by Rajan Halade.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk21u-dev:

$ git fetch https://github.com/openjdk-bots/jdk21u-dev.git backport-GoeLin-2a801609:backport-GoeLin-2a801609
$ git checkout backport-GoeLin-2a801609
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk21u-dev.git backport-GoeLin-2a801609

@luchenlin
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 2a80160 Mar 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@luchenlin the backport was successfully created on the branch backport-luchenlin-2a801609 in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 2a801609 from the openjdk/jdk repository.

The commit being backported was authored by Matthew Donovan on 11 Oct 2023 and was reviewed by Rajan Halade.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev:

$ git fetch https://github.com/openjdk-bots/jdk17u-dev.git backport-luchenlin-2a801609:backport-luchenlin-2a801609
$ git checkout backport-luchenlin-2a801609
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u-dev.git backport-luchenlin-2a801609

@luchenlin
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk11u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 2a80160 Mar 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@luchenlin Could not automatically backport 2a801609 to openjdk/jdk11u-dev due to conflicts in the following files:

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

Please fetch the appropriate branch/commit and manually resolve these conflicts by using the following commands in your personal fork of openjdk/jdk11u-dev. Note: these commands are just some suggestions and you can use other equivalent commands you know.

# Fetch the up-to-date version of the target branch
$ git fetch --no-tags https://git.openjdk.org/jdk11u-dev.git master:master

# Check out the target branch and create your own branch to backport
$ git checkout master
$ git checkout -b backport-luchenlin-2a801609

# Fetch the commit you want to backport
$ git fetch --no-tags https://git.openjdk.org/jdk.git 2a8016096000de5836251f2ca9bc8ad6479e6942

# Backport the commit
$ git cherry-pick --no-commit 2a8016096000de5836251f2ca9bc8ad6479e6942
# Resolve conflicts now

# Commit the files you have modified
$ git add files/with/resolved/conflicts
$ git commit -m 'Backport 2a8016096000de5836251f2ca9bc8ad6479e6942'

Once you have resolved the conflicts as explained above continue with creating a pull request towards the openjdk/jdk11u-dev with the title Backport 2a8016096000de5836251f2ca9bc8ad6479e6942.

Below you can find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 2a801609 from the openjdk/jdk repository.

The commit being backported was authored by Matthew Donovan on 11 Oct 2023 and was reviewed by Rajan Halade.

Thanks!

Please sign in to comment.