phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maryann...@apache.org
Subject [47/50] [abbrv] phoenix git commit: PHOENIX-3189 Ensure that there is no invalid cached state in KerberosName
Date Wed, 14 Sep 2016 21:43:45 GMT
PHOENIX-3189 Ensure that there is no invalid cached state in KerberosName


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/1ce9845b
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/1ce9845b
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/1ce9845b

Branch: refs/heads/calcite
Commit: 1ce9845b8f6c2b456fbab913cd1bd647c6c4d281
Parents: 2dc6be4
Author: Josh Elser <elserj@apache.org>
Authored: Wed Aug 31 22:28:45 2016 -0400
Committer: Josh Elser <elserj@apache.org>
Committed: Wed Aug 31 22:29:40 2016 -0400

----------------------------------------------------------------------
 .../apache/phoenix/jdbc/SecureUserConnectionsTest.java | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/1ce9845b/phoenix-core/src/test/java/org/apache/phoenix/jdbc/SecureUserConnectionsTest.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/test/java/org/apache/phoenix/jdbc/SecureUserConnectionsTest.java
b/phoenix-core/src/test/java/org/apache/phoenix/jdbc/SecureUserConnectionsTest.java
index 6a33142..a14e47b 100644
--- a/phoenix-core/src/test/java/org/apache/phoenix/jdbc/SecureUserConnectionsTest.java
+++ b/phoenix-core/src/test/java/org/apache/phoenix/jdbc/SecureUserConnectionsTest.java
@@ -22,6 +22,7 @@ import static org.junit.Assert.assertTrue;
 
 import java.io.File;
 import java.io.IOException;
+import java.lang.reflect.Field;
 import java.security.PrivilegedExceptionAction;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -35,6 +36,8 @@ import org.apache.hadoop.fs.CommonConfigurationKeys;
 import org.apache.hadoop.hbase.security.User;
 import org.apache.hadoop.minikdc.MiniKdc;
 import org.apache.hadoop.security.UserGroupInformation;
+import org.apache.hadoop.security.authentication.util.KerberosName;
+import org.apache.hadoop.security.authentication.util.KerberosUtil;
 import org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.ConnectionInfo;
 import org.apache.phoenix.query.ConfigurationFactory;
 import org.apache.phoenix.util.InstanceResolver;
@@ -94,6 +97,16 @@ public class SecureUserConnectionsTest {
                 return copy;
             }
         });
+        updateDefaultRealm();
+    }
+
+    private static void updateDefaultRealm() throws Exception {
+        // (at least) one other phoenix test triggers the caching of this field before the
KDC is up
+        // which causes principal parsing to fail.
+        Field f = KerberosName.class.getDeclaredField("defaultRealm");
+        f.setAccessible(true);
+        // Default realm for MiniKDC
+        f.set(null, "EXAMPLE.COM");
     }
 
     @AfterClass


Mime
View raw message