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/21 13:25:09 UTC
svn commit: r1704268 -
/lucene/dev/trunk/solr/core/src/test/org/apache/solr/security/TestAuthorizationFramework.java
Author: noble
Date: Mon Sep 21 11:25:04 2015
New Revision: 1704268
URL: http://svn.apache.org/viewvc?rev=1704268&view=rev
Log:
hardening test failure jenkins.thetaphi.de/job/Lucene-Solr-trunk-Solaris/67
Modified:
lucene/dev/trunk/solr/core/src/test/org/apache/solr/security/TestAuthorizationFramework.java
Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/security/TestAuthorizationFramework.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/security/TestAuthorizationFramework.java?rev=1704268&r1=1704267&r2=1704268&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/security/TestAuthorizationFramework.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/security/TestAuthorizationFramework.java Mon Sep 21 11:25:04 2015
@@ -32,6 +32,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;
@@ -41,6 +42,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
@@ -48,12 +58,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");