chihsuan commented on code in PR #10804:
URL: https://github.com/apache/ozone/pull/10804#discussion_r3608345273


##########
hadoop-hdds/client/src/test/java/org/apache/hadoop/hdds/scm/client/TestHddsClientUtils.java:
##########
@@ -175,6 +175,50 @@ public void testClientFallbackToScmNamesWithPort() {
     assertEquals(OZONE_SCM_CLIENT_PORT_DEFAULT, socketAddress.getPort());
   }
 
+  @Test
+  public void testClientAddressIPv6() {
+    // Bare IPv6 literal without port: port falls back to the default and the
+    // host must be re-bracketed before the address string is parsed.
+    final OzoneConfiguration conf = new OzoneConfiguration();
+    conf.set(OZONE_SCM_CLIENT_ADDRESS_KEY, "2001:db8::1");
+    InetSocketAddress addr =
+        HddsUtils.getScmAddressForClients(conf).iterator().next();
+    assertEquals("2001:db8:0:0:0:0:0:1", addr.getHostString());
+    assertEquals(OZONE_SCM_CLIENT_PORT_DEFAULT, addr.getPort());

Review Comment:
   Thanks for the review! Extracted `checkScmClientAddr` which sets the config 
key and delegates to the existing `checkAddr` helper, so each case is now a 
single call. Done in 1fc02f75f6.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to