Merge pull request elastic/elasticsearch#319 from rmuir/plugin_descriptor
Fix plugins to the new world Original commit: elastic/x-pack-elasticsearch@f9d0e75ef0
This commit is contained in:
commit
ab3962517a
|
@ -0,0 +1,6 @@
|
|||
eclipse.preferences.version=1
|
||||
encoding//src/main/java=UTF-8
|
||||
encoding//src/main/resources=UTF-8
|
||||
encoding//src/test/java=UTF-8
|
||||
encoding//src/test/resources=UTF-8
|
||||
encoding/<project>=UTF-8
|
|
@ -0,0 +1,18 @@
|
|||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled
|
||||
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
|
||||
org.eclipse.jdt.core.compiler.annotation.nullable=org.elasticsearch.common.Nullable
|
||||
org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nullReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
|
||||
org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
|
||||
org.eclipse.jdt.core.compiler.source=1.7
|
||||
org.eclipse.jdt.core.formatter.lineSplit=140
|
||||
org.eclipse.jdt.core.formatter.tabulation.char=space
|
||||
org.eclipse.jdt.core.formatter.tabulation.size=4
|
File diff suppressed because one or more lines are too long
|
@ -16,6 +16,9 @@
|
|||
</parent>
|
||||
|
||||
<properties>
|
||||
<elasticsearch.plugin.classname>org.elasticsearch.marvel.MarvelPlugin</elasticsearch.plugin.classname>
|
||||
<!-- TODO: fix plugin dependencies for full isolation -->
|
||||
<elasticsearch.plugin.isolated>false</elasticsearch.plugin.isolated>
|
||||
<elasticsearch.integ.antfile>dev-tools/integration-tests.xml</elasticsearch.integ.antfile>
|
||||
<tests.rest.suite>marvel</tests.rest.suite>
|
||||
<tests.rest.load_packaged>false</tests.rest.load_packaged>
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<assembly>
|
||||
<id>plugin</id>
|
||||
<formats>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
<includeBaseDirectory>false</includeBaseDirectory>
|
||||
<dependencySets>
|
||||
<dependencySet>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
<useProjectArtifact>true</useProjectArtifact>
|
||||
<useTransitiveFiltering>true</useTransitiveFiltering>
|
||||
<excludes>
|
||||
<exclude>org.elasticsearch:elasticsearch</exclude>
|
||||
</excludes>
|
||||
</dependencySet>
|
||||
</dependencySets>
|
||||
</assembly>
|
|
@ -1,2 +0,0 @@
|
|||
plugin=org.elasticsearch.marvel.MarvelPlugin
|
||||
version=${project.version}
|
|
@ -7,11 +7,10 @@ package org.elasticsearch.marvel;
|
|||
|
||||
import org.elasticsearch.action.admin.cluster.node.info.NodeInfo;
|
||||
import org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse;
|
||||
import org.elasticsearch.action.admin.cluster.node.info.PluginInfo;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.license.plugin.LicensePlugin;
|
||||
import org.elasticsearch.marvel.agent.AgentService;
|
||||
import org.elasticsearch.plugins.PluginsService;
|
||||
import org.elasticsearch.plugins.PluginInfo;
|
||||
import org.elasticsearch.test.ElasticsearchIntegrationTest;
|
||||
import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope;
|
||||
import org.elasticsearch.tribe.TribeService;
|
||||
|
@ -28,7 +27,6 @@ public class MarvelPluginTests extends ElasticsearchIntegrationTest {
|
|||
return Settings.settingsBuilder()
|
||||
.put(super.nodeSettings(nodeOrdinal))
|
||||
.put("plugin.types", MarvelPlugin.class.getName() + "," + LicensePlugin.class.getName())
|
||||
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
|
|
@ -7,10 +7,13 @@ package org.elasticsearch.marvel.agent.exporter;
|
|||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import org.apache.lucene.util.LuceneTestCase;
|
||||
import org.elasticsearch.cluster.metadata.IndexTemplateMetaData;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.license.plugin.LicensePlugin;
|
||||
import org.elasticsearch.marvel.MarvelPlugin;
|
||||
import org.elasticsearch.marvel.agent.AgentService;
|
||||
import org.elasticsearch.marvel.agent.collector.indices.IndexStatsMarvelDoc;
|
||||
import org.elasticsearch.node.Node;
|
||||
|
@ -31,6 +34,14 @@ import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcke
|
|||
@ClusterScope(transportClientRatio = 0.0, scope = ElasticsearchIntegrationTest.Scope.TEST, numDataNodes = 0, numClientNodes = 0)
|
||||
public class HttpESExporterTests extends ElasticsearchIntegrationTest {
|
||||
|
||||
@Override
|
||||
protected Settings nodeSettings(int nodeOrdinal) {
|
||||
return Settings.settingsBuilder()
|
||||
.put(super.nodeSettings(nodeOrdinal))
|
||||
.put("plugin.types", MarvelPlugin.class.getName() + "," + LicensePlugin.class.getName())
|
||||
.build();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testHttpServerOff() {
|
||||
Settings.Builder builder = Settings.builder()
|
||||
|
|
|
@ -19,7 +19,6 @@ import org.elasticsearch.license.plugin.core.LicensesService;
|
|||
import org.elasticsearch.marvel.MarvelPlugin;
|
||||
import org.elasticsearch.marvel.mode.Mode;
|
||||
import org.elasticsearch.plugins.AbstractPlugin;
|
||||
import org.elasticsearch.plugins.PluginsService;
|
||||
import org.elasticsearch.test.ElasticsearchIntegrationTest;
|
||||
import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope;
|
||||
import org.junit.Test;
|
||||
|
@ -39,7 +38,6 @@ public class LicenseIntegrationTests extends ElasticsearchIntegrationTest {
|
|||
return Settings.settingsBuilder()
|
||||
.put(super.nodeSettings(nodeOrdinal))
|
||||
.put("plugin.types", MarvelPlugin.class.getName() + "," + MockLicensePlugin.class.getName())
|
||||
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
|
3
pom.xml
3
pom.xml
|
@ -122,6 +122,9 @@
|
|||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<properties>
|
||||
<enforcer.skip>true</enforcer.skip>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
eclipse.preferences.version=1
|
||||
encoding//src/main/java=UTF-8
|
||||
encoding//src/main/resources=UTF-8
|
||||
encoding//src/test/java=UTF-8
|
||||
encoding//src/test/resources=UTF-8
|
||||
encoding/<project>=UTF-8
|
|
@ -0,0 +1,18 @@
|
|||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled
|
||||
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
|
||||
org.eclipse.jdt.core.compiler.annotation.nullable=org.elasticsearch.common.Nullable
|
||||
org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nullReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
|
||||
org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
|
||||
org.eclipse.jdt.core.compiler.source=1.7
|
||||
org.eclipse.jdt.core.formatter.lineSplit=140
|
||||
org.eclipse.jdt.core.formatter.tabulation.char=space
|
||||
org.eclipse.jdt.core.formatter.tabulation.size=4
|
File diff suppressed because one or more lines are too long
|
@ -16,6 +16,11 @@
|
|||
</parent>
|
||||
|
||||
<properties>
|
||||
<!-- TODO: try to avoid this... -->
|
||||
<elasticsearch.assembly.descriptor>${basedir}/src/main/assemblies/plugin.xml</elasticsearch.assembly.descriptor>
|
||||
<elasticsearch.plugin.classname>org.elasticsearch.shield.ShieldPlugin</elasticsearch.plugin.classname>
|
||||
<!-- TODO: fix plugin dependencies for full isolation -->
|
||||
<elasticsearch.plugin.isolated>false</elasticsearch.plugin.isolated>
|
||||
<tests.rest.blacklist>indices.get/10_basic/*allow_no_indices*,cat.count/10_basic/Test cat count output,cat.aliases/10_basic/Empty cluster,indices.segments/10_basic/no segments test,indices.clear_cache/10_basic/clear_cache test,indices.status/10_basic/Indices status test,cat.indices/10_basic/Test cat indices output,cat.recovery/10_basic/Test cat recovery output,cat.shards/10_basic/Test cat shards output,termvector/20_issue7121/*,index/10_with_id/Index with ID,indices.get_alias/20_emtpy/*,cat.segments/10_basic/Test cat segments output,indices.put_settings/10_basic/Test indices settings allow_no_indices,indices.put_settings/10_basic/Test indices settings ignore_unavailable,indices.refresh/10_basic/Indices refresh test no-match wildcard,indices.stats/10_index/Index - star*,indices.recovery/10_basic/Indices recovery test*,template/30_render_search_template/*,indices.shard_stores/10_basic/no indices test</tests.rest.blacklist>
|
||||
<!-- TODO: refactor -->
|
||||
<elasticsearch.integ.antfile>${basedir}/dev-tools/integration-tests.xml</elasticsearch.integ.antfile>
|
||||
|
|
|
@ -37,5 +37,10 @@
|
|||
<source>NOTICE.txt</source>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
</file>
|
||||
<file>
|
||||
<source>${elasticsearch.tools.directory}/plugin-metadata/plugin-descriptor.properties</source>
|
||||
<outputDirectory></outputDirectory>
|
||||
<filtered>true</filtered>
|
||||
</file>
|
||||
</files>
|
||||
</assembly>
|
||||
|
|
|
@ -588,7 +588,6 @@ public class IndexAuditTrail extends AbstractComponent implements AuditTrail {
|
|||
.settings(Settings.builder()
|
||||
.put("name", DEFAULT_CLIENT_NAME)
|
||||
.put("path.home", environment.homeFile())
|
||||
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
|
||||
.putArray("plugin.types", ShieldPlugin.class.getName())
|
||||
.put(clientSettings))
|
||||
.build();
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
plugin=org.elasticsearch.shield.ShieldPlugin
|
||||
version=${project.version}
|
|
@ -11,7 +11,9 @@ import org.elasticsearch.client.transport.TransportClient;
|
|||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.transport.InetSocketTransportAddress;
|
||||
import org.elasticsearch.http.HttpServerTransport;
|
||||
import org.elasticsearch.license.plugin.LicensePlugin;
|
||||
import org.elasticsearch.node.Node;
|
||||
import org.elasticsearch.shield.ShieldPlugin;
|
||||
import org.elasticsearch.shield.authc.support.SecuredString;
|
||||
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
|
||||
import org.elasticsearch.shield.transport.SSLClientAuth;
|
||||
|
@ -103,6 +105,7 @@ public class PkiOptionalClientAuthTests extends ShieldIntegrationTest {
|
|||
.put("cluster.name", internalTestCluster().getClusterName())
|
||||
.put("shield.transport.ssl", true)
|
||||
.put("path.home", createTempDir())
|
||||
.put("plugin.types", ShieldPlugin.class.getName())
|
||||
.build();
|
||||
|
||||
|
||||
|
|
|
@ -12,7 +12,9 @@ import org.elasticsearch.common.transport.InetSocketTransportAddress;
|
|||
import org.elasticsearch.common.transport.TransportAddress;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.discovery.MasterNotDiscoveredException;
|
||||
import org.elasticsearch.license.plugin.LicensePlugin;
|
||||
import org.elasticsearch.node.Node;
|
||||
import org.elasticsearch.shield.ShieldPlugin;
|
||||
import org.elasticsearch.shield.authc.esusers.ESUsersRealm;
|
||||
import org.elasticsearch.shield.crypto.InternalCryptoService;
|
||||
import org.elasticsearch.test.ShieldIntegrationTest;
|
||||
|
@ -89,6 +91,7 @@ public class ServerTransportFilterIntegrationTests extends ShieldIntegrationTest
|
|||
// test that starting up a node works
|
||||
Settings nodeSettings = settingsBuilder()
|
||||
.put(ShieldSettingsSource.getSSLSettingsForStore("/org/elasticsearch/shield/transport/ssl/certs/simple/testnode.jks", "testnode"))
|
||||
.put("plugin.types", ShieldPlugin.class.getName() + "," + LicensePlugin.class.getName())
|
||||
.put("node.mode", "network")
|
||||
.put("node.name", "my-test-node")
|
||||
.put("network.host", "localhost")
|
||||
|
|
|
@ -16,6 +16,7 @@ import org.elasticsearch.common.transport.TransportAddress;
|
|||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.http.HttpServerTransport;
|
||||
import org.elasticsearch.node.Node;
|
||||
import org.elasticsearch.shield.ShieldPlugin;
|
||||
import org.elasticsearch.shield.ssl.ClientSSLService;
|
||||
import org.elasticsearch.shield.transport.netty.ShieldNettyHttpServerTransport;
|
||||
import org.elasticsearch.test.ShieldIntegrationTest;
|
||||
|
@ -101,6 +102,7 @@ public class SslClientAuthTests extends ShieldIntegrationTest {
|
|||
|
||||
Settings settings = settingsBuilder()
|
||||
.put("path.home", createTempDir())
|
||||
.put("plugin.types", ShieldPlugin.class.getName())
|
||||
.put("shield.transport.ssl", true)
|
||||
.put("shield.ssl.keystore.path", store)
|
||||
.put("shield.ssl.keystore.password", "testclient-client-profile")
|
||||
|
|
|
@ -10,6 +10,7 @@ import org.elasticsearch.client.transport.TransportClient;
|
|||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.transport.InetSocketTransportAddress;
|
||||
import org.elasticsearch.common.transport.TransportAddress;
|
||||
import org.elasticsearch.shield.ShieldPlugin;
|
||||
import org.elasticsearch.test.ShieldIntegrationTest;
|
||||
import org.elasticsearch.test.ShieldSettingsSource;
|
||||
import org.elasticsearch.transport.Transport;
|
||||
|
@ -211,6 +212,7 @@ public class SslMultiPortTests extends ShieldIntegrationTest {
|
|||
.put("shield.user", DEFAULT_USER_NAME + ":" + DEFAULT_PASSWORD)
|
||||
.put("cluster.name", internalTestCluster().getClusterName())
|
||||
.put("path.home", createTempDir())
|
||||
.put("plugin.types", ShieldPlugin.class.getName())
|
||||
.build();
|
||||
try (TransportClient transportClient = TransportClient.builder().settings(settings).loadConfigSettings(false).build()) {
|
||||
transportClient.addTransportAddress(new InetSocketTransportAddress("localhost", getProfilePort("no_ssl")));
|
||||
|
@ -228,6 +230,7 @@ public class SslMultiPortTests extends ShieldIntegrationTest {
|
|||
.put("shield.user", DEFAULT_USER_NAME + ":" + DEFAULT_PASSWORD)
|
||||
.put("cluster.name", internalTestCluster().getClusterName())
|
||||
.put("path.home", createTempDir())
|
||||
.put("plugin.types", ShieldPlugin.class.getName())
|
||||
.build();
|
||||
try (TransportClient transportClient = TransportClient.builder().settings(settings).loadConfigSettings(false).build()) {
|
||||
transportClient.addTransportAddress(internalTestCluster().getInstance(Transport.class).boundAddress().boundAddress());
|
||||
|
@ -245,6 +248,7 @@ public class SslMultiPortTests extends ShieldIntegrationTest {
|
|||
.put("shield.user", DEFAULT_USER_NAME + ":" + DEFAULT_PASSWORD)
|
||||
.put("cluster.name", internalTestCluster().getClusterName())
|
||||
.put("path.home", createTempDir())
|
||||
.put("plugin.types", ShieldPlugin.class.getName())
|
||||
.build();
|
||||
try (TransportClient transportClient = TransportClient.builder().settings(settings).loadConfigSettings(false).build()) {
|
||||
transportClient.addTransportAddress(new InetSocketTransportAddress("localhost", getProfilePort("client")));
|
||||
|
@ -262,6 +266,7 @@ public class SslMultiPortTests extends ShieldIntegrationTest {
|
|||
.put("shield.user", DEFAULT_USER_NAME + ":" + DEFAULT_PASSWORD)
|
||||
.put("cluster.name", internalTestCluster().getClusterName())
|
||||
.put("path.home", createTempDir())
|
||||
.put("plugin.types", ShieldPlugin.class.getName())
|
||||
.build();
|
||||
try (TransportClient transportClient = TransportClient.builder().settings(settings).loadConfigSettings(false).build()) {
|
||||
transportClient.addTransportAddress(new InetSocketTransportAddress("localhost", getProfilePort("no_client_auth")));
|
||||
|
@ -283,6 +288,7 @@ public class SslMultiPortTests extends ShieldIntegrationTest {
|
|||
.put("shield.ssl.truststore.path", getDataPath("/org/elasticsearch/shield/transport/ssl/certs/simple/truststore-testnode-only.jks"))
|
||||
.put("shield.ssl.truststore.password", "truststore-testnode-only")
|
||||
.put("path.home", createTempDir())
|
||||
.put("plugin.types", ShieldPlugin.class.getName())
|
||||
.build();
|
||||
try (TransportClient transportClient = TransportClient.builder().settings(settings).loadConfigSettings(false).build()) {
|
||||
transportClient.addTransportAddress(new InetSocketTransportAddress("localhost", getProfilePort("no_client_auth")));
|
||||
|
@ -305,6 +311,7 @@ public class SslMultiPortTests extends ShieldIntegrationTest {
|
|||
.put("shield.ssl.truststore.path", getDataPath("/org/elasticsearch/shield/transport/ssl/certs/simple/truststore-testnode-only.jks"))
|
||||
.put("shield.ssl.truststore.password", "truststore-testnode-only")
|
||||
.put("path.home", createTempDir())
|
||||
.put("plugin.types", ShieldPlugin.class.getName())
|
||||
.build();
|
||||
try (TransportClient transportClient = TransportClient.builder().settings(settings).loadConfigSettings(false).build()) {
|
||||
transportClient.addTransportAddress(new InetSocketTransportAddress("localhost", getProfilePort("client")));
|
||||
|
@ -327,6 +334,7 @@ public class SslMultiPortTests extends ShieldIntegrationTest {
|
|||
.put("shield.ssl.truststore.path", getDataPath("/org/elasticsearch/shield/transport/ssl/certs/simple/truststore-testnode-only.jks"))
|
||||
.put("shield.ssl.truststore.password", "truststore-testnode-only")
|
||||
.put("path.home", createTempDir())
|
||||
.put("plugin.types", ShieldPlugin.class.getName())
|
||||
.build();
|
||||
try (TransportClient transportClient = TransportClient.builder().settings(settings).loadConfigSettings(false).build()) {
|
||||
transportClient.addTransportAddress(internalTestCluster().getInstance(Transport.class).boundAddress().boundAddress());
|
||||
|
@ -348,6 +356,7 @@ public class SslMultiPortTests extends ShieldIntegrationTest {
|
|||
.put("shield.ssl.truststore.path", getDataPath("/org/elasticsearch/shield/transport/ssl/certs/simple/truststore-testnode-only.jks"))
|
||||
.put("shield.ssl.truststore.password", "truststore-testnode-only")
|
||||
.put("path.home", createTempDir())
|
||||
.put("plugin.types", ShieldPlugin.class.getName())
|
||||
.build();
|
||||
try (TransportClient transportClient = TransportClient.builder().settings(settings).loadConfigSettings(false).build()) {
|
||||
transportClient.addTransportAddress(new InetSocketTransportAddress("localhost", getProfilePort("no_ssl")));
|
||||
|
@ -367,6 +376,7 @@ public class SslMultiPortTests extends ShieldIntegrationTest {
|
|||
.put("cluster.name", internalTestCluster().getClusterName())
|
||||
.put("shield.transport.ssl", true)
|
||||
.put("path.home", createTempDir())
|
||||
.put("plugin.types", ShieldPlugin.class.getName())
|
||||
.build();
|
||||
try (TransportClient transportClient = TransportClient.builder().settings(settings).loadConfigSettings(false).build()) {
|
||||
transportClient.addTransportAddress(internalTestCluster().getInstance(Transport.class).boundAddress().boundAddress());
|
||||
|
@ -386,6 +396,7 @@ public class SslMultiPortTests extends ShieldIntegrationTest {
|
|||
.put("cluster.name", internalTestCluster().getClusterName())
|
||||
.put("shield.transport.ssl", true)
|
||||
.put("path.home", createTempDir())
|
||||
.put("plugin.types", ShieldPlugin.class.getName())
|
||||
.build();
|
||||
try (TransportClient transportClient = TransportClient.builder().settings(settings).loadConfigSettings(false).build()) {
|
||||
transportClient.addTransportAddress(new InetSocketTransportAddress("localhost", getProfilePort("client")));
|
||||
|
@ -405,6 +416,7 @@ public class SslMultiPortTests extends ShieldIntegrationTest {
|
|||
.put("cluster.name", internalTestCluster().getClusterName())
|
||||
.put("shield.transport.ssl", true)
|
||||
.put("path.home", createTempDir())
|
||||
.put("plugin.types", ShieldPlugin.class.getName())
|
||||
.build();
|
||||
try (TransportClient transportClient = TransportClient.builder().settings(settings).loadConfigSettings(false).build()) {
|
||||
transportClient.addTransportAddress(new InetSocketTransportAddress("localhost", getProfilePort("no_client_auth")));
|
||||
|
@ -424,6 +436,7 @@ public class SslMultiPortTests extends ShieldIntegrationTest {
|
|||
.put("cluster.name", internalTestCluster().getClusterName())
|
||||
.put("shield.transport.ssl", true)
|
||||
.put("path.home", createTempDir())
|
||||
.put("plugin.types", ShieldPlugin.class.getName())
|
||||
.build();
|
||||
try (TransportClient transportClient = TransportClient.builder().settings(settings).loadConfigSettings(false).build()) {
|
||||
transportClient.addTransportAddress(new InetSocketTransportAddress("localhost", getProfilePort("no_ssl")));
|
||||
|
|
|
@ -28,14 +28,6 @@ public class TribeShieldLoadedTests extends ElasticsearchTestCase {
|
|||
public void testShieldLoadedOnBothTribeNodeAndClients() {
|
||||
//all good if the plugin is loaded on both tribe node and tribe clients, no matter how it gets loaded (manually or from classpath)
|
||||
Settings.Builder builder = defaultSettings();
|
||||
if (randomBoolean()) {
|
||||
builder.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
|
||||
.put("plugin.types", ShieldPlugin.class.getName() + "," + LicensePlugin.class.getName());
|
||||
}
|
||||
if (randomBoolean()) {
|
||||
builder.put("tribe.t1." + PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
|
||||
.put("tribe.t1.plugin.types", ShieldPlugin.class.getName() + "," + LicensePlugin.class.getName());
|
||||
}
|
||||
|
||||
try (Node node = NodeBuilder.nodeBuilder().settings(builder.build()).build()) {
|
||||
node.start();
|
||||
|
@ -48,12 +40,6 @@ public class TribeShieldLoadedTests extends ElasticsearchTestCase {
|
|||
public void testShieldLoadedOnTribeNodeOnly() {
|
||||
//startup failure if any of the tribe clients doesn't have shield installed
|
||||
Settings.Builder builder = defaultSettings();
|
||||
if (randomBoolean()) {
|
||||
builder.put("plugins." + PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
|
||||
.put("plugin.types", ShieldPlugin.class.getName() + "," + LicensePlugin.class.getName());
|
||||
}
|
||||
|
||||
builder.put("tribe.t1.plugins." + PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false);
|
||||
|
||||
try {
|
||||
NodeBuilder.nodeBuilder().settings(builder.build()).build();
|
||||
|
@ -68,15 +54,6 @@ public class TribeShieldLoadedTests extends ElasticsearchTestCase {
|
|||
public void testShieldMustBeLoadedOnAllTribes() {
|
||||
//startup failure if any of the tribe clients doesn't have shield installed
|
||||
Settings.Builder builder = addTribeSettings(defaultSettings(), "t2");
|
||||
if (randomBoolean()) {
|
||||
builder.put("plugins." + PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
|
||||
.put("plugin.types", ShieldPlugin.class.getName() + "," + LicensePlugin.class.getName());
|
||||
}
|
||||
|
||||
//load shield explicitly on tribe t1
|
||||
builder.put("tribe.t1.plugin.types", ShieldPlugin.class.getName() + "," + LicensePlugin.class.getName())
|
||||
//disable loading from classpath on tribe t2 only
|
||||
.put("tribe.t2.plugins." + PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false);
|
||||
|
||||
try {
|
||||
NodeBuilder.nodeBuilder().settings(builder.build()).build();
|
||||
|
@ -89,13 +66,15 @@ public class TribeShieldLoadedTests extends ElasticsearchTestCase {
|
|||
private static Settings.Builder defaultSettings() {
|
||||
return addTribeSettings(Settings.builder()
|
||||
.put("node.name", "tribe_node")
|
||||
.put("path.home", createTempDir()), "t1");
|
||||
.put("path.home", createTempDir()), "t1")
|
||||
.put("plugin.types", ShieldPlugin.class.getName() + "," + LicensePlugin.class.getName());
|
||||
}
|
||||
|
||||
private static Settings.Builder addTribeSettings(Settings.Builder settingsBuilder, String tribe) {
|
||||
String tribePrefix = "tribe." + tribe + ".";
|
||||
return settingsBuilder.put(tribePrefix + "cluster.name", "non_existing_cluster")
|
||||
.put(tribePrefix + "discovery.type", "local")
|
||||
.put(tribePrefix + "discovery.initial_state_timeout", 0);
|
||||
.put(tribePrefix + "discovery.initial_state_timeout", 0)
|
||||
.put(tribePrefix + "plugin.types", ShieldPlugin.class.getName() + "," + LicensePlugin.class.getName());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,17 +8,18 @@ package org.elasticsearch.test;
|
|||
import com.carrotsearch.hppc.cursors.ObjectObjectCursor;
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.Collections2;
|
||||
|
||||
import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
|
||||
import org.elasticsearch.action.admin.cluster.health.ClusterHealthStatus;
|
||||
import org.elasticsearch.action.admin.cluster.node.info.NodeInfo;
|
||||
import org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse;
|
||||
import org.elasticsearch.action.admin.cluster.node.info.PluginInfo;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.cluster.ClusterService;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.metadata.IndexTemplateMetaData;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.plugins.PluginInfo;
|
||||
import org.elasticsearch.shield.ShieldPlugin;
|
||||
import org.elasticsearch.shield.audit.index.IndexAuditTrail;
|
||||
import org.elasticsearch.shield.authc.support.SecuredString;
|
||||
|
@ -170,6 +171,7 @@ public abstract class ShieldIntegrationTest extends ElasticsearchIntegrationTest
|
|||
@Override
|
||||
protected Settings externalClusterClientSettings() {
|
||||
return Settings.builder()
|
||||
.put("plugin.types", ShieldPlugin.class.getName())
|
||||
.put("shield.user", ShieldSettingsSource.DEFAULT_USER_NAME + ":" + ShieldSettingsSource.DEFAULT_PASSWORD)
|
||||
.build();
|
||||
}
|
||||
|
|
|
@ -88,7 +88,11 @@ public abstract class ShieldRestTestCase extends ShieldIntegrationTest {
|
|||
|
||||
@Override
|
||||
public Settings nodeSettings(int ordinal) {
|
||||
return super.nodeSettings(ordinal);
|
||||
return Settings.builder()
|
||||
.put(super.nodeSettings(ordinal))
|
||||
.put(ShieldRestTestCase.super.nodeSettings(ordinal))
|
||||
.put(Node.HTTP_ENABLED, true)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
eclipse.preferences.version=1
|
||||
encoding//src/main/java=UTF-8
|
||||
encoding//src/main/resources=UTF-8
|
||||
encoding//src/test/java=UTF-8
|
||||
encoding//src/test/resources=UTF-8
|
||||
encoding/<project>=UTF-8
|
|
@ -0,0 +1,18 @@
|
|||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled
|
||||
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
|
||||
org.eclipse.jdt.core.compiler.annotation.nullable=org.elasticsearch.common.Nullable
|
||||
org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nullReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
|
||||
org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
|
||||
org.eclipse.jdt.core.compiler.source=1.7
|
||||
org.eclipse.jdt.core.formatter.lineSplit=140
|
||||
org.eclipse.jdt.core.formatter.tabulation.char=space
|
||||
org.eclipse.jdt.core.formatter.tabulation.size=4
|
File diff suppressed because one or more lines are too long
|
@ -16,6 +16,11 @@
|
|||
</parent>
|
||||
|
||||
<properties>
|
||||
<!-- TODO: try to avoid this... -->
|
||||
<elasticsearch.assembly.descriptor>${basedir}/src/main/assemblies/plugin.xml</elasticsearch.assembly.descriptor>
|
||||
<elasticsearch.plugin.classname>org.elasticsearch.watcher.WatcherPlugin</elasticsearch.plugin.classname>
|
||||
<!-- TODO: fix plugin dependencies for full isolation -->
|
||||
<elasticsearch.plugin.isolated>false</elasticsearch.plugin.isolated>
|
||||
<elasticsearch.integ.antfile>dev-tools/integration-tests.xml</elasticsearch.integ.antfile>
|
||||
<tests.rest.load_packaged>false</tests.rest.load_packaged>
|
||||
<tests.timewarp>true</tests.timewarp>
|
||||
|
|
|
@ -32,6 +32,11 @@
|
|||
</dependencySet>
|
||||
</dependencySets>
|
||||
<files>
|
||||
<file>
|
||||
<source>${elasticsearch.tools.directory}/plugin-metadata/plugin-descriptor.properties</source>
|
||||
<outputDirectory></outputDirectory>
|
||||
<filtered>true</filtered>
|
||||
</file>
|
||||
<file>
|
||||
<source>LICENSE.txt</source>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
plugin=org.elasticsearch.watcher.WatcherPlugin
|
||||
version=${project.version}
|
|
@ -39,7 +39,6 @@ public class WatcherPluginDisableTests extends ElasticsearchIntegrationTest {
|
|||
return Settings.settingsBuilder()
|
||||
.put(super.nodeSettings(nodeOrdinal))
|
||||
.put("plugin.types", WatcherPlugin.class.getName() + "," + LicensePlugin.class.getName())
|
||||
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
|
||||
.put(WatcherPlugin.ENABLED_SETTING, false)
|
||||
.put(Node.HTTP_ENABLED, true)
|
||||
.build();
|
||||
|
@ -49,7 +48,6 @@ public class WatcherPluginDisableTests extends ElasticsearchIntegrationTest {
|
|||
protected Settings transportClientSettings() {
|
||||
return Settings.builder()
|
||||
.put(super.transportClientSettings())
|
||||
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,6 @@ public class IndexActionTests extends ElasticsearchIntegrationTest {
|
|||
protected Settings nodeSettings(int nodeOrdinal) {
|
||||
return Settings.builder()
|
||||
.put(super.nodeSettings(nodeOrdinal))
|
||||
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -59,7 +58,6 @@ public class IndexActionTests extends ElasticsearchIntegrationTest {
|
|||
protected Settings transportClientSettings() {
|
||||
return Settings.builder()
|
||||
.put(super.transportClientSettings())
|
||||
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
|
|
@ -95,7 +95,6 @@ public class SearchInputTests extends ElasticsearchIntegrationTest {
|
|||
|
||||
//Set path so ScriptService will pick up the test scripts
|
||||
return settingsBuilder().put(super.nodeSettings(nodeOrdinal))
|
||||
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
|
||||
.put("path.conf", configPath).build();
|
||||
}
|
||||
|
||||
|
@ -103,7 +102,6 @@ public class SearchInputTests extends ElasticsearchIntegrationTest {
|
|||
protected Settings transportClientSettings() {
|
||||
return Settings.builder()
|
||||
.put(super.transportClientSettings())
|
||||
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,6 @@ public class BasicShieldTests extends AbstractWatcherIntegrationTests {
|
|||
.put("plugin.types", ShieldPlugin.class.getName() + "," + WatcherPlugin.class.getName())
|
||||
// Use just the transport user here, so we can test Watcher roles specifically
|
||||
.put("shield.user", "transport_client:changeme")
|
||||
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
|
|
@ -114,7 +114,6 @@ public abstract class AbstractWatcherIntegrationTests extends ElasticsearchInteg
|
|||
.put("scroll.size", randomIntBetween(1, 100))
|
||||
.put("plugin.types", Strings.collectionToCommaDelimitedString(pluginTypes()))
|
||||
.put(ShieldSettings.settings(shieldEnabled))
|
||||
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
|
||||
.put("watcher.trigger.schedule.engine", scheduleImplName)
|
||||
.build();
|
||||
}
|
||||
|
@ -199,7 +198,6 @@ public abstract class AbstractWatcherIntegrationTests extends ElasticsearchInteg
|
|||
if (shieldEnabled == false) {
|
||||
return Settings.builder()
|
||||
.put(super.transportClientSettings())
|
||||
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
|
||||
.put("plugin.types", WatcherPlugin.class.getName())
|
||||
.build();
|
||||
}
|
||||
|
@ -207,7 +205,6 @@ public abstract class AbstractWatcherIntegrationTests extends ElasticsearchInteg
|
|||
return Settings.builder()
|
||||
.put("client.transport.sniff", false)
|
||||
.put("plugin.types", ShieldPlugin.class.getName() + "," + WatcherPlugin.class.getName())
|
||||
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
|
||||
.put("shield.user", "admin:changeme")
|
||||
.build();
|
||||
}
|
||||
|
|
|
@ -63,7 +63,6 @@ public class WatcherRestTests extends ElasticsearchRestTestCase {
|
|||
+ "," + licensePluginClass().getName())
|
||||
.put(Node.HTTP_ENABLED, true)
|
||||
.put(ShieldSettings.settings(shieldEnabled))
|
||||
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -81,7 +80,6 @@ public class WatcherRestTests extends ElasticsearchRestTestCase {
|
|||
String token = basicAuthHeaderValue("admin", new SecuredString("changeme".toCharArray()));
|
||||
return Settings.builder()
|
||||
.put(Headers.PREFIX + ".Authorization", token)
|
||||
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
|
||||
.build();
|
||||
} else {
|
||||
return Settings.EMPTY;
|
||||
|
@ -98,7 +96,6 @@ public class WatcherRestTests extends ElasticsearchRestTestCase {
|
|||
+ (shieldEnabled ? ShieldPlugin.class.getName() + "," : ""))
|
||||
.put("shield.user", "admin:changeme")
|
||||
.put(Node.HTTP_ENABLED, true)
|
||||
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -107,7 +104,6 @@ public class WatcherRestTests extends ElasticsearchRestTestCase {
|
|||
.put(Node.HTTP_ENABLED, true)
|
||||
.put("plugin.types", WatcherPlugin.class.getName() + ","
|
||||
+ "," + LicensePlugin.class.getName())
|
||||
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
|
|
@ -95,7 +95,6 @@ public class SearchTransformTests extends ElasticsearchIntegrationTest {
|
|||
return settingsBuilder()
|
||||
.put(super.nodeSettings(nodeOrdinal))
|
||||
// we're not extending from the base watcher test case, so we should prevent the watcher plugin from being loaded
|
||||
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
|
||||
.put("path.conf", configPath).build();
|
||||
}
|
||||
|
||||
|
@ -103,7 +102,6 @@ public class SearchTransformTests extends ElasticsearchIntegrationTest {
|
|||
protected Settings transportClientSettings() {
|
||||
return Settings.builder()
|
||||
.put(super.transportClientSettings())
|
||||
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue