[jdk11u-dev] RFR: 8251155: HostIdentifier fails to canonicalize hostnames starting with digits

Goetz Lindenmaier goetz at openjdk.java.net
Thu Oct 14 10:58:02 UTC 2021


On Wed, 13 Oct 2021 03:48:07 GMT, Jie Fu <jiefu at openjdk.org> wrote:

> Hi all,
> 
> I'd like to backport JDK-8251155 to jdk11u.
> 
> Tools like jps in jdk11u still fail on machines when the hostnames starting with digits.
> And this bug can be reproduced by jtreg tests:
> 
> sun/tools/jstatd/TestJstatdExternalRegistry.java
> sun/tools/jstatd/TestJstatdPort.java
> sun/tools/jstatd/TestJstatdPortAndServer.java
> 
> 
> It's worth doing this since quite a lot of cloud hosts are named with digits only.
> Although patch can be applied cleanly, the backported test has been adjusted (see the following diff) to make it successfully compiled with the jdk11 test framework.
> 
> diff --git a/test/jdk/sun/tools/jps/TestJpsHostName.java b/test/jdk/sun/tools/jps/TestJpsHostName.java
> index 4ef9d91ac3..9d15399a86 100644
> --- a/test/jdk/sun/tools/jps/TestJpsHostName.java
> +++ b/test/jdk/sun/tools/jps/TestJpsHostName.java
> @@ -21,14 +21,14 @@
>   * questions.
>   */
>  
> -import jdk.test.lib.process.OutputAnalyzer;
> +import jdk.testlibrary.OutputAnalyzer;
>  
>  /*
>   * @test
>   * @bug 8251155
>   * @summary Test host names starting with digits
> - * @library /test/lib
> - * @build JpsHelper
> + * @library /lib/testlibrary /test/lib
> + * @build jdk.testlibrary.* JpsHelper
>   * @run driver TestJpsHostName
>   */
>  public class TestJpsHostName {
> 
> 
> Testing:
>  - Affected tests passed after this patch
>  - tier1~3 on Linux/x64, no regression
> 
> Thanks.
> Best regards,
> Jie

LGTM

-------------

Marked as reviewed by goetz (Reviewer).

PR: https://git.openjdk.java.net/jdk11u-dev/pull/516


More information about the jdk-updates-dev mailing list