HDDS-1903 : Use dynamic ports for SCM in TestSCMClientProtocolServer … (#1303)

This commit is contained in:
avijayanhwx 2019-08-18 10:08:38 -07:00 committed by Bharat Viswanadham
parent b83eae7bdb
commit e32f52c75f
2 changed files with 10 additions and 0 deletions

View File

@ -18,6 +18,9 @@
package org.apache.hadoop.hdds.scm.server; package org.apache.hadoop.hdds.scm.server;
import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_CLIENT_ADDRESS_KEY;
import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_CLIENT_BIND_HOST_DEFAULT;
import org.apache.hadoop.hdds.conf.OzoneConfiguration; import org.apache.hadoop.hdds.conf.OzoneConfiguration;
import org.apache.hadoop.hdds.protocol.proto.HddsProtos.ReplicationFactor; import org.apache.hadoop.hdds.protocol.proto.HddsProtos.ReplicationFactor;
import org.apache.hadoop.hdds.protocol.proto.HddsProtos.ReplicationType; import org.apache.hadoop.hdds.protocol.proto.HddsProtos.ReplicationType;
@ -47,6 +50,8 @@ public class TestSCMClientProtocolServer {
@Before @Before
public void setUp() throws Exception { public void setUp() throws Exception {
config = new OzoneConfiguration(); config = new OzoneConfiguration();
config.set(OZONE_SCM_CLIENT_ADDRESS_KEY,
OZONE_SCM_CLIENT_BIND_HOST_DEFAULT + ":0");
eventQueue = new EventQueue(); eventQueue = new EventQueue();
scmClientProtocolServer = new SCMClientProtocolServer(config, null); scmClientProtocolServer = new SCMClientProtocolServer(config, null);
BlockManager blockManager = Mockito.mock(BlockManagerImpl.class); BlockManager blockManager = Mockito.mock(BlockManagerImpl.class);

View File

@ -16,6 +16,9 @@
*/ */
package org.apache.hadoop.hdds.scm.server; package org.apache.hadoop.hdds.scm.server;
import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_SECURITY_SERVICE_ADDRESS_KEY;
import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_SECURITY_SERVICE_BIND_HOST_DEFAULT;
import org.apache.hadoop.hdds.conf.OzoneConfiguration; import org.apache.hadoop.hdds.conf.OzoneConfiguration;
import org.junit.After; import org.junit.After;
import org.junit.Before; import org.junit.Before;
@ -36,6 +39,8 @@ public class TestSCMSecurityProtocolServer {
@Before @Before
public void setUp() throws Exception { public void setUp() throws Exception {
config = new OzoneConfiguration(); config = new OzoneConfiguration();
config.set(OZONE_SCM_SECURITY_SERVICE_ADDRESS_KEY,
OZONE_SCM_SECURITY_SERVICE_BIND_HOST_DEFAULT + ":0");
securityProtocolServer = new SCMSecurityProtocolServer(config, null); securityProtocolServer = new SCMSecurityProtocolServer(config, null);
} }