-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
JDK-8295756 Improve NonLocalRegistry Manual Test Process #10825
Conversation
👋 Welcome back bhuang! A progress list of the required criteria for merging this PR into |
@bwhuang-us 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. |
Webrevs
|
test/jdk/TEST.groups
Outdated
@@ -200,6 +200,8 @@ jdk_time = \ | |||
|
|||
jdk_rmi = \ | |||
java/rmi \ | |||
-java/rmi/registry/nonLocalRegistry/NonLocalRegistryTest.java \ | |||
-java/rmi/registry/nonLocalRegistry/NonLocalSkeletonTest.java \ |
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.
RunTests.gmk runs jtreg with -automatic so I don't think you need to exclude the manual tests from these test groups.
public class NonLocalRegistryBase { | ||
static final String instructions = | ||
"This is a manual test that requires rmiregistry run on a different host" | ||
+ ". Login or ssh to a different host, install the latest JDK " |
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.
replace "latest JDK" with "JDK under test"
@@ -154,4 +222,43 @@ private static void assertIsAccessException(Throwable ex) { | |||
throw new RuntimeException("AccessException did not occur when expected", ex); | |||
} | |||
} | |||
|
|||
private String readHostInput(int index) { |
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.
Duplicate code, this code is also in NonLocalRegistryBase.java, Please move this code in a common class under lib/jdk/test/lib. Or move this NonLocalRegistryBase.java under lib/jdk/test/lib and provide some generic name.
*/ | ||
public class NonLocalRegistryTest { | ||
public class NonLocalRegistryTest extends NonLocalRegistryBase { |
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.
Move private static void assertIsAccessException(Throwable ex) method to NonLocalRegistryBase class.
@@ -76,12 +78,17 @@ | |||
* On the first host modify the @run command above to replace "rmi-registry-host" | |||
* with the hostname or IP address of the different host and run the test with jtreg. | |||
*/ | |||
public class NonLocalSkeletonTest { | |||
public class NonLocalSkeletonTest extends NonLocalRegistryBase { |
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.
Move private static void assertIsAccessException(Throwable ex) method to NonLocalRegistryBase class.
@@ -154,4 +222,43 @@ private static void assertIsAccessException(Throwable ex) { | |||
throw new RuntimeException("AccessException did not occur when expected", ex); |
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.
private static void assertIsAccessException(Throwable ex) is define in all these three test classes, move this method in lib/jdk/test/lib
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 method is test dependent that checks for specific keywords in the AccessException. It seems better remain inside the test classes.
LGTM |
Set<InetAddress> myAddrs = | ||
Set.copyOf(Arrays.asList(InetAddress.getAllByName(myHostName))); | ||
Set<InetAddress> hostAddrs = | ||
Set.copyOf(Arrays.asList(InetAddress.getAllByName(host))); |
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.
Is there a reason to change this from Set.of?
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 is a workaround for duplicate elements detected by Set.of(). On my localhost, InetAddress.getAllByName(localhost returns duplicate IPv6 addresses with different scoped id which is not counted during comparison. This change shouldn't impact the goal of these tests which is to verify that registry modification request from client side is prohibited.
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.
Thanks. You might want to add a comment to avoid drive-by suggestions to simplify it.
@bwhuang-us this pull request can not be integrated into git checkout JDK-8295756
git fetch https://git.openjdk.org/jdk master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
@bwhuang-us This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
@bwhuang-us This pull request has been inactive for more than 16 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the |
The current non local registry tests require a manual process that runs rmiregitrty on a different machine and changes the -Dregistry.host property in the source before running the tests on the local machine. This task is created to improve this manual process and provide a clearer instruction to the test engineer about the test requirement.
Tests include:
java/rmi/registry/nonLocalRegistry/NonLocalSkeletonTest.java
java/rmi/registry/nonLocalRegistry/NonLocalRegistryTest.java
javax/management/remote/nonLocalAccess/NonLocalJMXRemoteTest.java
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/10825/head:pull/10825
$ git checkout pull/10825
Update a local copy of the PR:
$ git checkout pull/10825
$ git pull https://git.openjdk.org/jdk pull/10825/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 10825
View PR using the GUI difftool:
$ git pr show -t 10825
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/10825.diff