You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by no...@apache.org on 2015/09/22 12:16:35 UTC

svn commit: r1704518 - in /lucene/dev/branches/branch_5x: ./ solr/ solr/core/ solr/core/src/test/org/apache/solr/security/TestAuthorizationFramework.java

Author: noble
Date: Tue Sep 22 10:16:31 2015
New Revision: 1704518

URL: http://svn.apache.org/viewvc?rev=1704518&view=rev
Log:
hardening for test failure http://jenkins.thetaphi.de/job/Lucene-Solr-5.x-Solaris/70/

Modified:
    lucene/dev/branches/branch_5x/   (props changed)
    lucene/dev/branches/branch_5x/solr/   (props changed)
    lucene/dev/branches/branch_5x/solr/core/   (props changed)
    lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/security/TestAuthorizationFramework.java

Modified: lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/security/TestAuthorizationFramework.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/security/TestAuthorizationFramework.java?rev=1704518&r1=1704517&r2=1704518&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/security/TestAuthorizationFramework.java (original)
+++ lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/security/TestAuthorizationFramework.java Tue Sep 22 10:16:31 2015
@@ -31,6 +31,7 @@ import org.apache.solr.common.cloud.ZkSt
 import org.apache.solr.common.params.ModifiableSolrParams;
 import org.apache.solr.common.util.StrUtils;
 import org.apache.solr.common.util.Utils;
+import org.apache.zookeeper.CreateMode;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -40,6 +41,15 @@ public class TestAuthorizationFramework
   final private Logger log = LoggerFactory.getLogger(TestAuthorizationFramework.class);
 
   static final int TIMEOUT = 10000;
+  public void distribSetUp() throws Exception {
+    super.distribSetUp();
+    try (ZkStateReader zkStateReader = new ZkStateReader(zkServer.getZkAddress(),
+        TIMEOUT, TIMEOUT)) {
+      zkStateReader.getZkClient().create(ZkStateReader.SOLR_SECURITY_CONF_PATH,
+          "{\"authorization\":{\"class\":\"org.apache.solr.security.MockAuthorizationPlugin\"}}".getBytes(Charsets.UTF_8),
+          CreateMode.PERSISTENT, true);
+    }
+  }
 
 
   @Test
@@ -47,12 +57,6 @@ public class TestAuthorizationFramework
     MockAuthorizationPlugin.denyUsers.add("user1");
     MockAuthorizationPlugin.denyUsers.add("user1");
     waitForThingsToLevelOut(10);
-    try (ZkStateReader zkStateReader = new ZkStateReader(zkServer.getZkAddress(),
-        TIMEOUT, TIMEOUT)) {
-      zkStateReader.getZkClient().setData(ZkStateReader.SOLR_SECURITY_CONF_PATH,
-          "{\"authorization\":{\"class\":\"org.apache.solr.security.MockAuthorizationPlugin\"}}".getBytes(Charsets.UTF_8),
-          true);
-    }
     String baseUrl = jettys.get(0).getBaseUrl().toString();
     verifySecurityStatus(cloudClient.getLbClient().getHttpClient(), baseUrl + "/admin/authorization", "authorization/class", MockAuthorizationPlugin.class.getName(), 20);
     log.info("Starting test");