xiaoyuyao commented on a change in pull request #598: HDDS-1254. Fix failure in
TestOzoneManagerHttpServer & TestStorageCon…
URL: https://github.com/apache/hadoop/pull/598#discussion_r264863767
##########
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:
Thanks for the clarification. Then in line 113-114, we are trying to
validate that if https is not enabled, you can't use http scheme to access an
https address?
----------------------------------------------------------------
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]