You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ha...@apache.org on 2012/05/31 18:14:26 UTC
svn commit: r1344797 -
/hive/trunk/shims/src/test/org/apache/hadoop/hive/thrift/TestHadoop20SAuthBridge.java
Author: hashutosh
Date: Thu May 31 16:14:26 2012
New Revision: 1344797
URL: http://svn.apache.org/viewvc?rev=1344797&view=rev
Log: (empty)
Modified:
hive/trunk/shims/src/test/org/apache/hadoop/hive/thrift/TestHadoop20SAuthBridge.java
Modified: hive/trunk/shims/src/test/org/apache/hadoop/hive/thrift/TestHadoop20SAuthBridge.java
URL: http://svn.apache.org/viewvc/hive/trunk/shims/src/test/org/apache/hadoop/hive/thrift/TestHadoop20SAuthBridge.java?rev=1344797&r1=1344796&r2=1344797&view=diff
==============================================================================
--- hive/trunk/shims/src/test/org/apache/hadoop/hive/thrift/TestHadoop20SAuthBridge.java (original)
+++ hive/trunk/shims/src/test/org/apache/hadoop/hive/thrift/TestHadoop20SAuthBridge.java Thu May 31 16:14:26 2012
@@ -23,6 +23,7 @@ import java.io.DataInputStream;
import java.io.IOException;
import java.net.InetAddress;
import java.net.NetworkInterface;
+import java.net.ServerSocket;
import java.security.PrivilegedExceptionAction;
import java.util.ArrayList;
import java.util.Arrays;
@@ -117,7 +118,8 @@ public class TestHadoop20SAuthBridge ext
builder.toString());
}
- public void setup(final int port) throws Exception {
+ public void setup() throws Exception {
+ int port = findFreePort();
System.setProperty(HiveConf.ConfVars.METASTORE_USE_THRIFT_SASL.varname,
"true");
System.setProperty(HiveConf.ConfVars.METASTOREURIS.varname,
@@ -207,14 +209,14 @@ public class TestHadoop20SAuthBridge ext
}
public void testSaslWithHiveMetaStore() throws Exception {
- setup(10000);
+ setup();
UserGroupInformation clientUgi = UserGroupInformation.getCurrentUser();
obtainTokenAndAddIntoUGI(clientUgi, null);
obtainTokenAndAddIntoUGI(clientUgi, "tokenForFooTablePartition");
}
public void testMetastoreProxyUser() throws Exception {
- setup(10010);
+ setup();
final String proxyUserName = "proxyUser";
//set the configuration up such that proxyUser can act on
@@ -374,4 +376,11 @@ public class TestHadoop20SAuthBridge ext
client.dropDatabase(dbName);
assertTrue("Databases do not match", db1.getName().equals(db.getName()));
}
+
+ private int findFreePort() throws IOException {
+ ServerSocket socket= new ServerSocket(0);
+ int port = socket.getLocalPort();
+ socket.close();
+ return port;
+ }
}