fix tests to use the transport-netty plugin
Original commit: elastic/x-pack-elasticsearch@65c0cd0cf2
This commit is contained in:
parent
a2359d13f3
commit
9204920d9a
|
@ -9,9 +9,11 @@ import org.elasticsearch.ElasticsearchException;
|
||||||
import org.elasticsearch.action.admin.cluster.node.info.NodeInfo;
|
import org.elasticsearch.action.admin.cluster.node.info.NodeInfo;
|
||||||
import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesResponse;
|
import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesResponse;
|
||||||
import org.elasticsearch.common.io.PathUtils;
|
import org.elasticsearch.common.io.PathUtils;
|
||||||
|
import org.elasticsearch.common.network.NetworkModule;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.transport.InetSocketTransportAddress;
|
import org.elasticsearch.common.transport.InetSocketTransportAddress;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
|
import org.elasticsearch.test.junit.annotations.Network;
|
||||||
import org.elasticsearch.xpack.security.Security;
|
import org.elasticsearch.xpack.security.Security;
|
||||||
import org.elasticsearch.xpack.security.transport.netty.SecurityNettyTransport;
|
import org.elasticsearch.xpack.security.transport.netty.SecurityNettyTransport;
|
||||||
import org.elasticsearch.test.ESIntegTestCase;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
|
@ -49,7 +51,6 @@ public class SmokeTestMonitoringWithSecurityIT extends ESIntegTestCase {
|
||||||
private static final String USER = "test_user";
|
private static final String USER = "test_user";
|
||||||
private static final String PASS = "changeme";
|
private static final String PASS = "changeme";
|
||||||
private static final String KEYSTORE_PASS = "keypass";
|
private static final String KEYSTORE_PASS = "keypass";
|
||||||
|
|
||||||
private static final String MONITORING_PATTERN = ".monitoring-*";
|
private static final String MONITORING_PATTERN = ".monitoring-*";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -64,6 +65,7 @@ public class SmokeTestMonitoringWithSecurityIT extends ESIntegTestCase {
|
||||||
.put(SecurityNettyTransport.SSL_SETTING.getKey(), true)
|
.put(SecurityNettyTransport.SSL_SETTING.getKey(), true)
|
||||||
.put("xpack.security.ssl.keystore.path", clientKeyStore)
|
.put("xpack.security.ssl.keystore.path", clientKeyStore)
|
||||||
.put("xpack.security.ssl.keystore.password", KEYSTORE_PASS)
|
.put("xpack.security.ssl.keystore.password", KEYSTORE_PASS)
|
||||||
|
.put(NetworkModule.TRANSPORT_TYPE_KEY, Security.NAME)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,10 @@ import org.elasticsearch.license.plugin.core.LicensesService;
|
||||||
import org.elasticsearch.license.plugin.core.LicensesStatus;
|
import org.elasticsearch.license.plugin.core.LicensesStatus;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
|
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
|
||||||
|
import org.elasticsearch.transport.NettyPlugin;
|
||||||
import org.elasticsearch.xpack.XPackPlugin;
|
import org.elasticsearch.xpack.XPackPlugin;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
||||||
|
@ -59,7 +61,7 @@ public class LicensesServiceClusterTests extends AbstractLicensesIntegrationTest
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
||||||
return Collections.singletonList(XPackPlugin.class);
|
return Arrays.asList(XPackPlugin.class, NettyPlugin.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -134,6 +134,7 @@ public abstract class TribeTransportTestCase extends ESIntegTestCase {
|
||||||
.put("tribe.blocks.write", false)
|
.put("tribe.blocks.write", false)
|
||||||
.put(tribe1Defaults.build())
|
.put(tribe1Defaults.build())
|
||||||
.put(tribe2Defaults.build())
|
.put(tribe2Defaults.build())
|
||||||
|
.put(NetworkModule.HTTP_ENABLED.getKey(), false)
|
||||||
.put(internalCluster().getDefaultSettings())
|
.put(internalCluster().getDefaultSettings())
|
||||||
.put("node.name", "tribe_node") // make sure we can identify threads from this node
|
.put("node.name", "tribe_node") // make sure we can identify threads from this node
|
||||||
.put(Node.NODE_LOCAL_SETTING.getKey(), true)
|
.put(Node.NODE_LOCAL_SETTING.getKey(), true)
|
||||||
|
|
|
@ -57,7 +57,6 @@ public abstract class AbstractCollectorTestCase extends MonitoringIntegTestCase
|
||||||
protected Settings nodeSettings(int nodeOrdinal) {
|
protected Settings nodeSettings(int nodeOrdinal) {
|
||||||
return Settings.builder()
|
return Settings.builder()
|
||||||
.put(super.nodeSettings(nodeOrdinal))
|
.put(super.nodeSettings(nodeOrdinal))
|
||||||
.put(NetworkModule.HTTP_ENABLED.getKey(), false)
|
|
||||||
.put(MonitoringSettings.INTERVAL.getKey(), "-1")
|
.put(MonitoringSettings.INTERVAL.getKey(), "-1")
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,12 +10,16 @@ import org.elasticsearch.common.network.NetworkModule;
|
||||||
import org.elasticsearch.common.settings.Setting;
|
import org.elasticsearch.common.settings.Setting;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.test.ESIntegTestCase;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
|
import org.elasticsearch.transport.NettyPlugin;
|
||||||
import org.elasticsearch.xpack.monitoring.MonitoringSettings;
|
import org.elasticsearch.xpack.monitoring.MonitoringSettings;
|
||||||
import org.elasticsearch.xpack.monitoring.agent.AgentService;
|
import org.elasticsearch.xpack.monitoring.agent.AgentService;
|
||||||
import org.elasticsearch.xpack.monitoring.test.MonitoringIntegTestCase;
|
import org.elasticsearch.xpack.monitoring.test.MonitoringIntegTestCase;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
|
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
|
||||||
|
@ -44,6 +48,13 @@ public class MonitoringSettingsTests extends MonitoringIntegTestCase {
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
||||||
|
ArrayList<Class<? extends Plugin>> plugins = new ArrayList<>(super.nodePlugins());
|
||||||
|
plugins.add(NettyPlugin.class); // for http
|
||||||
|
return plugins;
|
||||||
|
}
|
||||||
|
|
||||||
private Settings monitoringSettings() {
|
private Settings monitoringSettings() {
|
||||||
return Settings.builder()
|
return Settings.builder()
|
||||||
.put(MonitoringSettings.INTERVAL.getKey(), interval)
|
.put(MonitoringSettings.INTERVAL.getKey(), interval)
|
||||||
|
|
|
@ -26,7 +26,6 @@ public class MonitoringInternalClientTests extends MonitoringIntegTestCase {
|
||||||
protected Settings nodeSettings(int nodeOrdinal) {
|
protected Settings nodeSettings(int nodeOrdinal) {
|
||||||
return Settings.builder()
|
return Settings.builder()
|
||||||
.put(super.nodeSettings(nodeOrdinal))
|
.put(super.nodeSettings(nodeOrdinal))
|
||||||
.put(NetworkModule.HTTP_ENABLED.getKey(), false)
|
|
||||||
.put(MonitoringSettings.INTERVAL.getKey(), "-1")
|
.put(MonitoringSettings.INTERVAL.getKey(), "-1")
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,10 +11,14 @@ import org.elasticsearch.client.Response;
|
||||||
import org.elasticsearch.common.network.NetworkModule;
|
import org.elasticsearch.common.network.NetworkModule;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.xcontent.json.JsonXContent;
|
import org.elasticsearch.common.xcontent.json.JsonXContent;
|
||||||
|
import org.elasticsearch.plugins.Plugin;
|
||||||
|
import org.elasticsearch.transport.NettyPlugin;
|
||||||
import org.elasticsearch.xpack.monitoring.MonitoringSettings;
|
import org.elasticsearch.xpack.monitoring.MonitoringSettings;
|
||||||
import org.elasticsearch.xpack.monitoring.test.MonitoringIntegTestCase;
|
import org.elasticsearch.xpack.monitoring.test.MonitoringIntegTestCase;
|
||||||
import org.elasticsearch.xpack.security.authc.support.SecuredString;
|
import org.elasticsearch.xpack.security.authc.support.SecuredString;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -42,6 +46,13 @@ public class MonitoringSettingsFilterTests extends MonitoringIntegTestCase {
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
||||||
|
ArrayList<Class<? extends Plugin>> plugins = new ArrayList<>(super.nodePlugins());
|
||||||
|
plugins.add(NettyPlugin.class); // for http
|
||||||
|
return plugins;
|
||||||
|
}
|
||||||
|
|
||||||
public void testGetSettingsFiltered() throws Exception {
|
public void testGetSettingsFiltered() throws Exception {
|
||||||
Header[] headers;
|
Header[] headers;
|
||||||
if (securityEnabled) {
|
if (securityEnabled) {
|
||||||
|
|
|
@ -9,11 +9,15 @@ import org.apache.http.message.BasicHeader;
|
||||||
import org.elasticsearch.client.ResponseException;
|
import org.elasticsearch.client.ResponseException;
|
||||||
import org.elasticsearch.common.network.NetworkModule;
|
import org.elasticsearch.common.network.NetworkModule;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.test.ESIntegTestCase;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
|
import org.elasticsearch.transport.NettyPlugin;
|
||||||
import org.elasticsearch.xpack.security.authc.support.SecuredString;
|
import org.elasticsearch.xpack.security.authc.support.SecuredString;
|
||||||
import org.elasticsearch.xpack.security.authc.support.UsernamePasswordToken;
|
import org.elasticsearch.xpack.security.authc.support.UsernamePasswordToken;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -130,6 +134,13 @@ public class IndexPrivilegeTests extends AbstractPrivilegeTestCase {
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
||||||
|
ArrayList<Class<? extends Plugin>> plugins = new ArrayList<>(super.nodePlugins());
|
||||||
|
plugins.add(NettyPlugin.class); // for http
|
||||||
|
return plugins;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String configRoles() {
|
protected String configRoles() {
|
||||||
return super.configRoles() + "\n" + ROLES;
|
return super.configRoles() + "\n" + ROLES;
|
||||||
|
|
|
@ -32,10 +32,12 @@ import org.elasticsearch.license.plugin.Licensing;
|
||||||
import org.elasticsearch.license.plugin.core.LicenseState;
|
import org.elasticsearch.license.plugin.core.LicenseState;
|
||||||
import org.elasticsearch.license.plugin.core.Licensee;
|
import org.elasticsearch.license.plugin.core.Licensee;
|
||||||
import org.elasticsearch.license.plugin.core.LicenseeRegistry;
|
import org.elasticsearch.license.plugin.core.LicenseeRegistry;
|
||||||
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.rest.RestHandler;
|
import org.elasticsearch.rest.RestHandler;
|
||||||
import org.elasticsearch.rest.RestStatus;
|
import org.elasticsearch.rest.RestStatus;
|
||||||
import org.elasticsearch.test.SecurityIntegTestCase;
|
import org.elasticsearch.test.SecurityIntegTestCase;
|
||||||
import org.elasticsearch.test.SecuritySettingsSource;
|
import org.elasticsearch.test.SecuritySettingsSource;
|
||||||
|
import org.elasticsearch.transport.NettyPlugin;
|
||||||
import org.elasticsearch.transport.Transport;
|
import org.elasticsearch.transport.Transport;
|
||||||
import org.elasticsearch.xpack.XPackPlugin;
|
import org.elasticsearch.xpack.XPackPlugin;
|
||||||
import org.elasticsearch.xpack.security.Security;
|
import org.elasticsearch.xpack.security.Security;
|
||||||
|
@ -115,6 +117,13 @@ public class LicensingTests extends SecurityIntegTestCase {
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
||||||
|
ArrayList<Class<? extends Plugin>> plugins = new ArrayList<>(super.nodePlugins());
|
||||||
|
plugins.add(NettyPlugin.class); // for http
|
||||||
|
return plugins;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Class<? extends XPackPlugin> xpackPluginClass() {
|
protected Class<? extends XPackPlugin> xpackPluginClass() {
|
||||||
return InternalXPackPlugin.class;
|
return InternalXPackPlugin.class;
|
||||||
|
|
|
@ -10,6 +10,7 @@ import org.elasticsearch.common.Strings;
|
||||||
import org.elasticsearch.common.io.PathUtils;
|
import org.elasticsearch.common.io.PathUtils;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.util.concurrent.ThreadContext;
|
import org.elasticsearch.common.util.concurrent.ThreadContext;
|
||||||
|
import org.elasticsearch.transport.NettyPlugin;
|
||||||
import org.elasticsearch.xpack.monitoring.Monitoring;
|
import org.elasticsearch.xpack.monitoring.Monitoring;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.test.ESIntegTestCase.Scope;
|
import org.elasticsearch.test.ESIntegTestCase.Scope;
|
||||||
|
@ -160,12 +161,12 @@ public class SecuritySettingsSource extends ClusterDiscoveryConfiguration.Unicas
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<Class<? extends Plugin>> nodePlugins() {
|
public Collection<Class<? extends Plugin>> nodePlugins() {
|
||||||
return Arrays.asList(xpackPluginClass());
|
return Arrays.asList(xpackPluginClass(), NettyPlugin.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<Class<? extends Plugin>> transportClientPlugins() {
|
public Collection<Class<? extends Plugin>> transportClientPlugins() {
|
||||||
return Collections.<Class<? extends Plugin>>singletonList(xpackPluginClass());
|
return nodePlugins();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String configUsers() {
|
protected String configUsers() {
|
||||||
|
|
|
@ -19,11 +19,13 @@ import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.Priority;
|
import org.elasticsearch.common.Priority;
|
||||||
import org.elasticsearch.common.inject.util.Providers;
|
import org.elasticsearch.common.inject.util.Providers;
|
||||||
import org.elasticsearch.common.network.NetworkAddress;
|
import org.elasticsearch.common.network.NetworkAddress;
|
||||||
|
import org.elasticsearch.common.network.NetworkModule;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.transport.BoundTransportAddress;
|
import org.elasticsearch.common.transport.BoundTransportAddress;
|
||||||
import org.elasticsearch.common.transport.InetSocketTransportAddress;
|
import org.elasticsearch.common.transport.InetSocketTransportAddress;
|
||||||
import org.elasticsearch.common.transport.LocalTransportAddress;
|
import org.elasticsearch.common.transport.LocalTransportAddress;
|
||||||
import org.elasticsearch.common.transport.TransportAddress;
|
import org.elasticsearch.common.transport.TransportAddress;
|
||||||
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.rest.RestRequest;
|
import org.elasticsearch.rest.RestRequest;
|
||||||
import org.elasticsearch.search.SearchHit;
|
import org.elasticsearch.search.SearchHit;
|
||||||
import org.elasticsearch.test.ESIntegTestCase;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
|
@ -32,6 +34,8 @@ import org.elasticsearch.test.SecurityIntegTestCase;
|
||||||
import org.elasticsearch.test.SecuritySettingsSource;
|
import org.elasticsearch.test.SecuritySettingsSource;
|
||||||
import org.elasticsearch.threadpool.TestThreadPool;
|
import org.elasticsearch.threadpool.TestThreadPool;
|
||||||
import org.elasticsearch.threadpool.ThreadPool;
|
import org.elasticsearch.threadpool.ThreadPool;
|
||||||
|
import org.elasticsearch.transport.MockTcpTransport;
|
||||||
|
import org.elasticsearch.transport.MockTcpTransportPlugin;
|
||||||
import org.elasticsearch.transport.Transport;
|
import org.elasticsearch.transport.Transport;
|
||||||
import org.elasticsearch.transport.TransportInfo;
|
import org.elasticsearch.transport.TransportInfo;
|
||||||
import org.elasticsearch.transport.TransportMessage;
|
import org.elasticsearch.transport.TransportMessage;
|
||||||
|
@ -56,7 +60,9 @@ import org.junit.BeforeClass;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -140,11 +146,20 @@ public class IndexAuditTrailTests extends SecurityIntegTestCase {
|
||||||
Settings.Builder builder = Settings.builder()
|
Settings.Builder builder = Settings.builder()
|
||||||
.put(super.nodeSettings(nodeOrdinal))
|
.put(super.nodeSettings(nodeOrdinal))
|
||||||
.put(Security.enabledSetting(), useSecurity);
|
.put(Security.enabledSetting(), useSecurity);
|
||||||
|
if (useSecurity == false && builder.get(NetworkModule.TRANSPORT_TYPE_KEY) == null) {
|
||||||
|
builder.put(NetworkModule.TRANSPORT_TYPE_KEY, MockTcpTransportPlugin.MOCK_TCP_TRANSPORT_NAME);
|
||||||
|
}
|
||||||
return builder.build();
|
return builder.build();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Set<Class<? extends Plugin>> mockPlugins = new HashSet<>(getMockPlugins());
|
||||||
|
if (useSecurity == false) {
|
||||||
|
mockPlugins.add(MockTcpTransportPlugin.class);
|
||||||
|
}
|
||||||
remoteCluster = new InternalTestCluster("network", randomLong(), createTempDir(), false, numNodes, numNodes, cluster2Name,
|
remoteCluster = new InternalTestCluster("network", randomLong(), createTempDir(), false, numNodes, numNodes, cluster2Name,
|
||||||
cluster2SettingsSource, 0, false, SECOND_CLUSTER_NODE_PREFIX, getMockPlugins(),
|
cluster2SettingsSource, 0, false, SECOND_CLUSTER_NODE_PREFIX, mockPlugins,
|
||||||
useSecurity ? getClientWrapper() : Function.identity());
|
useSecurity ? getClientWrapper() : Function.identity());
|
||||||
remoteCluster.beforeTest(random(), 0.5);
|
remoteCluster.beforeTest(random(), 0.5);
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
import org.elasticsearch.common.network.NetworkModule;
|
import org.elasticsearch.common.network.NetworkModule;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
|
import org.elasticsearch.transport.MockTcpTransportPlugin;
|
||||||
import org.elasticsearch.xpack.security.action.SecurityActionMapper;
|
import org.elasticsearch.xpack.security.action.SecurityActionMapper;
|
||||||
import org.elasticsearch.xpack.security.authc.AuthenticationService;
|
import org.elasticsearch.xpack.security.authc.AuthenticationService;
|
||||||
import org.elasticsearch.xpack.security.authz.AuthorizationService;
|
import org.elasticsearch.xpack.security.authz.AuthorizationService;
|
||||||
|
@ -53,13 +54,8 @@ import static org.mockito.Mockito.when;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@ClusterScope(scope = SUITE, numDataNodes = 0)
|
@ClusterScope(scope = SUITE, numDataNodes = 0)
|
||||||
|
@ESIntegTestCase.SuppressLocalMode
|
||||||
public class TransportFilterTests extends ESIntegTestCase {
|
public class TransportFilterTests extends ESIntegTestCase {
|
||||||
@Override
|
|
||||||
protected Settings nodeSettings(int nodeOrdinal) {
|
|
||||||
return Settings.builder()
|
|
||||||
.put("node.mode", "network")
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Collection<Class<? extends Plugin>> getMockPlugins() {
|
protected Collection<Class<? extends Plugin>> getMockPlugins() {
|
||||||
|
@ -68,7 +64,7 @@ public class TransportFilterTests extends ESIntegTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
||||||
return Arrays.asList(InternalPlugin.class, InternalPluginServerTransportService.TestPlugin.class);
|
return Arrays.asList(InternalPlugin.class, InternalPluginServerTransportService.TestPlugin.class, MockTcpTransportPlugin.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -12,6 +12,7 @@ import org.elasticsearch.client.ResponseException;
|
||||||
import org.elasticsearch.common.network.NetworkModule;
|
import org.elasticsearch.common.network.NetworkModule;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.http.HttpServerTransport;
|
import org.elasticsearch.http.HttpServerTransport;
|
||||||
|
import org.elasticsearch.transport.NettyPlugin;
|
||||||
import org.elasticsearch.xpack.monitoring.Monitoring;
|
import org.elasticsearch.xpack.monitoring.Monitoring;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.xpack.security.Security;
|
import org.elasticsearch.xpack.security.Security;
|
||||||
|
@ -22,6 +23,7 @@ import org.elasticsearch.threadpool.ThreadPoolInfo;
|
||||||
import org.elasticsearch.xpack.XPackPlugin;
|
import org.elasticsearch.xpack.XPackPlugin;
|
||||||
import org.elasticsearch.xpack.watcher.execution.InternalWatchExecutor;
|
import org.elasticsearch.xpack.watcher.execution.InternalWatchExecutor;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
||||||
|
@ -50,7 +52,7 @@ public class WatcherPluginDisableTests extends ESIntegTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
||||||
return Collections.<Class<? extends Plugin>>singleton(XPackPlugin.class);
|
return Arrays.asList(XPackPlugin.class, NettyPlugin.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -66,7 +68,6 @@ public class WatcherPluginDisableTests extends ESIntegTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testRestEndpoints() throws Exception {
|
public void testRestEndpoints() throws Exception {
|
||||||
HttpServerTransport httpServerTransport = internalCluster().getDataNodeInstance(HttpServerTransport.class);
|
|
||||||
try {
|
try {
|
||||||
getRestClient().performRequest("GET", "/_xpack/watcher");
|
getRestClient().performRequest("GET", "/_xpack/watcher");
|
||||||
fail("request should have failed");
|
fail("request should have failed");
|
||||||
|
|
|
@ -9,12 +9,16 @@ import org.elasticsearch.action.search.SearchResponse;
|
||||||
import org.elasticsearch.common.network.NetworkModule;
|
import org.elasticsearch.common.network.NetworkModule;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.index.IndexNotFoundException;
|
import org.elasticsearch.index.IndexNotFoundException;
|
||||||
|
import org.elasticsearch.plugins.Plugin;
|
||||||
|
import org.elasticsearch.transport.NettyPlugin;
|
||||||
import org.elasticsearch.xpack.watcher.input.http.HttpInput;
|
import org.elasticsearch.xpack.watcher.input.http.HttpInput;
|
||||||
import org.elasticsearch.xpack.common.http.HttpRequestTemplate;
|
import org.elasticsearch.xpack.common.http.HttpRequestTemplate;
|
||||||
import org.elasticsearch.xpack.common.http.auth.basic.BasicAuth;
|
import org.elasticsearch.xpack.common.http.auth.basic.BasicAuth;
|
||||||
import org.elasticsearch.xpack.watcher.test.AbstractWatcherIntegrationTestCase;
|
import org.elasticsearch.xpack.watcher.test.AbstractWatcherIntegrationTestCase;
|
||||||
|
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE;
|
import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE;
|
||||||
|
@ -40,6 +44,13 @@ public class ChainIntegrationTests extends AbstractWatcherIntegrationTestCase {
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
||||||
|
ArrayList<Class<? extends Plugin>> plugins = new ArrayList<>(super.nodePlugins());
|
||||||
|
plugins.add(NettyPlugin.class); // for http
|
||||||
|
return plugins;
|
||||||
|
}
|
||||||
|
|
||||||
public void testChainedInputsAreWorking() throws Exception {
|
public void testChainedInputsAreWorking() throws Exception {
|
||||||
String index = "the-most-awesome-index-ever";
|
String index = "the-most-awesome-index-ever";
|
||||||
createIndex(index);
|
createIndex(index);
|
||||||
|
|
|
@ -10,7 +10,9 @@ import org.elasticsearch.action.support.IndicesOptions;
|
||||||
import org.elasticsearch.common.network.NetworkModule;
|
import org.elasticsearch.common.network.NetworkModule;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.test.junit.annotations.TestLogging;
|
import org.elasticsearch.test.junit.annotations.TestLogging;
|
||||||
|
import org.elasticsearch.transport.NettyPlugin;
|
||||||
import org.elasticsearch.xpack.watcher.client.WatcherClient;
|
import org.elasticsearch.xpack.watcher.client.WatcherClient;
|
||||||
import org.elasticsearch.xpack.watcher.condition.compare.CompareCondition;
|
import org.elasticsearch.xpack.watcher.condition.compare.CompareCondition;
|
||||||
import org.elasticsearch.xpack.watcher.history.HistoryStore;
|
import org.elasticsearch.xpack.watcher.history.HistoryStore;
|
||||||
|
@ -23,6 +25,8 @@ import org.elasticsearch.xpack.watcher.transport.actions.put.PutWatchResponse;
|
||||||
import org.elasticsearch.xpack.watcher.trigger.schedule.IntervalSchedule;
|
import org.elasticsearch.xpack.watcher.trigger.schedule.IntervalSchedule;
|
||||||
|
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE;
|
import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE;
|
||||||
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
|
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
|
||||||
|
@ -47,6 +51,13 @@ public class HttpInputIntegrationTests extends AbstractWatcherIntegrationTestCas
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
||||||
|
ArrayList<Class<? extends Plugin>> plugins = new ArrayList<>(super.nodePlugins());
|
||||||
|
plugins.add(NettyPlugin.class); // for http
|
||||||
|
return plugins;
|
||||||
|
}
|
||||||
|
|
||||||
@TestLogging("watcher.support.http:TRACE")
|
@TestLogging("watcher.support.http:TRACE")
|
||||||
public void testHttpInput() throws Exception {
|
public void testHttpInput() throws Exception {
|
||||||
createIndex("index");
|
createIndex("index");
|
||||||
|
|
|
@ -14,12 +14,16 @@ import org.elasticsearch.common.network.NetworkModule;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.xcontent.json.JsonXContent;
|
import org.elasticsearch.common.xcontent.json.JsonXContent;
|
||||||
import org.elasticsearch.common.xcontent.support.XContentMapValues;
|
import org.elasticsearch.common.xcontent.support.XContentMapValues;
|
||||||
|
import org.elasticsearch.plugins.Plugin;
|
||||||
|
import org.elasticsearch.transport.NettyPlugin;
|
||||||
import org.elasticsearch.xpack.monitoring.test.MonitoringIntegTestCase;
|
import org.elasticsearch.xpack.monitoring.test.MonitoringIntegTestCase;
|
||||||
import org.elasticsearch.xpack.security.authc.support.SecuredString;
|
import org.elasticsearch.xpack.security.authc.support.SecuredString;
|
||||||
import org.elasticsearch.xpack.watcher.test.AbstractWatcherIntegrationTestCase;
|
import org.elasticsearch.xpack.watcher.test.AbstractWatcherIntegrationTestCase;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -48,6 +52,13 @@ public class WatcherSettingsFilterTests extends AbstractWatcherIntegrationTestCa
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
||||||
|
ArrayList<Class<? extends Plugin>> plugins = new ArrayList<>(super.nodePlugins());
|
||||||
|
plugins.add(NettyPlugin.class); // for http
|
||||||
|
return plugins;
|
||||||
|
}
|
||||||
|
|
||||||
public void testGetSettingsSmtpPassword() throws Exception {
|
public void testGetSettingsSmtpPassword() throws Exception {
|
||||||
Header[] headers;
|
Header[] headers;
|
||||||
if (securityEnabled()) {
|
if (securityEnabled()) {
|
||||||
|
|
Loading…
Reference in New Issue