-
Notifications
You must be signed in to change notification settings - Fork 6k
8342270: Test sun/security/pkcs11/Provider/RequiredMechCheck.java needs write access to src tree #21665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
👋 Welcome back fguallini! A progress list of the required criteria for merging this PR into |
@fguallini This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 205 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@erikj79, @rhalade) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
@fguallini The following label will be automatically applied to this pull request:
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. |
Webrevs
|
@@ -247,6 +247,30 @@ public static String getBase() throws Exception { | |||
return PKCS11_BASE; | |||
} | |||
|
|||
private static void copyFiles(Path source, String destination) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check jdk.test.lib if there is a method you can use to copy files. If not then this method should be added to library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to use the existing Utils.copyFile, it was also needed to add the dependency in a shell test that uses PKCS11Test.java
@@ -497,13 +521,17 @@ public static String getNssConfig() throws Exception { | |||
} | |||
|
|||
String base = getBase(); | |||
String nss = "nss"; | |||
Path nssDirSource = Path.of(base).resolve(nss); | |||
String nssDirDestination = Path.of(".").resolve(nss).toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using current directory here may be incorrect. Can this be changed to Path.of(System.getProperty("test.classes"), ".")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "test.classes" directory only contains the compiled classes according to jtreg doc.
Whereas, the current directory is the Jtreg scratch directory, which is the right place for the tests temporary files. Also, Jtreg will automatically clean this directory when the test begins.
The scratch directory does seem like the best place to store these temporary configuration files.
/integrate |
@fguallini |
/sponsor |
Going to push as commit 342fe42.
Your commit was automatically rebased without conflicts. |
@rhalade @fguallini Pushed as commit 342fe42. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
The test sun/security/pkcs11/Provider/RequiredMechCheck.java extends sun/security/pkcs11/PKCS11Test.java, which sets up a PKCS11Provider configured with NSS config files located in the source tree directory (sun/security/pkcs11/nss) for the dependent tests to run properly. This test currently fails if that pkcs11/nss directory is made read-only because these config files are updated during the test execution. Files located in the source tree should not be modified when running tests.
This PR updates the PKCS11Test to copy the NSS config files to the Jtreg scratch directory and configures the provider to use those files instead.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/21665/head:pull/21665
$ git checkout pull/21665
Update a local copy of the PR:
$ git checkout pull/21665
$ git pull https://git.openjdk.org/jdk.git pull/21665/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 21665
View PR using the GUI difftool:
$ git pr show -t 21665
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/21665.diff
Using Webrev
Link to Webrev Comment