Repository: incubator-sentry
Updated Branches:
  refs/heads/master 80b543fca -> d2913b8d5


SENTRY-970: Use random free port for Sqoop tests (Colm O hEigeartaigh via 
Dapeng Sun)


Project: http://git-wip-us.apache.org/repos/asf/incubator-sentry/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-sentry/commit/d2913b8d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-sentry/tree/d2913b8d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-sentry/diff/d2913b8d

Branch: refs/heads/master
Commit: d2913b8d55607ece2076a29ac93b30627a31916f
Parents: 80b543f
Author: Sun Dapeng <s...@apache.org>
Authored: Fri Nov 27 09:14:18 2015 +0800
Committer: Sun Dapeng <s...@apache.org>
Committed: Fri Nov 27 09:14:18 2015 +0800

----------------------------------------------------------------------
 .../sentry/tests/e2e/sqoop/AbstractSqoopSentryTestBase.java      | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/d2913b8d/sentry-tests/sentry-tests-sqoop/src/test/java/org/apache/sentry/tests/e2e/sqoop/AbstractSqoopSentryTestBase.java
----------------------------------------------------------------------
diff --git 
a/sentry-tests/sentry-tests-sqoop/src/test/java/org/apache/sentry/tests/e2e/sqoop/AbstractSqoopSentryTestBase.java
 
b/sentry-tests/sentry-tests-sqoop/src/test/java/org/apache/sentry/tests/e2e/sqoop/AbstractSqoopSentryTestBase.java
index d60ee1c..8a01e1c 100644
--- 
a/sentry-tests/sentry-tests-sqoop/src/test/java/org/apache/sentry/tests/e2e/sqoop/AbstractSqoopSentryTestBase.java
+++ 
b/sentry-tests/sentry-tests-sqoop/src/test/java/org/apache/sentry/tests/e2e/sqoop/AbstractSqoopSentryTestBase.java
@@ -47,6 +47,7 @@ import org.apache.sentry.service.thrift.SentryServiceFactory;
 import org.apache.sentry.service.thrift.ServiceConstants.ClientConfig;
 import org.apache.sentry.service.thrift.ServiceConstants.ServerConfig;
 import org.apache.sentry.sqoop.conf.SqoopAuthConf.AuthzConfVars;
+import org.apache.sqoop.common.test.utils.NetworkUtils;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 
@@ -56,7 +57,6 @@ import com.google.common.collect.Sets;
 public class AbstractSqoopSentryTestBase {
   private static final String SERVER_HOST = NetUtils
       .createSocketAddr("localhost:80").getAddress().getCanonicalHostName();
-  private static final int PORT = 8038;
 
   protected static final String COMPONENT = "sqoop";
   protected static final String ADMIN_USER = "sqoop";
@@ -128,7 +128,7 @@ public class AbstractSqoopSentryTestBase {
     conf.set(ServerConfig.ADMIN_GROUPS, Joiner.on(",").join(ADMIN_GROUP,
         UserGroupInformation.getLoginUser().getPrimaryGroupName()));
     conf.set(ServerConfig.RPC_ADDRESS, SERVER_HOST);
-    conf.set(ServerConfig.RPC_PORT, String.valueOf(PORT));
+    conf.set(ServerConfig.RPC_PORT, 
String.valueOf(NetworkUtils.findAvailablePort()));
     conf.set(ServerConfig.SENTRY_STORE_JDBC_URL,
         "jdbc:derby:;databaseName=" + dbDir.getPath() + ";create=true");
     conf.set(ServerConfig.SENTRY_STORE_JDBC_PASS, "dummy");

Reply via email to