From e32f52c75ff28c3f8a67ff627acf784c8e4b05e7 Mon Sep 17 00:00:00 2001 From: avijayanhwx <14299376+avijayanhwx@users.noreply.github.com> Date: Sun, 18 Aug 2019 10:08:38 -0700 Subject: [PATCH] =?UTF-8?q?HDDS-1903=20:=20Use=20dynamic=20ports=20for=20S?= =?UTF-8?q?CM=20in=20TestSCMClientProtocolServer=20=E2=80=A6=20(#1303)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hadoop/hdds/scm/server/TestSCMClientProtocolServer.java | 5 +++++ .../hdds/scm/server/TestSCMSecurityProtocolServer.java | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/server/TestSCMClientProtocolServer.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/server/TestSCMClientProtocolServer.java index f7ac00ef231..23568d85fd5 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/server/TestSCMClientProtocolServer.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/server/TestSCMClientProtocolServer.java @@ -18,6 +18,9 @@ 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.protocol.proto.HddsProtos.ReplicationFactor; import org.apache.hadoop.hdds.protocol.proto.HddsProtos.ReplicationType; @@ -47,6 +50,8 @@ public class TestSCMClientProtocolServer { @Before public void setUp() throws Exception { config = new OzoneConfiguration(); + config.set(OZONE_SCM_CLIENT_ADDRESS_KEY, + OZONE_SCM_CLIENT_BIND_HOST_DEFAULT + ":0"); eventQueue = new EventQueue(); scmClientProtocolServer = new SCMClientProtocolServer(config, null); BlockManager blockManager = Mockito.mock(BlockManagerImpl.class); diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/server/TestSCMSecurityProtocolServer.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/server/TestSCMSecurityProtocolServer.java index 78a6109756b..8040cb4b6f7 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/server/TestSCMSecurityProtocolServer.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/server/TestSCMSecurityProtocolServer.java @@ -16,6 +16,9 @@ */ 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.junit.After; import org.junit.Before; @@ -36,6 +39,8 @@ public class TestSCMSecurityProtocolServer { @Before public void setUp() throws Exception { config = new OzoneConfiguration(); + config.set(OZONE_SCM_SECURITY_SERVICE_ADDRESS_KEY, + OZONE_SCM_SECURITY_SERVICE_BIND_HOST_DEFAULT + ":0"); securityProtocolServer = new SCMSecurityProtocolServer(config, null); }