ajayydv commented on a change in pull request #598: HDDS-1254. Fix failure in 
TestOzoneManagerHttpServer & TestStorageCon…
URL: https://github.com/apache/hadoop/pull/598#discussion_r264859479
 
 

 ##########
 File path: 
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHttpServer.java
 ##########
 @@ -95,22 +95,23 @@ public TestOzoneManagerHttpServer(Policy policy) {
   @Test public void testHttpPolicy() throws Exception {
     conf.set(DFSConfigKeys.DFS_HTTP_POLICY_KEY, policy.name());
     conf.set(ScmConfigKeys.OZONE_SCM_HTTPS_ADDRESS_KEY, "localhost:0");
-
     InetSocketAddress addr = InetSocketAddress.createUnresolved("localhost", 
0);
+
     OzoneManagerHttpServer server = null;
     try {
       server = new OzoneManagerHttpServer(conf, null);
       server.start();
 
       Assert.assertTrue(implies(policy.isHttpEnabled(),
           canAccess("http", server.getHttpAddress())));
-      Assert.assertTrue(
-          implies(!policy.isHttpEnabled(), server.getHttpAddress() == null));
+      Assert.assertTrue(implies(policy.isHttpEnabled() &&
+              !policy.isHttpsEnabled(),
+          !canAccess("https", server.getHttpsAddress())));
 
       Assert.assertTrue(implies(policy.isHttpsEnabled(),
           canAccess("https", server.getHttpsAddress())));
-      Assert.assertTrue(
-          implies(!policy.isHttpsEnabled(), server.getHttpsAddress() == null));
+      Assert.assertTrue(implies(policy.isHttpsEnabled(),
+          !canAccess("http", server.getHttpsAddress())));
 
 Review comment:
   Suggested assert seems incorrect coz if http is enabled than client should 
succeed in binding to http port. 
   
   We do assert if http is enabled, server should bind to http port and client 
should be able to connect to it. in L105

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to