sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject [1/2] git commit: SENTRY-106 - Make solr testing work against apache 4.7 version (Gregory via Brock)
Date Wed, 05 Mar 2014 13:42:54 GMT
Repository: incubator-sentry
Updated Branches:
  refs/heads/db_policy_store 92212c3d3 -> 62b22be9c


SENTRY-106 - Make solr testing work against apache 4.7 version (Gregory via Brock)


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

Branch: refs/heads/db_policy_store
Commit: 77554a09be7cc6fe9851106aa58c50182a8503da
Parents: a4819f5
Author: Brock Noland <brock@apache.org>
Authored: Thu Feb 27 14:15:49 2014 -0600
Committer: Brock Noland <brock@apache.org>
Committed: Thu Feb 27 14:15:49 2014 -0600

----------------------------------------------------------------------
 pom.xml                                               | 14 ++++++++++++--
 .../tests/e2e/solr/AbstractSolrSentryTestBase.java    |  2 +-
 .../e2e/solr/ModifiableUserAuthenticationFilter.java  |  3 +--
 .../tests/e2e/solr/TestCollAdminCoreOperations.java   |  5 +++++
 .../sentry/tests/e2e/solr/TestQueryOperations.java    |  5 +++++
 .../sentry/tests/e2e/solr/TestUpdateOperations.java   |  5 +++++
 .../src/test/resources/solr/solr-no-core.xml          |  3 +++
 7 files changed, 32 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/77554a09/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 7fdfb72..5a8c32b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -74,7 +74,8 @@ limitations under the License.
     <log4j.version>1.2.16</log4j.version>
     <shiro.version>1.2.1</shiro.version>
     <slf4j.version>1.6.1</slf4j.version>
-    <solr.version>4.4.0-cdh5.0.0-beta-2-SNAPSHOT</solr.version>
+    <solr.version>4.7.0</solr.version>
+    <solr.sentry.handlers.version>4.4.0-cdh5.0.0-beta-2-SNAPSHOT</solr.sentry.handlers.version>
     <zookeeper.version>3.4.5-cdh5.0.0-beta-2-SNAPSHOT</zookeeper.version>
   </properties>
 
@@ -112,6 +113,11 @@ limitations under the License.
       </dependency>
       <dependency>
         <groupId>org.apache.hadoop</groupId>
