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(),
|
Assert.assertTrue(implies(policy.isHttpEnabled(),
|
||||||
canAccess("http", server.getHttpAddress())));
|
canAccess("http", server.getHttpAddress())));
|
||||||
Assert.assertTrue(
|
Assert.assertTrue(implies(policy.isHttpEnabled() &&
|
||||||
implies(!policy.isHttpEnabled(), server.getHttpAddress() == null));
|
!policy.isHttpsEnabled(),
|
||||||
|
!canAccess("https", server.getHttpsAddress())));
|
||||||
|
|
||||||
Assert.assertTrue(implies(policy.isHttpsEnabled(),
|
Assert.assertTrue(implies(policy.isHttpsEnabled(),
|
||||||
canAccess("https", server.getHttpsAddress())));
|
canAccess("https", server.getHttpsAddress())));
|
||||||
Assert.assertTrue(
|
Assert.assertTrue(implies(policy.isHttpsEnabled() &&
|
||||||
implies(!policy.isHttpsEnabled(), server.getHttpsAddress() == null));
|
!policy.isHttpEnabled(),
|
||||||
|
!canAccess("http", server.getHttpAddress())));
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
if (server != null) {
|
if (server != null) {
|
||||||
|
@ -95,8 +95,8 @@ public TestOzoneManagerHttpServer(Policy policy) {
|
|||||||
@Test public void testHttpPolicy() throws Exception {
|
@Test public void testHttpPolicy() throws Exception {
|
||||||
conf.set(DFSConfigKeys.DFS_HTTP_POLICY_KEY, policy.name());
|
conf.set(DFSConfigKeys.DFS_HTTP_POLICY_KEY, policy.name());
|
||||||
conf.set(ScmConfigKeys.OZONE_SCM_HTTPS_ADDRESS_KEY, "localhost:0");
|
conf.set(ScmConfigKeys.OZONE_SCM_HTTPS_ADDRESS_KEY, "localhost:0");
|
||||||
|
|
||||||
InetSocketAddress addr = InetSocketAddress.createUnresolved("localhost", 0);
|
InetSocketAddress addr = InetSocketAddress.createUnresolved("localhost", 0);
|
||||||
|
|
||||||
OzoneManagerHttpServer server = null;
|
OzoneManagerHttpServer server = null;
|
||||||
try {
|
try {
|
||||||
server = new OzoneManagerHttpServer(conf, null);
|
server = new OzoneManagerHttpServer(conf, null);
|
||||||
@ -104,13 +104,14 @@ public TestOzoneManagerHttpServer(Policy policy) {
|
|||||||
|
|
||||||
Assert.assertTrue(implies(policy.isHttpEnabled(),
|
Assert.assertTrue(implies(policy.isHttpEnabled(),
|
||||||
canAccess("http", server.getHttpAddress())));
|
canAccess("http", server.getHttpAddress())));
|
||||||
Assert.assertTrue(
|
Assert.assertTrue(implies(policy.isHttpEnabled() &&
|
||||||
implies(!policy.isHttpEnabled(), server.getHttpAddress() == null));
|
!policy.isHttpsEnabled(),
|
||||||
|
!canAccess("https", server.getHttpsAddress())));
|
||||||
|
|
||||||
Assert.assertTrue(implies(policy.isHttpsEnabled(),
|
Assert.assertTrue(implies(policy.isHttpsEnabled(),
|
||||||
canAccess("https", server.getHttpsAddress())));
|
canAccess("https", server.getHttpsAddress())));
|
||||||
Assert.assertTrue(
|
Assert.assertTrue(implies(policy.isHttpsEnabled(),
|
||||||
implies(!policy.isHttpsEnabled(), server.getHttpsAddress() == null));
|
!canAccess("http", server.getHttpsAddress())));
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
if (server != null) {
|
if (server != null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user