shwstppr commented on code in PR #8389:
URL: https://github.com/apache/cloudstack/pull/8389#discussion_r1686237927


##########
utils/src/test/java/com/cloud/utils/UriUtilsTest.java:
##########
@@ -273,4 +273,16 @@ public void testIsUrlForCompressedFile() {
         
Assert.assertTrue(UriUtils.isUrlForCompressedFile("https://abc.com/xyz.gz";));
         
Assert.assertFalse(UriUtils.isUrlForCompressedFile("http://abc.com/xyz.qcow2";));
     }
+
+    @Test
+    public void validateUrl() {
+        Pair<String, Integer> url1 = 
UriUtils.validateUrl("https://www.cloudstack.org";);
+        Assert.assertEquals(url1.first(), "www.cloudstack.org");
+
+        Pair<String, Integer> url2 = 
UriUtils.validateUrl("https://www.apache.org";);
+        Assert.assertEquals(url2.first(), "www.apache.org");
+
+        Pair<String, Integer> url3 = 
UriUtils.validateUrl("https://ipv6.google.com";);
+        Assert.assertEquals(url3.first(), "ipv6.google.com");

Review Comment:
   This testcase is failing during BO build. Do we need to add any guard for 
ipv6 support? cc @wido 
   
   ```
   13:18:52 [INFO] Running com.cloud.utils.UriUtilsTest
   13:18:52 [ERROR] Tests run: 15, Failures: 0, Errors: 1, Skipped: 0, Time 
elapsed: 0.139 s <<< FAILURE! - in com.cloud.utils.UriUtilsTest
   13:18:52 [ERROR] validateUrl(com.cloud.utils.UriUtilsTest)  Time elapsed: 
0.113 s  <<< ERROR!
   13:18:52 java.lang.IllegalArgumentException: Unable to resolve 
ipv6.google.com
   13:18:52     at 
com.cloud.utils.UriUtilsTest.validateUrl(UriUtilsTest.java:285)
   ```



-- 
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]

Reply via email to