RFR: 8219585: [TESTBUG] sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java passes trivially when it shouldn't

Severin Gehwolf sgehwolf at redhat.com
Fri Feb 22 15:04:00 UTC 2019


Hi!

Bug: https://bugs.openjdk.java.net/browse/JDK-8219585

Could somebody please review this trivial testbug. For a config like
[1] the logic prior JDK-8145982 returned this list for
getAddressesForLocalHost():

[localhost/127.0.0.1, localhost/192.168.1.18, localhost/0:0:0:0:0:0:0:1]

Post JDK-8145982, getAddressesForLocalHost() returns:

[localhost/192.168.1.18]

The fix is trivial. Just adjust the condition for as to when the test
should actually trivially pass:

diff --git a/test/jdk/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java b/test/jdk/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java
--- a/test/jdk/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java
+++ b/test/jdk/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java
@@ -176,8 +176,8 @@
     }
 
     public static void main(String[] args) {
-        List<InetAddress> addrs = getAddressesForLocalHost();
-        if (addrs.size() < 2) {
+        List<InetAddress> addrs = getNonLoopbackAddressesForLocalHost();
+        if (addrs.size() < 1) {
             System.out.println("Ignoring manual test since no more than one IPs are configured for 'localhost'");
             return;
         }
@@ -186,7 +186,7 @@
         System.out.println("All tests PASSED.");
     }
 
-    private static List<InetAddress> getAddressesForLocalHost() {
+    private static List<InetAddress> getNonLoopbackAddressesForLocalHost() {
 
         try {
             return NetworkInterface.networkInterfaces()


Testing: Manual testing on local setup. jdk/submit (currently running)

Thanks,
Severin


[1] $ grep localhost /etc/hosts | grep -v '::'
127.0.0.1    localhost localhost.localdomain localhost4 localhost4.localdomain4
192.168.1.18 localhost



More information about the serviceability-dev mailing list