[jdk11u-dev] RFR: 8251155: HostIdentifier fails to canonicalize hostnames starting with digits
Jie Fu
jiefu at openjdk.java.net
Wed Oct 13 03:55:10 UTC 2021
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
-------------
Commit messages:
- Backport 5585e6f63a56fc1f54dafa066e6520498ba284ac
Changes: https://git.openjdk.java.net/jdk11u-dev/pull/516/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk11u-dev&pr=516&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8251155
Stats: 52 lines in 2 files changed: 51 ins; 0 del; 1 mod
Patch: https://git.openjdk.java.net/jdk11u-dev/pull/516.diff
Fetch: git fetch https://git.openjdk.java.net/jdk11u-dev pull/516/head:pull/516
PR: https://git.openjdk.java.net/jdk11u-dev/pull/516
More information about the jdk-updates-dev
mailing list