Replace hostname with a non-existant ip address
authorVladimir Petko <vladimir.petko@canonical.com>
Wed, 23 Apr 2025 23:57:46 +0000 (01:57 +0200)
committerMatthias Klose <doko@ubuntu.com>
Wed, 23 Apr 2025 23:57:46 +0000 (01:57 +0200)
Forwarded: no
Last-Update: 2023-03-27

In Ubuntu build environment we do not have DNS resolver, causing an unexpected test
failure. Use a non-existant IP address instead of hostname.

Gbp-Pq: Name ldap-timeout-test-use-ip.patch

test/jdk/com/sun/jndi/ldap/LdapPoolTimeoutTest.java

index 66865f85942f06bfe31234d0dbc95fcb49396ca5..affd9fe7a5dce5f5d77d9dbb95f53c0db2e615b4 100644 (file)
@@ -86,7 +86,9 @@ public class LdapPoolTimeoutTest {
         env.put("com.sun.jndi.ldap.read.timeout", String.valueOf(READ_MILLIS));
         env.put("com.sun.jndi.ldap.connect.timeout", String.valueOf(CONNECT_MILLIS));
         env.put("com.sun.jndi.ldap.connect.pool", "true");
-        env.put(Context.PROVIDER_URL, "ldap://example.com:1234");
+        // there should not be a LDAP provider on multicast address, but
+        // network stack should be able to send to it
+        env.put(Context.PROVIDER_URL, "ldap://224.0.0.0:1234");
 
         try {
             futures.add(executorService.submit(() -> { attemptConnect(env); return null; }));