HDDS-1254. Fix failure in TestOzoneManagerHttpServer & TestStorageContainerManagerHttpServer. Contributed by Ajay Kumar. (#598)
This commit is contained in:
parent
86d508c7c7
commit
4fa009989b
@ -106,13 +106,15 @@ public TestStorageContainerManagerHttpServer(Policy policy) {
|
||||
|
||||
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() &&
|
||||
!policy.isHttpEnabled(),
|
||||
!canAccess("http", server.getHttpAddress())));
|
||||
|
||||
} finally {
|
||||
if (server != null) {
|
||||
|
@ -95,8 +95,8 @@ 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);
|
||||
@ -104,13 +104,14 @@ public TestOzoneManagerHttpServer(Policy policy) {
|
||||
|
||||
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())));
|
||||
|
||||
} finally {
|
||||
if (server != null) {
|
||||
|
Loading…
Reference in New Issue
Block a user