Skip to content

Conversation

@nehajoshinj
Copy link

@nehajoshinj nehajoshinj commented Oct 16, 2025

This PR contain changes to handle skipped exception for below test cases.

  • test/jdk/sun/security/pkcs11/Cipher/KeyWrap/XMLEncKAT.java
  • test/jdk/sun/security/pkcs11/Cipher/KeyWrap/TestGeneral.java
  • test/jdk/sun/security/pkcs11/Cipher/KeyWrap/NISTWrapKAT.java

Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Error

 ⚠️ Found copyright format issue for oracle in [test/jdk/sun/security/pkcs11/Cipher/KeyWrap/XMLEncKAT.java]

Issue

  • JDK-8368524: Tests are skipped and shown as passed in test/jdk/sun/security/pkcs11/Cipher/KeyWrap (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27847/head:pull/27847
$ git checkout pull/27847

Update a local copy of the PR:
$ git checkout pull/27847
$ git pull https://git.openjdk.org/jdk.git pull/27847/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 27847

View PR using the GUI difftool:
$ git pr show -t 27847

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27847.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper bridgekeeper bot added the oca Needs verification of OCA signatory status label Oct 16, 2025
@bridgekeeper
Copy link

bridgekeeper bot commented Oct 16, 2025

Hi @nehajoshinj, welcome to this OpenJDK project and thanks for contributing!

We do not recognize you as Contributor and need to ensure you have signed the Oracle Contributor Agreement (OCA). If you have not signed the OCA, please follow the instructions. Please fill in your GitHub username in the "Username" field of the application. Once you have signed the OCA, please let us know by writing /signed in a comment in this pull request.

If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please use "Add GitHub user nehajoshinj" as summary for the issue.

If you are contributing this work on behalf of your employer and your employer has signed the OCA, please let us know by writing /covered in a comment in this pull request.

@openjdk
Copy link

openjdk bot commented Oct 16, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot changed the title JDK-8368524: Tests are skipped and shown as passed in test/jdk/sun/security/pkcs11/Cipher/KeyWrap 8368524: Tests are skipped and shown as passed in test/jdk/sun/security/pkcs11/Cipher/KeyWrap Oct 16, 2025
@openjdk
Copy link

openjdk bot commented Oct 16, 2025

@nehajoshinj The following label will be automatically applied to this pull request:

  • security

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@nehajoshinj
Copy link
Author

/covered

@bridgekeeper bridgekeeper bot added the oca-verify Needs verification of OCA signatory status label Oct 16, 2025
@bridgekeeper
Copy link

bridgekeeper bot commented Oct 16, 2025

Thank you! Please allow for a few business days to verify that your employer has signed the OCA. Also, please note that pull requests that are pending an OCA check will not usually be evaluated, so your patience is appreciated!

Copy link
Member

@myankelev myankelev left a comment

Choose a reason for hiding this comment

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

Looks good, just a few questions

if (keyLen > allowed) {
System.out.println("=> skip, exceeds max allowed size " + allowed);
return;
throw new SkippedException("Skip, exceeds max allowed size " + allowed);
Copy link
Member

Choose a reason for hiding this comment

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

I think it's better to keep this as is, as in case this throws skipped exception it will stop the rest of the tests and they will not run. This could cause the error to be thrown.

One of the options that come to mind is to have the line 399 testEnc(algo, (String)td[1], (int)td[2], (String)td[3], catch skipped exception and add to the skippedAlgoList.
Another option could be to pass boolean/status out the method and use it to check if test actually run.
Another option could be to keep the skipped list as a global var and append it from here directly.

These are not the only options, so if you think of something better - it's your call.

Copy link
Author

Choose a reason for hiding this comment

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

I kept the return statement as it is and made skippedAlgoList a global variable.
For each skip , we will add the element in the list .

Copy link
Member

@myankelev myankelev left a comment

Choose a reason for hiding this comment

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

Looks good, just 2 questions

if (skippedAlgoList.isEmpty()) {
System.out.println("All Tests Passed");
} else {
System.err.println("Some tests were skipped : " + skippedAlgoList);
Copy link
Member

Choose a reason for hiding this comment

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

This will only log a skip this way. Please throw an exception in the end.

Suggested change
System.err.println("Some tests were skipped : " + skippedAlgoList);
throw new SkippedException("Some tests were skipped : " + skippedAlgoList);

// adapted from com/sun/crypto/provider/Cipher/KeyWrap/NISTWrapKAT.java
public class NISTWrapKAT extends PKCS11Test {

private static List<String> skippedAlgoList = new ArrayList<>();
Copy link
Member

Choose a reason for hiding this comment

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

nit:

Suggested change
private static List<String> skippedAlgoList = new ArrayList<>();
private static final List<String> skippedAlgoList = new ArrayList<>();

@myankelev
Copy link
Member

Looks good to me

@bridgekeeper bridgekeeper bot removed oca Needs verification of OCA signatory status oca-verify Needs verification of OCA signatory status labels Oct 23, 2025
@openjdk openjdk bot added the rfr Pull request is ready for review label Oct 23, 2025
@mlbridge
Copy link

mlbridge bot commented Oct 23, 2025

Webrevs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rfr Pull request is ready for review security [email protected]

Development

Successfully merging this pull request may close these issues.

2 participants