Use IP address in tests
authorVladimir Petko <vladimir.petko@canonical.com>
Wed, 22 Jan 2025 09:17:58 +0000 (10:17 +0100)
committerMatthias Klose <doko@ubuntu.com>
Wed, 22 Jan 2025 09:17:58 +0000 (10:17 +0100)
Forwarded: not-needed
Last-Update: 2023-03-27

Ubuntu build machines are not set up for dns. Use IP addresses to get correct test
outcomes.

Gbp-Pq: Name test-use-ip-address.patch

test/jdk/java/net/InetAddress/IsReachableViaLoopbackTest.java
test/jdk/java/net/InetAddress/getOriginalHostName.java

index 5364ba7895ec160b6c57e169432f6d683af8c43f..f9280c3ed8e32357834fd2c1b8020f966c6024b0 100644 (file)
@@ -13,7 +13,7 @@ public class IsReachableViaLoopbackTest {
     public static void main(String[] args) {
         try {
             InetAddress addr = InetAddress.getByName("localhost");
-            InetAddress remoteAddr = InetAddress.getByName("bugs.openjdk.java.net");
+            InetAddress remoteAddr = InetAddress.getByName("8.8.8.8");
             if (!addr.isReachable(10000))
                 throw new RuntimeException("Localhost should always be reachable");
             NetworkInterface inf = NetworkInterface.getByInetAddress(addr);
index 9f1e6e965d178aa34d1747a87b387e9d9ee4fe69..feefd4eee220e75e56880f11270b57f8adaabff7 100644 (file)
@@ -39,7 +39,7 @@ public class getOriginalHostName {
         SharedSecrets.getJavaNetInetAddressAccess();
 
     public static void main(String[] args) throws Exception {
-        final String HOST = "dummyserver.java.net";
+        final String HOST = "localhost";
         InetAddress ia = null;
         ia = InetAddress.getByName(HOST);
         testInetAddress(ia, HOST);