mirror of https://github.com/apache/lucene.git
SOLR-12791, SOLR-13067: Fix test failure for BasicAuthIntegrationTest
Make PkiAuthenticationIntegrationTest beast-able
This commit is contained in:
parent
1e68726831
commit
9728dbc167
|
@ -254,7 +254,7 @@ public class BasicAuthIntegrationTest extends SolrCloudAuthTestCase {
|
||||||
});
|
});
|
||||||
assertEquals(401, exp.code());
|
assertEquals(401, exp.code());
|
||||||
assertAuthMetricsMinimums(20, 8, 9, 1, 2, 0);
|
assertAuthMetricsMinimums(20, 8, 9, 1, 2, 0);
|
||||||
assertPkiAuthMetricsMinimums(4, 4, 0, 0, 0, 0);
|
assertPkiAuthMetricsMinimums(3, 3, 0, 0, 0, 0);
|
||||||
|
|
||||||
// Query that succeeds
|
// Query that succeeds
|
||||||
GenericSolrRequest req = new GenericSolrRequest(SolrRequest.METHOD.GET, "/select", params);
|
GenericSolrRequest req = new GenericSolrRequest(SolrRequest.METHOD.GET, "/select", params);
|
||||||
|
@ -262,7 +262,7 @@ public class BasicAuthIntegrationTest extends SolrCloudAuthTestCase {
|
||||||
cluster.getSolrClient().request(req, COLLECTION);
|
cluster.getSolrClient().request(req, COLLECTION);
|
||||||
|
|
||||||
assertAuthMetricsMinimums(21, 9, 9, 1, 2, 0);
|
assertAuthMetricsMinimums(21, 9, 9, 1, 2, 0);
|
||||||
assertPkiAuthMetricsMinimums(7, 7, 0, 0, 0, 0);
|
assertPkiAuthMetricsMinimums(6, 6, 0, 0, 0, 0);
|
||||||
|
|
||||||
executeCommand(baseUrl + authcPrefix, cl, "{set-property : { blockUnknown: false}}", "harry", "HarryIsUberCool");
|
executeCommand(baseUrl + authcPrefix, cl, "{set-property : { blockUnknown: false}}", "harry", "HarryIsUberCool");
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
@ -42,19 +42,21 @@ import static org.apache.solr.security.TestAuthorizationFramework.verifySecurity
|
||||||
public class PKIAuthenticationIntegrationTest extends SolrCloudAuthTestCase {
|
public class PKIAuthenticationIntegrationTest extends SolrCloudAuthTestCase {
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||||
|
private static final String COLLECTION = "pkiCollection";
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void setupCluster() throws Exception {
|
public static void setupCluster() throws Exception {
|
||||||
configureCluster(2)
|
configureCluster(2)
|
||||||
.addConfig("conf", configset("cloud-minimal"))
|
.addConfig("conf", configset("cloud-minimal"))
|
||||||
.configure();
|
.configure();
|
||||||
|
|
||||||
|
CollectionAdminRequest.createCollection(COLLECTION, "conf", 2, 1).process(cluster.getSolrClient());
|
||||||
|
|
||||||
|
cluster.waitForActiveCollection(COLLECTION, 2, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testPkiAuth() throws Exception {
|
public void testPkiAuth() throws Exception {
|
||||||
|
|
||||||
CollectionAdminRequest.createCollection("collection", "conf", 2, 1).process(cluster.getSolrClient());
|
|
||||||
|
|
||||||
// TODO make a SolrJ helper class for this
|
// TODO make a SolrJ helper class for this
|
||||||
byte[] bytes = Utils.toJSON(makeMap("authorization", singletonMap("class", MockAuthorizationPlugin.class.getName()),
|
byte[] bytes = Utils.toJSON(makeMap("authorization", singletonMap("class", MockAuthorizationPlugin.class.getName()),
|
||||||
"authentication", singletonMap("class", MockAuthenticationPlugin.class.getName())));
|
"authentication", singletonMap("class", MockAuthenticationPlugin.class.getName())));
|
||||||
|
@ -94,7 +96,7 @@ public class PKIAuthenticationIntegrationTest extends SolrCloudAuthTestCase {
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
QueryRequest query = new QueryRequest(params);
|
QueryRequest query = new QueryRequest(params);
|
||||||
query.process(cluster.getSolrClient(), "collection");
|
query.process(cluster.getSolrClient(), COLLECTION);
|
||||||
assertTrue("all nodes must get the user solr , no:of nodes got solr : " + count.get(), count.get() > 2);
|
assertTrue("all nodes must get the user solr , no:of nodes got solr : " + count.get(), count.get() > 2);
|
||||||
assertPkiAuthMetricsMinimums(2, 2, 0, 0, 0, 0);
|
assertPkiAuthMetricsMinimums(2, 2, 0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue