From 4fdf01635835a1b8f1107a50c112a3601a6a61f9 Mon Sep 17 00:00:00 2001 From: Anu Engineer Date: Mon, 7 Oct 2019 15:41:42 -0700 Subject: [PATCH] HDDS-2245. Use dynamic ports for SCM in TestSecureOzoneCluster Contributed by kevin su. --- .../apache/hadoop/ozone/TestSecureOzoneCluster.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestSecureOzoneCluster.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestSecureOzoneCluster.java index 68035f8d42..ca1f179345 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestSecureOzoneCluster.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestSecureOzoneCluster.java @@ -53,6 +53,7 @@ import org.apache.hadoop.ipc.Server; import org.apache.hadoop.metrics2.lib.DefaultMetricsSystem; import org.apache.hadoop.minikdc.MiniKdc; import org.apache.hadoop.net.NetUtils; +import org.apache.hadoop.net.ServerSocketUtil; import org.apache.hadoop.ozone.client.CertificateClientTestImpl; import org.apache.hadoop.ozone.common.Storage; import org.apache.hadoop.ozone.om.OMConfigKeys; @@ -153,6 +154,18 @@ public final class TestSecureOzoneCluster { try { conf = new OzoneConfiguration(); conf.set(ScmConfigKeys.OZONE_SCM_CLIENT_ADDRESS_KEY, "localhost"); + + conf.setInt(ScmConfigKeys.OZONE_SCM_CLIENT_PORT_KEY, ServerSocketUtil + .getPort(ScmConfigKeys.OZONE_SCM_CLIENT_PORT_DEFAULT, 100)); + conf.setInt(ScmConfigKeys.OZONE_SCM_DATANODE_PORT_KEY, ServerSocketUtil + .getPort(ScmConfigKeys.OZONE_SCM_DATANODE_PORT_DEFAULT, 100)); + conf.setInt(ScmConfigKeys.OZONE_SCM_BLOCK_CLIENT_PORT_KEY, + ServerSocketUtil.getPort(ScmConfigKeys + .OZONE_SCM_BLOCK_CLIENT_PORT_DEFAULT, 100)); + conf.setInt(ScmConfigKeys.OZONE_SCM_SECURITY_SERVICE_PORT_KEY, + ServerSocketUtil.getPort(ScmConfigKeys + .OZONE_SCM_SECURITY_SERVICE_PORT_DEFAULT, 100)); + DefaultMetricsSystem.setMiniClusterMode(true); final String path = folder.newFolder().toString(); metaDirPath = Paths.get(path, "om-meta");