+        <artifactId>hadoop-hdfs</artifactId>
+        <version>${hadoop.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.hadoop</groupId>
         <artifactId>hadoop-minicluster</artifactId>
         <version>${hadoop.version}</version>
       </dependency>
@@ -138,7 +144,7 @@ limitations under the License.
       <dependency>
         <groupId>org.apache.solr</groupId>
         <artifactId>solr-sentry-handlers</artifactId>
-        <version>${solr.version}</version>
+        <version>${solr.sentry.handlers.version}</version>
         <scope>test</scope>
       </dependency>
       <dependency>
@@ -412,6 +418,10 @@ limitations under the License.
         <enabled>false</enabled>
       </releases>
     </repository>
+    <repository>
+      <id>apache</id>
+      <url>https://repository.apache.org/content/repositories/</url>
+    </repository>
   </repositories>
 
 </project>

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/77554a09/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/AbstractSolrSentryTestBase.java
----------------------------------------------------------------------
diff --git a/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/AbstractSolrSentryTestBase.java
b/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/AbstractSolrSentryTestBase.java
index 05c5263..b730de6 100644
--- a/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/AbstractSolrSentryTestBase.java
+++ b/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/AbstractSolrSentryTestBase.java
@@ -58,7 +58,7 @@ import org.slf4j.LoggerFactory;
 
 public abstract class AbstractSolrSentryTestBase extends AbstractFullDistribZkTestBase {
   private static final Logger LOG = LoggerFactory.getLogger(AbstractSolrSentryTestBase.class);
-  protected static final String SENTRY_ERROR_MSG = "401, message:Unauthorized";
+  protected static final String SENTRY_ERROR_MSG = "SentrySolrAuthorizationException";
   private static MiniDFSCluster dfsCluster;
   private static SortedMap<Class, String> extraRequestFilters;
   protected static final String ADMIN_USER = "admin";

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/77554a09/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/ModifiableUserAuthenticationFilter.java
----------------------------------------------------------------------
diff --git a/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/ModifiableUserAuthenticationFilter.java
b/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/ModifiableUserAuthenticationFilter.java
index b7081ba..b61ee25 100644
--- a/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/ModifiableUserAuthenticationFilter.java
+++ b/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/ModifiableUserAuthenticationFilter.java
@@ -26,7 +26,6 @@ import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 import javax.servlet.http.HttpServletRequest;
 
-import org.apache.solr.servlet.SolrHadoopAuthenticationFilter;
 import org.apache.solr.servlet.SolrRequestParsers;
 
 import org.slf4j.Logger;
@@ -57,7 +56,7 @@ public class ModifiableUserAuthenticationFilter implements Filter {
   public void doFilter(ServletRequest request, ServletResponse response,
                        FilterChain chain) throws IOException, ServletException {
     HttpServletRequest httpRequest = (HttpServletRequest) request;
-    httpRequest.setAttribute(SolrHadoopAuthenticationFilter.USER_NAME, userName);
+    httpRequest.setAttribute("solr.user.name", userName);
     chain.doFilter(request, response);
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/77554a09/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/TestCollAdminCoreOperations.java
----------------------------------------------------------------------
diff --git a/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/TestCollAdminCoreOperations.java
b/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/TestCollAdminCoreOperations.java
index 865fd10..6990444 100644
--- a/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/TestCollAdminCoreOperations.java
+++ b/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/TestCollAdminCoreOperations.java
@@ -36,6 +36,11 @@ import org.apache.solr.common.params.CollectionParams.CollectionAction;
 
 @ThreadLeakScope(Scope.NONE) // hdfs client currently leaks thread(s)
 public class TestCollAdminCoreOperations extends AbstractSolrSentryTestBase {
+  // Necessary until we pull in a solr version with SOLR-5771
+  static {
+    ALLOW_SSL = false;
+  }
+
   private static final Logger LOG = LoggerFactory
       .getLogger(TestCollAdminCoreOperations.class);
   private static final String ADMIN_COLLECTION_NAME = "admin";

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/77554a09/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/TestQueryOperations.java
----------------------------------------------------------------------
diff --git a/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/TestQueryOperations.java
b/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/TestQueryOperations.java
index ace0d0f..8699849 100644
--- a/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/TestQueryOperations.java
+++ b/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/TestQueryOperations.java
@@ -33,6 +33,11 @@ import org.apache.solr.common.SolrInputDocument;
 
 @ThreadLeakScope(Scope.NONE) // hdfs client currently leaks thread(s)
 public class TestQueryOperations extends AbstractSolrSentryTestBase {
+  // Necessary until we pull in a solr version with SOLR-5771
+  static {
+    ALLOW_SSL = false;
+  }
+
   private static final Logger LOG = LoggerFactory
       .getLogger(TestQueryOperations.class);
   private static final String COLLECTION_NAME = "sentryCollection";

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/77554a09/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/TestUpdateOperations.java
----------------------------------------------------------------------
diff --git a/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/TestUpdateOperations.java
b/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/TestUpdateOperations.java
index aaca7b4..e7ad2c2 100644
--- a/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/TestUpdateOperations.java
+++ b/sentry-tests/sentry-tests-solr/src/test/java/org/apache/sentry/tests/e2e/solr/TestUpdateOperations.java
@@ -33,6 +33,11 @@ import org.apache.solr.common.SolrInputDocument;
 
 @ThreadLeakScope(Scope.NONE) // hdfs client currently leaks thread(s)
 public class TestUpdateOperations extends AbstractSolrSentryTestBase {
+  // Necessary until we pull in a solr version with SOLR-5771
+  static {
+    ALLOW_SSL = false;
+  }
+
   private static final Logger LOG = LoggerFactory
       .getLogger(TestUpdateOperations.class);
   private static final String COLLECTION_NAME = "sentryCollection";

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/77554a09/sentry-tests/sentry-tests-solr/src/test/resources/solr/solr-no-core.xml
----------------------------------------------------------------------
diff --git a/sentry-tests/sentry-tests-solr/src/test/resources/solr/solr-no-core.xml b/sentry-tests/sentry-tests-solr/src/test/resources/solr/solr-no-core.xml
index 476b5bc..93f7ba1 100644
--- a/sentry-tests/sentry-tests-solr/src/test/resources/solr/solr-no-core.xml
+++ b/sentry-tests/sentry-tests-solr/src/test/resources/solr/solr-no-core.xml
@@ -19,6 +19,9 @@
 <solr>
 
   <str name="shareSchema">${shareSchema:false}</str>
+  <str name="adminHandler">org.apache.solr.handler.admin.SecureCoreAdminHandler</str>
+  <str name="collectionsHandler">org.apache.solr.handler.admin.SecureCollectionsHandler</str>
+  <str name="infoHandler">org.apache.solr.handler.admin.SecureInfoHandler</str>
 
   <solrcloud>
     <str name="host">127.0.0.1</str>


Mime
View raw message