-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
8267184: Add -Djava.security.manager=allow to tests calling System.setSecurityManager #4071
Conversation
👋 Welcome back weijun! A progress list of the required criteria for merging this PR into |
@wangweij The following labels 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 lists. If you would like to change these labels, use the /label pull request command. |
@wangweij Could not parse
|
/contributor add lancea |
@wangweij |
/contributor add weijun |
@wangweij |
@wangweij |
Webrevs
|
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.
Changes to hotspot-* and serviceability look good.
Thanks,
David
@wangweij 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 no new commits pushed to the ➡️ To integrate this PR with the above commit message to the |
The changes look okay but a bit inconsistent on where -Djava...=allow is inserted for tests that already set other system properties or other parameters. Not a correctness issue, just looks odd in several places, e.g. test/jdk/java/lang/System/LoggerFinder/BaseLoggerFinderTest/BaseLoggerFinderTest.java - the tests sets the system properties after -Xbootclasspath/a: but the change means it sets properties before and after. test/jdk/java/lang/Class/getResource/ResourcesTest.java - you've added it in the middle of the module and class path parameters. For uses using ProcessTools then it seems to be very random. |
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.
I looked at serviceability, net, and corelibs. The changes look good to me - though I have one question about the NotificationEmissionTest. I believe that regardless of whether the new property is needed, test case 1 should be run in /othervm too.
@@ -32,10 +32,10 @@ | |||
* @run clean NotificationEmissionTest | |||
* @run build NotificationEmissionTest | |||
* @run main NotificationEmissionTest 1 |
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.
This test case (NotificationEmissionTest 1) calls System.setProperty("java.security.policy", policyFile);
- even though it doesn't call System.setSecurityManager(); Should the @run command line for test case 1 be modified as well?
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.
Or maybe the policy setting line should only be called when a security manager is set? IIRC jtreg is able to restore system properties even in agentvm mode. So maybe this really doesn't matter. We just want to modify as little as possible in this PR.
I've updated the 3 cases you mentioned in my local repo and will go through more. Yes it looks good to group system property settings together. Thanks. |
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.
I reviewed non-client areas. Looks okay.
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 changes to the security tests look good.
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 client changes are fine except for the one misplaced (c)
@@ -1,5 +1,5 @@ | |||
/* | |||
* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. | |||
* Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights reserved. | |||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
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.
Probably the (c) update was meant to be on the .sh file that is actually modified.
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.
Oops, I'll back it out. Thanks.
/integrate |
@wangweij Since your change was applied there have been 5 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 640a2af. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Please review the test changes for JEP 411.
With JEP 411 and the default value of
-Djava.security.manager
becomingdisallow
, tests callingSystem.setSecurityManager()
need-Djava.security.manager=allow
when launched. This PR covers such changes for tier1 to tier3 (except for the JCK tests).To make it easier to focus your review on the tests in your area, this PR is divided into multiple commits for different areas (
serviceability,hotspot-compiler,i18n,rmi,javadoc, swing, 2d,security,hotspot-runtime,nio,xml,beans,core-libs,net,compiler,hotspot-gc). Mostly the rule is the same as how Skara adds labels, but there are several small tweaks:core-libs
. If a file is covered bycore-libs
and another label, I categorized it into the other label.core-libs
but contains/xml/
in its name, it's in thexml
commit.core-libs
but contains/rmi/
in its name, it's in thermi
commit.test/jdk/com/sun/java/accessibility/util/8051626/Bug8051626.java
-- is in theswing
commit.Due to the size of this PR, no attempt is made to update copyright years for all files to minimize unnecessary merge conflict.
Please note that this PR can be integrated before the source changes for JEP 411, as the possible values of this system property was already defined long time ago in JDK 9.
Most of the change in this PR is a simple adding of
-Djava.security.manager=allow
to the@run main/othervm
line. Sometimes it was notothervm
and we add one. Sometimes there's no@run
at all and we add the line.There are several tests that launch another Java process that needs to call the
System.setSecurityManager()
method, and the system property is added toProcessBuilder
,ProcessTools
, or the java command line (if the test is a shell test).3 langtools tests are added into problem list due to JDK-8265611.
2 SQL tests are moved because they need different options on the
@run
line but they are inside a directory that has aTEST.properties
:The source change for JEP 411 is at #4073.
Progress
Issue
Reviewers
Contributors
<lancea@openjdk.org>
<weijun@openjdk.org>
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4071/head:pull/4071
$ git checkout pull/4071
Update a local copy of the PR:
$ git checkout pull/4071
$ git pull https://git.openjdk.java.net/jdk pull/4071/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 4071
View PR using the GUI difftool:
$ git pr show -t 4071
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4071.diff