From a30c6c2780c9666b86159a17545e7e0e008ac569 Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Wed, 20 Jan 2016 09:21:05 +0100 Subject: [PATCH 1/8] Add generic type and suppress warnings to test Original commit: elastic/x-pack-elasticsearch@b454af89bd9b7e71ee09c588eeef7cea7bc40b1c --- .../org/elasticsearch/messy/tests/SearchInputTests.java | 1 + .../org/elasticsearch/messy/tests/SearchTransformTests.java | 1 + .../elasticsearch/watcher/support/text/TextTemplate.java | 6 +++--- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/SearchInputTests.java b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/SearchInputTests.java index c74b451a02b..ab36b54b372 100644 --- a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/SearchInputTests.java +++ b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/SearchInputTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.messy.tests; import org.elasticsearch.action.indexedscripts.put.PutIndexedScriptRequest; import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchType; +import org.elasticsearch.common.collect.HppcMaps; import org.elasticsearch.common.io.Streams; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; diff --git a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/SearchTransformTests.java b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/SearchTransformTests.java index 812a9e5c801..89410804e58 100644 --- a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/SearchTransformTests.java +++ b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/SearchTransformTests.java @@ -176,6 +176,7 @@ public class SearchTransformTests extends ESIntegTestCase { assertThat(resultData, equalTo(expectedData)); } + @SuppressWarnings("unchecked") public void testExecuteFailure() throws Exception { index("idx", "type", "1"); ensureGreen("idx"); diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/watcher/support/text/TextTemplate.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/watcher/support/text/TextTemplate.java index b65aaad1269..5a5e1b6653e 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/watcher/support/text/TextTemplate.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/watcher/support/text/TextTemplate.java @@ -170,15 +170,15 @@ public class TextTemplate implements ToXContent { return new Builder.Inline(template.bytes().toUtf8()).contentType(template.contentType()); } - public static Builder inline(String text) { + public static Builder inline(String text) { return new Builder.Inline(text); } - public static Builder file(String file) { + public static Builder file(String file) { return new Builder.File(file); } - public static Builder indexed(String id) { + public static Builder indexed(String id) { return new Builder.Indexed(id); } From 01bc1f4124607a173c4ec47abd6fe8db2144a209 Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Wed, 20 Jan 2016 09:39:37 +0100 Subject: [PATCH 2/8] Pass identity function as a client wrapper #Relates to elastic/elasticsearchelastic/elasticsearch#16101 Original commit: elastic/x-pack-elasticsearch@5eff4b440bfe7c3ea0c1526eec97ac19b310612d --- .../elasticsearch/shield/audit/index/IndexAuditTrailTests.java | 3 ++- .../shield/audit/index/RemoteIndexAuditTrailStartingTests.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/audit/index/IndexAuditTrailTests.java b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/audit/index/IndexAuditTrailTests.java index 4347ee61656..1a19ed419eb 100644 --- a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/audit/index/IndexAuditTrailTests.java +++ b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/audit/index/IndexAuditTrailTests.java @@ -53,6 +53,7 @@ import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Set; +import java.util.function.Function; import static org.elasticsearch.shield.audit.index.IndexNameResolver.Rollover.DAILY; import static org.elasticsearch.shield.audit.index.IndexNameResolver.Rollover.HOURLY; @@ -172,7 +173,7 @@ public class IndexAuditTrailTests extends ShieldIntegTestCase { return builder.build(); } }; - cluster2 = new InternalTestCluster("network", randomLong(), createTempDir(), numNodes, numNodes, cluster2Name, cluster2SettingsSource, 0, false, SECOND_CLUSTER_NODE_PREFIX, getMockPlugins()); + cluster2 = new InternalTestCluster("network", randomLong(), createTempDir(), numNodes, numNodes, cluster2Name, cluster2SettingsSource, 0, false, SECOND_CLUSTER_NODE_PREFIX, getMockPlugins(), Function.identity()); cluster2.beforeTest(getRandom(), 0.5); remoteClient = cluster2.client(); diff --git a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/audit/index/RemoteIndexAuditTrailStartingTests.java b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/audit/index/RemoteIndexAuditTrailStartingTests.java index dd83018bcd6..d6a9d31db2a 100644 --- a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/audit/index/RemoteIndexAuditTrailStartingTests.java +++ b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/audit/index/RemoteIndexAuditTrailStartingTests.java @@ -24,6 +24,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.TimeUnit; +import java.util.function.Function; import static org.elasticsearch.test.InternalTestCluster.clusterName; import static org.hamcrest.Matchers.is; @@ -106,7 +107,7 @@ public class RemoteIndexAuditTrailStartingTests extends ShieldIntegTestCase { return builder.build(); } }; - remoteCluster = new InternalTestCluster("network", randomLong(), createTempDir(), numNodes, numNodes, cluster2Name, cluster2SettingsSource, 0, false, SECOND_CLUSTER_NODE_PREFIX, getMockPlugins()); + remoteCluster = new InternalTestCluster("network", randomLong(), createTempDir(), numNodes, numNodes, cluster2Name, cluster2SettingsSource, 0, false, SECOND_CLUSTER_NODE_PREFIX, getMockPlugins(), Function.identity()); remoteCluster.beforeTest(getRandom(), 0.5); } From d4afcf4e4e579cbd3d687a5623994d270e77c4c6 Mon Sep 17 00:00:00 2001 From: Tanguy Leroux Date: Mon, 18 Jan 2016 15:01:35 +0100 Subject: [PATCH 3/8] Marvel: Fix CleanerServiceTests when setting is equal to 0 closes elastic/elasticsearch#1319 Original commit: elastic/x-pack-elasticsearch@2dd8d61376227e2389e1c886806555e14f5db262 --- .../marvel/cleaner/CleanerServiceTests.java | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/cleaner/CleanerServiceTests.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/cleaner/CleanerServiceTests.java index cbe4899dc54..476d7ab438e 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/cleaner/CleanerServiceTests.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/cleaner/CleanerServiceTests.java @@ -52,12 +52,14 @@ public class CleanerServiceTests extends ESTestCase { } public void testRetentionUpdateAllowed() { - TimeValue randomRetention = TimeValue.parseTimeValue(randomTimeValue(), null, ""); - MarvelLicensee licensee = mock(MarvelLicensee.class); when(licensee.allowUpdateRetention()).thenReturn(true); CleanerService service = new CleanerService(Settings.EMPTY, clusterSettings, threadPool, licensee); + service.setRetention(TimeValue.parseTimeValue("-1", null, "")); + assertThat(service.getRetention().getMillis(), equalTo(-1L)); + + TimeValue randomRetention = TimeValue.parseTimeValue(randomIntBetween(1, 1000) + "ms", null, ""); service.setRetention(randomRetention); assertThat(service.getRetention(), equalTo(randomRetention)); @@ -69,14 +71,27 @@ public class CleanerServiceTests extends ESTestCase { } public void testRetentionUpdateBlocked() { - TimeValue randomRetention = TimeValue.parseTimeValue(randomTimeValue(), null, ""); - MarvelLicensee licensee = mock(MarvelLicensee.class); - when(licensee.allowUpdateRetention()).thenReturn(false); - + when(licensee.allowUpdateRetention()).thenReturn(true); CleanerService service = new CleanerService(Settings.EMPTY, clusterSettings, threadPool, licensee); + try { + service.setRetention(TimeValue.parseTimeValue("-5000ms", null, "")); + fail("exception should have been thrown: negative retention are not allowed"); + } catch (IllegalArgumentException e) { + assertThat(e.getMessage(), containsString("invalid history duration setting value")); + } + try { + service.setRetention(null); + fail("exception should have been thrown: null retention is not allowed"); + } catch (IllegalArgumentException e) { + assertThat(e.getMessage(), containsString("history duration setting cannot be null")); + } + + TimeValue randomRetention = TimeValue.parseTimeValue(randomIntBetween(1, 1000) + "ms", null, ""); + when(licensee.allowUpdateRetention()).thenReturn(false); try { service.setRetention(randomRetention); + fail("exception should have been thrown"); } catch (IllegalArgumentException e) { assertThat(e.getMessage(), containsString("license does not allow the history duration setting to be updated to value")); assertNull(service.getRetention()); From e6832e5881238cc0e65e6c71a08be54bdedb2610 Mon Sep 17 00:00:00 2001 From: Tanguy Leroux Date: Tue, 1 Dec 2015 16:01:01 +0100 Subject: [PATCH 4/8] Marvel: Fix MultiNodesStatsTests Closes elastic/elasticsearch#960 Original commit: elastic/x-pack-elasticsearch@969f22fcf7a1438045512329634d9fc4f9b005bb --- .../renderer/node/MultiNodesStatsTests.java | 73 ++++++++++++------- 1 file changed, 46 insertions(+), 27 deletions(-) diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/node/MultiNodesStatsTests.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/node/MultiNodesStatsTests.java index 1c105fffd33..495b60eade8 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/node/MultiNodesStatsTests.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/node/MultiNodesStatsTests.java @@ -5,23 +5,27 @@ */ package org.elasticsearch.marvel.agent.renderer.node; -import org.apache.lucene.util.LuceneTestCase; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.marvel.agent.collector.node.NodeStatsCollector; import org.elasticsearch.marvel.agent.settings.MarvelSettings; import org.elasticsearch.marvel.test.MarvelIntegTestCase; +import org.elasticsearch.search.aggregations.Aggregation; +import org.elasticsearch.search.aggregations.AggregationBuilders; +import org.elasticsearch.search.aggregations.bucket.terms.StringTerms; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.test.ESIntegTestCase.Scope; +import org.elasticsearch.test.InternalTestCluster; import org.junit.After; +import java.util.List; import java.util.concurrent.TimeUnit; +import static org.elasticsearch.common.settings.Settings.settingsBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoTimeout; -import static org.hamcrest.Matchers.greaterThan; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.instanceOf; -@LuceneTestCase.AwaitsFix(bugUrl = "https://github.com/elastic/x-plugins/issues/960") @ClusterScope(scope = Scope.TEST, numDataNodes = 0, numClientNodes = 0, transportClientRatio = 0.0) public class MultiNodesStatsTests extends MarvelIntegTestCase { @@ -41,30 +45,38 @@ public class MultiNodesStatsTests extends MarvelIntegTestCase { } public void testMultipleNodes() throws Exception { - logger.debug("--> starting a master only node"); - internalCluster().startMasterOnlyNodeAsync(); + int nodes = 0; - logger.debug("--> starting a data only node"); - internalCluster().startDataOnlyNodeAsync(); + int n = randomIntBetween(1, 2); + logger.debug("--> starting {} master only nodes", n); + InternalTestCluster.Async> masterNodes = internalCluster().startMasterOnlyNodesAsync(n); + masterNodes.get(); + nodes += n; - logger.debug("--> starting a client node"); - internalCluster().startNodeClient(Settings.EMPTY); + n = randomIntBetween(2, 3); + logger.debug("--> starting {} data only nodes", n); + InternalTestCluster.Async> dataNodes = internalCluster().startDataOnlyNodesAsync(n); + dataNodes.get(); + nodes += n; - logger.debug("--> starting few other nodes"); - int extraNodes = randomIntBetween(2, 5); - for (int i = 0; i < extraNodes; i++) { - if (randomBoolean()) { - internalCluster().startNodeAsync(); - } else { - internalCluster().startNodeClient(Settings.EMPTY); - } - } + n = randomIntBetween(1, 2); + logger.debug("--> starting {} client only nodes", n); + InternalTestCluster.Async> clientNodes = internalCluster().startNodesAsync(n, settingsBuilder().put("node.client", true).build()); + clientNodes.get(); + nodes += n; - final int nbNodes = 3 + extraNodes; + n = randomIntBetween(1, 2); + logger.debug("--> starting {} extra nodes", n); + InternalTestCluster.Async> extraNodes = internalCluster().startNodesAsync(n); + extraNodes.get(); + nodes += n; + + final int nbNodes = nodes; logger.debug("--> waiting for {} nodes to be available", nbNodes); assertBusy(new Runnable() { @Override public void run() { + assertThat(cluster().size(), equalTo(nbNodes)); assertNoTimeout(client().admin().cluster().prepareHealth().setWaitForNodes(Integer.toString(nbNodes)).get()); } }); @@ -77,15 +89,22 @@ public class MultiNodesStatsTests extends MarvelIntegTestCase { public void run() { securedFlush(); - for (String nodeName : internalCluster().getNodeNames()) { - SearchResponse response = client(nodeName).prepareSearch() - .setTypes(NodeStatsCollector.TYPE) - .setQuery(QueryBuilders.termQuery("node_stats.node_id", internalCluster().clusterService(nodeName).localNode().getId())) - .get(); - assertThat(response.getHits().getTotalHits(), greaterThan(0L)); + SearchResponse response = client().prepareSearch() + .setTypes(NodeStatsCollector.TYPE) + .setSize(0) + .addAggregation(AggregationBuilders.terms("nodes_ids").field("node_stats.node_id")) + .get(); + + for (Aggregation aggregation : response.getAggregations()) { + assertThat(aggregation, instanceOf(StringTerms.class)); + assertThat(((StringTerms) aggregation).getBuckets().size(), equalTo(nbNodes)); + + for (String nodeName : internalCluster().getNodeNames()) { + StringTerms.Bucket bucket = (StringTerms.Bucket) ((StringTerms) aggregation).getBucketByKey(internalCluster().clusterService(nodeName).localNode().getId()); + assertThat(bucket.getDocCount(), equalTo(1L)); + } } } }); } - } From 617c51cc86adf6c91fb89a35ca95c0a89fb6275e Mon Sep 17 00:00:00 2001 From: uboness Date: Thu, 21 Jan 2016 11:50:53 +0100 Subject: [PATCH 5/8] fix build (settings cannot be prefixed with `.`) Original commit: elastic/x-pack-elasticsearch@62178e1e823178e564e636c81b67e20b6d062315 --- .../AbstractLicensesConsumerPluginIntegrationTestCase.java | 2 +- .../license/plugin/LicensesPluginIntegrationTests.java | 2 +- .../license/plugin/LicensesPluginsIntegrationTests.java | 2 +- .../license/plugin/LicensesServiceClusterTests.java | 4 ++-- .../license/plugin/consumer/TestPluginServiceBase.java | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/AbstractLicensesConsumerPluginIntegrationTestCase.java b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/AbstractLicensesConsumerPluginIntegrationTestCase.java index 3484a9c41a8..d4be42a94e3 100644 --- a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/AbstractLicensesConsumerPluginIntegrationTestCase.java +++ b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/AbstractLicensesConsumerPluginIntegrationTestCase.java @@ -44,7 +44,7 @@ public abstract class AbstractLicensesConsumerPluginIntegrationTestCase extends return Settings.settingsBuilder() .put(super.nodeSettings(nodeOrdinal)) // this setting is only used in tests - .put(".trial_license_duration_in_seconds", trialLicenseDurationInSeconds) + .put("_trial_license_duration_in_seconds", trialLicenseDurationInSeconds) .build(); } diff --git a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/LicensesPluginIntegrationTests.java b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/LicensesPluginIntegrationTests.java index e8275719ae5..d7b809a4d6e 100644 --- a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/LicensesPluginIntegrationTests.java +++ b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/LicensesPluginIntegrationTests.java @@ -37,7 +37,7 @@ public class LicensesPluginIntegrationTests extends AbstractLicensesIntegrationT return Settings.settingsBuilder() .put(super.nodeSettings(nodeOrdinal)) // this setting is only used in tests - .put(".trial_license_duration_in_seconds", trialLicenseDurationInSeconds) + .put("_trial_license_duration_in_seconds", trialLicenseDurationInSeconds) .build(); } diff --git a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/LicensesPluginsIntegrationTests.java b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/LicensesPluginsIntegrationTests.java index ec293da26d6..d94ac80639b 100644 --- a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/LicensesPluginsIntegrationTests.java +++ b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/LicensesPluginsIntegrationTests.java @@ -42,7 +42,7 @@ public class LicensesPluginsIntegrationTests extends AbstractLicensesIntegration return Settings.settingsBuilder() .put(super.nodeSettings(0)) // this setting is only used in tests - .put(".trial_license_duration_in_seconds", trialLicenseDuration) + .put("_trial_license_duration_in_seconds", trialLicenseDuration) .build(); } diff --git a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/LicensesServiceClusterTests.java b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/LicensesServiceClusterTests.java index 8e4fa71821e..59e6bc954f0 100644 --- a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/LicensesServiceClusterTests.java +++ b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/LicensesServiceClusterTests.java @@ -61,9 +61,9 @@ public class LicensesServiceClusterTests extends AbstractLicensesIntegrationTest .put("node.data", true) .put("format", "json") // this setting is only used in tests - .put(".trial_license_duration_in_seconds", 9) + .put("_trial_license_duration_in_seconds", 9) // this setting is only used in tests - .put(".grace_duration_in_seconds", 9) + .put("_grace_duration_in_seconds", 9) .put(Node.HTTP_ENABLED, true); } diff --git a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/consumer/TestPluginServiceBase.java b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/consumer/TestPluginServiceBase.java index d099e1b4b30..6df7b531eae 100644 --- a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/consumer/TestPluginServiceBase.java +++ b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/consumer/TestPluginServiceBase.java @@ -33,11 +33,11 @@ public abstract class TestPluginServiceBase extends AbstractLifecycleComponent Date: Fri, 22 Jan 2016 14:33:55 +0100 Subject: [PATCH 6/8] [TEST] the jvm flag is not returned anymore as site plugins support has been removed Original commit: elastic/x-pack-elasticsearch@f02a42aed636c71d34f76fa4fcabc1cf2d5c5716 --- .../src/test/resources/rest-api-spec/test/xpack/10_basic.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/elasticsearch/x-pack/src/test/resources/rest-api-spec/test/xpack/10_basic.yaml b/elasticsearch/x-pack/src/test/resources/rest-api-spec/test/xpack/10_basic.yaml index c7cfc4326f0..0a63d701d09 100644 --- a/elasticsearch/x-pack/src/test/resources/rest-api-spec/test/xpack/10_basic.yaml +++ b/elasticsearch/x-pack/src/test/resources/rest-api-spec/test/xpack/10_basic.yaml @@ -11,4 +11,3 @@ nodes.info: {} - match: { nodes.$master.plugins.0.name: x-pack } - - match: { nodes.$master.plugins.0.jvm: true } From 03944c9a95685eb8dac936276aed9c1c2c0c5626 Mon Sep 17 00:00:00 2001 From: markharwood Date: Fri, 22 Jan 2016 13:20:11 +0000 Subject: [PATCH 7/8] Settings - change over to o.e.common.settings.Setting for http.enabled setting Original commit: elastic/x-pack-elasticsearch@3b551a6fb6cafec29406334356cb076c93938c9b --- .../license/plugin/LicensesServiceClusterTests.java | 3 ++- .../license/plugin/LicensesServiceNodeTests.java | 3 ++- .../marvel/agent/collector/AbstractCollectorTestCase.java | 2 +- .../marvel/agent/settings/MarvelSettingsTests.java | 3 ++- .../org/elasticsearch/marvel/shield/SecuredClientTests.java | 3 ++- .../java/org/elasticsearch/integration/BulkUpdateTests.java | 3 ++- .../org/elasticsearch/integration/ClearRealmsCacheTests.java | 3 ++- .../org/elasticsearch/integration/ClearRolesCacheTests.java | 3 ++- .../org/elasticsearch/integration/ClusterPrivilegeTests.java | 3 ++- .../org/elasticsearch/integration/IndexPrivilegeTests.java | 3 ++- .../java/org/elasticsearch/integration/LicensingTests.java | 2 +- .../org/elasticsearch/integration/SettingsFilterTests.java | 3 ++- .../shield/ShieldPluginEnabledDisabledTests.java | 3 ++- .../org/elasticsearch/shield/authc/AnonymousUserTests.java | 3 ++- .../java/org/elasticsearch/shield/authc/RunAsIntegTests.java | 3 ++- .../shield/authc/pki/PkiAuthenticationTests.java | 3 ++- .../shield/authc/pki/PkiOptionalClientAuthTests.java | 3 ++- .../authc/pki/PkiWithoutClientAuthenticationTests.java | 3 ++- .../elasticsearch/shield/authc/pki/PkiWithoutSSLTests.java | 3 ++- .../shield/rest/action/RestAuthenticateActionTests.java | 3 ++- .../transport/ServerTransportFilterIntegrationTests.java | 5 +++-- .../shield/transport/filter/IpFilteringIntegrationTests.java | 3 ++- .../shield/transport/filter/IpFilteringUpdateTests.java | 3 ++- .../shield/transport/ssl/SslClientAuthTests.java | 3 ++- .../shield/transport/ssl/SslIntegrationTests.java | 3 ++- .../org/elasticsearch/watcher/WatcherPluginDisableTests.java | 3 ++- .../watcher/input/chain/ChainIntegrationTests.java | 3 ++- .../watcher/input/http/HttpInputIntegrationTests.java | 3 ++- .../watcher/test/integration/WatcherSettingsFilterTests.java | 3 ++- 29 files changed, 57 insertions(+), 30 deletions(-) diff --git a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/LicensesServiceClusterTests.java b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/LicensesServiceClusterTests.java index 59e6bc954f0..a034f4544e7 100644 --- a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/LicensesServiceClusterTests.java +++ b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/LicensesServiceClusterTests.java @@ -6,6 +6,7 @@ package org.elasticsearch.license.plugin; import org.elasticsearch.client.ClusterAdminClient; +import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.license.core.License; @@ -64,7 +65,7 @@ public class LicensesServiceClusterTests extends AbstractLicensesIntegrationTest .put("_trial_license_duration_in_seconds", 9) // this setting is only used in tests .put("_grace_duration_in_seconds", 9) - .put(Node.HTTP_ENABLED, true); + .put(NetworkModule.HTTP_ENABLED.getKey(), true); } @Override diff --git a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/LicensesServiceNodeTests.java b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/LicensesServiceNodeTests.java index 1ad36215294..cda3e0d6798 100644 --- a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/LicensesServiceNodeTests.java +++ b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/LicensesServiceNodeTests.java @@ -5,6 +5,7 @@ */ package org.elasticsearch.license.plugin; +import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.license.plugin.consumer.EagerLicenseRegistrationConsumerPlugin; import org.elasticsearch.license.plugin.consumer.EagerLicenseRegistrationPluginService; @@ -27,7 +28,7 @@ public class LicensesServiceNodeTests extends AbstractLicensesIntegrationTestCas protected Settings nodeSettings(int nodeOrdinal) { return Settings.settingsBuilder() .put(super.nodeSettings(nodeOrdinal)) - .put(Node.HTTP_ENABLED, true) + .put(NetworkModule.HTTP_ENABLED.getKey(), true) .build(); } diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/AbstractCollectorTestCase.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/AbstractCollectorTestCase.java index 5c2ed9f650e..b8447d72791 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/AbstractCollectorTestCase.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/AbstractCollectorTestCase.java @@ -54,7 +54,7 @@ public class AbstractCollectorTestCase extends MarvelIntegTestCase { protected Settings nodeSettings(int nodeOrdinal) { return Settings.builder() .put(super.nodeSettings(nodeOrdinal)) - .put(Node.HTTP_ENABLED, false) + .put(NetworkModule.HTTP_ENABLED.getKey(), false) .put(MarvelSettings.INTERVAL_SETTING.getKey(), "-1") .build(); } diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/settings/MarvelSettingsTests.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/settings/MarvelSettingsTests.java index cdf2d2ef58a..baf26439536 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/settings/MarvelSettingsTests.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/settings/MarvelSettingsTests.java @@ -6,6 +6,7 @@ package org.elasticsearch.marvel.agent.settings; import org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsRequestBuilder; +import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; @@ -38,7 +39,7 @@ public class MarvelSettingsTests extends MarvelIntegTestCase { protected Settings nodeSettings(int nodeOrdinal) { return Settings.builder() .put(super.nodeSettings(nodeOrdinal)) - .put(Node.HTTP_ENABLED, false) + .put(NetworkModule.HTTP_ENABLED.getKey(), false) .put(marvelSettings()) .build(); } diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/shield/SecuredClientTests.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/shield/SecuredClientTests.java index 7a81e611d16..422c36e4532 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/shield/SecuredClientTests.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/shield/SecuredClientTests.java @@ -7,6 +7,7 @@ package org.elasticsearch.marvel.shield; import org.elasticsearch.ElasticsearchSecurityException; import org.elasticsearch.action.ActionRequestBuilder; +import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.marvel.agent.exporter.MarvelTemplateUtils; @@ -24,7 +25,7 @@ public class SecuredClientTests extends MarvelIntegTestCase { protected Settings nodeSettings(int nodeOrdinal) { return Settings.builder() .put(super.nodeSettings(nodeOrdinal)) - .put(Node.HTTP_ENABLED, false) + .put(NetworkModule.HTTP_ENABLED.getKey(), false) .put(MarvelSettings.INTERVAL_SETTING.getKey(), "-1") .build(); } diff --git a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/BulkUpdateTests.java b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/BulkUpdateTests.java index 56ed9be41ff..718ebe924c3 100644 --- a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/BulkUpdateTests.java +++ b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/BulkUpdateTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.integration; import org.elasticsearch.action.bulk.BulkResponse; import org.elasticsearch.action.get.GetResponse; import org.elasticsearch.action.update.UpdateResponse; +import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.node.Node; import org.elasticsearch.shield.ShieldPlugin; @@ -29,7 +30,7 @@ public class BulkUpdateTests extends ShieldIntegTestCase { public Settings nodeSettings(int nodeOrdinal) { return Settings.builder() .put(super.nodeSettings(nodeOrdinal)) - .put(Node.HTTP_ENABLED, true) + .put(NetworkModule.HTTP_ENABLED.getKey(), true) .put(ShieldPlugin.DLS_FLS_ENABLED_SETTING, randomBoolean()) .build(); } diff --git a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/ClearRealmsCacheTests.java b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/ClearRealmsCacheTests.java index 215ac12c99d..c4095bf7489 100644 --- a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/ClearRealmsCacheTests.java +++ b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/ClearRealmsCacheTests.java @@ -9,6 +9,7 @@ import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.elasticsearch.action.ActionListener; import org.elasticsearch.common.Strings; +import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.http.HttpServerTransport; import org.elasticsearch.node.Node; @@ -188,7 +189,7 @@ public class ClearRealmsCacheTests extends ShieldIntegTestCase { public Settings nodeSettings(int nodeOrdinal) { return Settings.builder() .put(super.nodeSettings(nodeOrdinal)) - .put(Node.HTTP_ENABLED, true) + .put(NetworkModule.HTTP_ENABLED.getKey(), true) .build(); } @Override diff --git a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/ClearRolesCacheTests.java b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/ClearRolesCacheTests.java index 2320acaf2dd..9e07441ceac 100644 --- a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/ClearRolesCacheTests.java +++ b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/ClearRolesCacheTests.java @@ -9,6 +9,7 @@ import org.elasticsearch.action.delete.DeleteResponse; import org.elasticsearch.action.update.UpdateResponse; import org.elasticsearch.client.Client; import org.elasticsearch.common.Strings; +import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.node.Node; @@ -101,7 +102,7 @@ public class ClearRolesCacheTests extends ShieldIntegTestCase { return Settings.builder() .put(super.nodeSettings(nodeOrdinal)) .put("shield.authc.native.reload.interval", TimeValue.timeValueSeconds(2L)) - .put(Node.HTTP_ENABLED, true) + .put(NetworkModule.HTTP_ENABLED.getKey(), true) .build(); } diff --git a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/ClusterPrivilegeTests.java b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/ClusterPrivilegeTests.java index b3d08c9d5c5..8682093c0b9 100644 --- a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/ClusterPrivilegeTests.java +++ b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/ClusterPrivilegeTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.integration; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.action.admin.cluster.snapshots.status.SnapshotsStatusResponse; import org.elasticsearch.cluster.SnapshotsInProgress; +import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.node.Node; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; @@ -61,7 +62,7 @@ public class ClusterPrivilegeTests extends AbstractPrivilegeTestCase { @Override protected Settings nodeSettings(int nodeOrdinal) { return Settings.builder().put(super.nodeSettings(nodeOrdinal)) - .put(Node.HTTP_ENABLED, true) + .put(NetworkModule.HTTP_ENABLED.getKey(), true) .put("action.disable_shutdown", true) .put("path.repo", repositoryLocation) .build(); diff --git a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/IndexPrivilegeTests.java b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/IndexPrivilegeTests.java index 6be87088adf..5957cfeeed9 100644 --- a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/IndexPrivilegeTests.java +++ b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/IndexPrivilegeTests.java @@ -6,6 +6,7 @@ package org.elasticsearch.integration; import org.apache.lucene.util.LuceneTestCase.BadApple; +import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.node.Node; import org.elasticsearch.test.rest.client.http.HttpResponse; @@ -118,7 +119,7 @@ public class IndexPrivilegeTests extends AbstractPrivilegeTestCase { @Override protected Settings nodeSettings(int nodeOrdinal) { return Settings.builder().put(super.nodeSettings(nodeOrdinal)) - .put(Node.HTTP_ENABLED, true) + .put(NetworkModule.HTTP_ENABLED.getKey(), true) .put("action.disable_shutdown", true) .build(); } diff --git a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/LicensingTests.java b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/LicensingTests.java index 6d3ac12998b..99ed4b94a2c 100644 --- a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/LicensingTests.java +++ b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/LicensingTests.java @@ -100,7 +100,7 @@ public class LicensingTests extends ShieldIntegTestCase { @Override public Settings nodeSettings(int nodeOrdinal) { return Settings.builder().put(super.nodeSettings(nodeOrdinal)) - .put(Node.HTTP_ENABLED, true) + .put(NetworkModule.HTTP_ENABLED.getKey(), true) .build(); } diff --git a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/SettingsFilterTests.java b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/SettingsFilterTests.java index 5da941e89c3..fe69177d498 100644 --- a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/SettingsFilterTests.java +++ b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/integration/SettingsFilterTests.java @@ -7,6 +7,7 @@ package org.elasticsearch.integration; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; +import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; @@ -48,7 +49,7 @@ public class SettingsFilterTests extends ShieldIntegTestCase { protected Settings nodeSettings(int nodeOrdinal) { int clientProfilePort = randomIntBetween(49000, 65400); return Settings.builder().put(super.nodeSettings(nodeOrdinal)) - .put(Node.HTTP_ENABLED, true) + .put(NetworkModule.HTTP_ENABLED.getKey(), true) .put("shield.authc.realms.esusers.type", "esusers") diff --git a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/ShieldPluginEnabledDisabledTests.java b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/ShieldPluginEnabledDisabledTests.java index b1881de5241..2175b726086 100644 --- a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/ShieldPluginEnabledDisabledTests.java +++ b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/ShieldPluginEnabledDisabledTests.java @@ -7,6 +7,7 @@ package org.elasticsearch.shield; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; +import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.http.HttpServerTransport; import org.elasticsearch.integration.LicensingTests; @@ -67,7 +68,7 @@ public class ShieldPluginEnabledDisabledTests extends ShieldIntegTestCase { return Settings.settingsBuilder() .put(super.nodeSettings(nodeOrdinal)) .put(ShieldPlugin.ENABLED_SETTING_NAME, enabled) - .put(Node.HTTP_ENABLED, true) + .put(NetworkModule.HTTP_ENABLED.getKey(), true) .build(); } diff --git a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/authc/AnonymousUserTests.java b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/authc/AnonymousUserTests.java index 906db24abb0..714c43f96e9 100644 --- a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/authc/AnonymousUserTests.java +++ b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/authc/AnonymousUserTests.java @@ -10,6 +10,7 @@ import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.elasticsearch.common.io.Streams; +import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.InetSocketTransportAddress; import org.elasticsearch.common.transport.TransportAddress; @@ -34,7 +35,7 @@ public class AnonymousUserTests extends ShieldIntegTestCase { public Settings nodeSettings(int nodeOrdinal) { return Settings.builder() .put(super.nodeSettings(nodeOrdinal)) - .put(Node.HTTP_ENABLED, true) + .put(NetworkModule.HTTP_ENABLED.getKey(), true) .put("shield.authc.anonymous.roles", "anonymous") .put(AnonymousService.SETTING_AUTHORIZATION_EXCEPTION_ENABLED, authorizationExceptionsEnabled) .build(); diff --git a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/authc/RunAsIntegTests.java b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/authc/RunAsIntegTests.java index fa7f7b252e8..3e618da0099 100644 --- a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/authc/RunAsIntegTests.java +++ b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/authc/RunAsIntegTests.java @@ -10,6 +10,7 @@ import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; import org.elasticsearch.action.admin.cluster.node.info.NodeInfo; import org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse; import org.elasticsearch.client.transport.TransportClient; +import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.node.Node; @@ -40,7 +41,7 @@ public class RunAsIntegTests extends ShieldIntegTestCase { public Settings nodeSettings(int nodeOrdinal) { return Settings.builder() .put(super.nodeSettings(nodeOrdinal)) - .put(Node.HTTP_ENABLED, true) + .put(NetworkModule.HTTP_ENABLED.getKey(), true) .build(); } diff --git a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiAuthenticationTests.java b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiAuthenticationTests.java index 689fc18bdd0..40023b80655 100644 --- a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiAuthenticationTests.java +++ b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiAuthenticationTests.java @@ -13,6 +13,7 @@ import org.apache.http.util.EntityUtils; import org.elasticsearch.action.index.IndexResponse; import org.elasticsearch.client.transport.NoNodeAvailableException; import org.elasticsearch.client.transport.TransportClient; +import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.InetSocketTransportAddress; import org.elasticsearch.common.transport.TransportAddress; @@ -50,7 +51,7 @@ public class PkiAuthenticationTests extends ShieldIntegTestCase { protected Settings nodeSettings(int nodeOrdinal) { return Settings.builder() .put(super.nodeSettings(nodeOrdinal)) - .put(Node.HTTP_ENABLED, true) + .put(NetworkModule.HTTP_ENABLED.getKey(), true) .put(ShieldNettyHttpServerTransport.HTTP_SSL_SETTING, true) .put(ShieldNettyHttpServerTransport.HTTP_CLIENT_AUTH_SETTING, randomBoolean() ? SSLClientAuth.REQUIRED : SSLClientAuth.OPTIONAL) .put("shield.authc.realms.esusers.type", "esusers") diff --git a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiOptionalClientAuthTests.java b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiOptionalClientAuthTests.java index 258c927ca20..be8a42aaf97 100644 --- a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiOptionalClientAuthTests.java +++ b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiOptionalClientAuthTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.shield.authc.pki; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.elasticsearch.client.transport.TransportClient; +import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.InetSocketTransportAddress; import org.elasticsearch.http.HttpServerTransport; @@ -52,7 +53,7 @@ public class PkiOptionalClientAuthTests extends ShieldIntegTestCase { return Settings.builder() .put(super.nodeSettings(nodeOrdinal)) - .put(Node.HTTP_ENABLED, true) + .put(NetworkModule.HTTP_ENABLED.getKey(), true) .put(ShieldNettyHttpServerTransport.HTTP_SSL_SETTING, true) .put(ShieldNettyHttpServerTransport.HTTP_CLIENT_AUTH_SETTING, SSLClientAuth.OPTIONAL) .put("shield.authc.realms.esusers.type", "esusers") diff --git a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiWithoutClientAuthenticationTests.java b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiWithoutClientAuthenticationTests.java index aa4c7d74ef9..4d517eb49a2 100644 --- a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiWithoutClientAuthenticationTests.java +++ b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiWithoutClientAuthenticationTests.java @@ -9,6 +9,7 @@ package org.elasticsearch.shield.authc.pki; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.elasticsearch.client.Client; +import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.InetSocketTransportAddress; import org.elasticsearch.http.HttpServerTransport; @@ -61,7 +62,7 @@ public class PkiWithoutClientAuthenticationTests extends ShieldIntegTestCase { public Settings nodeSettings(int nodeOrdinal) { return Settings.builder() .put(super.nodeSettings(nodeOrdinal)) - .put(Node.HTTP_ENABLED, true) + .put(NetworkModule.HTTP_ENABLED.getKey(), true) .put(ShieldNettyTransport.TRANSPORT_CLIENT_AUTH_SETTING, false) .put(ShieldNettyHttpServerTransport.HTTP_SSL_SETTING, true) .put(ShieldNettyHttpServerTransport.HTTP_CLIENT_AUTH_SETTING, randomFrom(SSLClientAuth.NO.name(), false, "false", "FALSE", SSLClientAuth.NO.name().toLowerCase(Locale.ROOT))) diff --git a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiWithoutSSLTests.java b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiWithoutSSLTests.java index aaa5c5f5eee..f04e46ee04f 100644 --- a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiWithoutSSLTests.java +++ b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/authc/pki/PkiWithoutSSLTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.shield.authc.pki; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.elasticsearch.client.Client; +import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.http.HttpServerTransport; import org.elasticsearch.node.Node; @@ -32,7 +33,7 @@ public class PkiWithoutSSLTests extends ShieldIntegTestCase { public Settings nodeSettings(int nodeOrdinal) { return Settings.builder() .put(super.nodeSettings(nodeOrdinal)) - .put(Node.HTTP_ENABLED, true) + .put(NetworkModule.HTTP_ENABLED.getKey(), true) .put("shield.authc.realms.pki1.type", "pki") .put("shield.authc.realms.pki1.order", "0") .build(); diff --git a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/rest/action/RestAuthenticateActionTests.java b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/rest/action/RestAuthenticateActionTests.java index a95fd0fde59..af7ae13e4dc 100644 --- a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/rest/action/RestAuthenticateActionTests.java +++ b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/rest/action/RestAuthenticateActionTests.java @@ -5,6 +5,7 @@ */ package org.elasticsearch.shield.rest.action; +import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.node.Node; import org.elasticsearch.shield.authc.support.SecuredString; @@ -34,7 +35,7 @@ public class RestAuthenticateActionTests extends ShieldIntegTestCase { protected Settings nodeSettings(int nodeOrdinal) { Settings.Builder builder = Settings.builder() .put(super.nodeSettings(nodeOrdinal)) - .put(Node.HTTP_ENABLED, true); + .put(NetworkModule.HTTP_ENABLED.getKey(), true); if (anonymousEnabled) { builder.put("shield.authc.anonymous.username", "anon") diff --git a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/transport/ServerTransportFilterIntegrationTests.java b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/transport/ServerTransportFilterIntegrationTests.java index 398b227e91a..a99d76914ba 100644 --- a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/transport/ServerTransportFilterIntegrationTests.java +++ b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/transport/ServerTransportFilterIntegrationTests.java @@ -7,6 +7,7 @@ package org.elasticsearch.shield.transport; import org.elasticsearch.Version; import org.elasticsearch.common.network.NetworkAddress; +import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.InetSocketTransportAddress; import org.elasticsearch.common.transport.TransportAddress; @@ -98,7 +99,7 @@ public class ServerTransportFilterIntegrationTests extends ShieldIntegTestCase { .put("shield.transport.ssl", sslTransportEnabled()) .put("shield.audit.enabled", false) .put("path.home", createTempDir()) - .put(Node.HTTP_ENABLED, false) + .put(NetworkModule.HTTP_ENABLED.getKey(), false) .put(InternalCryptoService.FILE_SETTING, systemKeyFile) .put("node.client", true) .build(); @@ -130,7 +131,7 @@ public class ServerTransportFilterIntegrationTests extends ShieldIntegTestCase { .put("discovery.zen.ping.unicast.hosts", "localhost:" + randomClientPort) .put("shield.transport.ssl", sslTransportEnabled()) .put("shield.audit.enabled", false) - .put(Node.HTTP_ENABLED, false) + .put(NetworkModule.HTTP_ENABLED.getKey(), false) .put(InternalCryptoService.FILE_SETTING, systemKeyFile) .put("discovery.initial_state_timeout", "2s") .put("path.home", createTempDir()) diff --git a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/transport/filter/IpFilteringIntegrationTests.java b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/transport/filter/IpFilteringIntegrationTests.java index 7ee8af013a5..c0b2d4e5db0 100644 --- a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/transport/filter/IpFilteringIntegrationTests.java +++ b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/transport/filter/IpFilteringIntegrationTests.java @@ -6,6 +6,7 @@ package org.elasticsearch.shield.transport.filter; import org.elasticsearch.client.Client; +import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.InetSocketTransportAddress; import org.elasticsearch.common.transport.TransportAddress; @@ -41,7 +42,7 @@ public class IpFilteringIntegrationTests extends ShieldIntegTestCase { protected Settings nodeSettings(int nodeOrdinal) { String randomClientPortRange = randomClientPort + "-" + (randomClientPort+100); return Settings.builder().put(super.nodeSettings(nodeOrdinal)) - .put(Node.HTTP_ENABLED, true) + .put(NetworkModule.HTTP_ENABLED.getKey(), true) .put("transport.profiles.client.port", randomClientPortRange) .put("transport.profiles.client.bind_host", "localhost") // make sure this is "localhost", no matter if ipv4 or ipv6, but be consistent .put("transport.profiles.client.shield.filter.deny", "_all") diff --git a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/transport/filter/IpFilteringUpdateTests.java b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/transport/filter/IpFilteringUpdateTests.java index 80fb88e0b22..1def3fde346 100644 --- a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/transport/filter/IpFilteringUpdateTests.java +++ b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/transport/filter/IpFilteringUpdateTests.java @@ -6,6 +6,7 @@ package org.elasticsearch.shield.transport.filter; import org.elasticsearch.cluster.ClusterState; +import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.node.Node; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; @@ -38,7 +39,7 @@ public class IpFilteringUpdateTests extends ShieldIntegTestCase { String randomClientPortRange = randomClientPort + "-" + (randomClientPort+100); return settingsBuilder() .put(super.nodeSettings(nodeOrdinal)) - .put(Node.HTTP_ENABLED, httpEnabled) + .put(NetworkModule.HTTP_ENABLED.getKey(), httpEnabled) .put("shield.transport.filter.deny", "127.0.0.200") .put("transport.profiles.client.port", randomClientPortRange) .build(); diff --git a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/transport/ssl/SslClientAuthTests.java b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/transport/ssl/SslClientAuthTests.java index e110807fcdf..95305b46dbb 100644 --- a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/transport/ssl/SslClientAuthTests.java +++ b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/transport/ssl/SslClientAuthTests.java @@ -11,6 +11,7 @@ import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.client.transport.TransportClient; +import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.http.HttpServerTransport; @@ -43,7 +44,7 @@ public class SslClientAuthTests extends ShieldIntegTestCase { .put(ShieldNettyHttpServerTransport.HTTP_SSL_SETTING, true) .put(ShieldNettyHttpServerTransport.HTTP_CLIENT_AUTH_SETTING, true) .put("transport.profiles.default.shield.ssl.client.auth", false) - .put(Node.HTTP_ENABLED, true) + .put(NetworkModule.HTTP_ENABLED.getKey(), true) .build(); } diff --git a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/transport/ssl/SslIntegrationTests.java b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/transport/ssl/SslIntegrationTests.java index 142c5022b50..9b205dc50d9 100644 --- a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/transport/ssl/SslIntegrationTests.java +++ b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/shield/transport/ssl/SslIntegrationTests.java @@ -17,6 +17,7 @@ import org.apache.http.impl.client.HttpClients; import org.elasticsearch.client.transport.NoNodeAvailableException; import org.elasticsearch.client.transport.TransportClient; import org.elasticsearch.common.io.Streams; +import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.InetSocketTransportAddress; import org.elasticsearch.common.transport.TransportAddress; @@ -46,7 +47,7 @@ public class SslIntegrationTests extends ShieldIntegTestCase { @Override protected Settings nodeSettings(int nodeOrdinal) { return settingsBuilder().put(super.nodeSettings(nodeOrdinal)) - .put(Node.HTTP_ENABLED, true) + .put(NetworkModule.HTTP_ENABLED.getKey(), true) .put(ShieldNettyHttpServerTransport.HTTP_SSL_SETTING, true).build(); } diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/WatcherPluginDisableTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/WatcherPluginDisableTests.java index 886379b8411..f36160d35ea 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/WatcherPluginDisableTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/WatcherPluginDisableTests.java @@ -10,6 +10,7 @@ import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.elasticsearch.action.admin.cluster.node.info.NodeInfo; import org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse; +import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.http.HttpServerTransport; import org.elasticsearch.node.Node; @@ -42,7 +43,7 @@ public class WatcherPluginDisableTests extends ESIntegTestCase { .put(super.nodeSettings(nodeOrdinal)) .put(WatcherPlugin.ENABLED_SETTING, false) .put(ShieldPlugin.ENABLED_SETTING_NAME, false) // disable shield because of query cache check and authentication/authorization - .put(Node.HTTP_ENABLED, true) + .put(NetworkModule.HTTP_ENABLED.getKey(), true) .build(); } diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/input/chain/ChainIntegrationTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/input/chain/ChainIntegrationTests.java index 9c9b8d3aa6b..7988a3b39ad 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/input/chain/ChainIntegrationTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/input/chain/ChainIntegrationTests.java @@ -6,6 +6,7 @@ package org.elasticsearch.watcher.input.chain; import org.elasticsearch.action.search.SearchResponse; +import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.node.Node; @@ -35,7 +36,7 @@ public class ChainIntegrationTests extends AbstractWatcherIntegrationTestCase { protected Settings nodeSettings(int nodeOrdinal) { return Settings.builder() .put(super.nodeSettings(nodeOrdinal)) - .put(Node.HTTP_ENABLED, true) + .put(NetworkModule.HTTP_ENABLED.getKey(), true) .build(); } diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/input/http/HttpInputIntegrationTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/input/http/HttpInputIntegrationTests.java index 95e66fe4eeb..5d8fdb94b95 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/input/http/HttpInputIntegrationTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/input/http/HttpInputIntegrationTests.java @@ -7,6 +7,7 @@ package org.elasticsearch.watcher.input.http; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.support.IndicesOptions; +import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.node.Node; @@ -42,7 +43,7 @@ public class HttpInputIntegrationTests extends AbstractWatcherIntegrationTestCas protected Settings nodeSettings(int nodeOrdinal) { return Settings.builder() .put(super.nodeSettings(nodeOrdinal)) - .put(Node.HTTP_ENABLED, true) + .put(NetworkModule.HTTP_ENABLED.getKey(), true) .build(); } diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/test/integration/WatcherSettingsFilterTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/test/integration/WatcherSettingsFilterTests.java index fcb188a2f5e..5ef939d3de6 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/test/integration/WatcherSettingsFilterTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/test/integration/WatcherSettingsFilterTests.java @@ -7,6 +7,7 @@ package org.elasticsearch.watcher.test.integration; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; +import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.common.xcontent.support.XContentMapValues; @@ -43,7 +44,7 @@ public class WatcherSettingsFilterTests extends AbstractWatcherIntegrationTestCa protected Settings nodeSettings(int nodeOrdinal) { return Settings.builder() .put(super.nodeSettings(nodeOrdinal)) - .put(Node.HTTP_ENABLED, true) + .put(NetworkModule.HTTP_ENABLED.getKey(), true) .put("watcher.actions.email.service.account._email.smtp.host", "host.domain") .put("watcher.actions.email.service.account._email.smtp.port", 587) .put("watcher.actions.email.service.account._email.smtp.user", "_user") From 8781990ca8dceed1ddad2855ec5e2673f4519f03 Mon Sep 17 00:00:00 2001 From: uboness Date: Fri, 22 Jan 2016 18:36:53 +0100 Subject: [PATCH 8/8] fix build - compilation Original commit: elastic/x-pack-elasticsearch@7508ed0c38eac583a79e317f8a52bf185b8d0d9d --- .../org/elasticsearch/shield/transport/filter/IPFilter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/transport/filter/IPFilter.java b/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/transport/filter/IPFilter.java index cecd14a4911..5ada35f5883 100644 --- a/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/transport/filter/IPFilter.java +++ b/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/transport/filter/IPFilter.java @@ -42,7 +42,7 @@ public class IPFilter { public static final String HTTP_PROFILE_NAME = ".http"; public static final Setting IP_FILTER_ENABLED_HTTP_SETTING = Setting.boolSetting("shield.http.filter.enabled", true, true, Setting.Scope.CLUSTER); - public static final Setting IP_FILTER_ENABLED_SETTING = new Setting<>("shield.transport.filter.enabled", (s) -> IP_FILTER_ENABLED_HTTP_SETTING.getDefault(s), Booleans::parseBooleanExact, true, Setting.Scope.CLUSTER); + public static final Setting IP_FILTER_ENABLED_SETTING = new Setting<>("shield.transport.filter.enabled", (s) -> IP_FILTER_ENABLED_HTTP_SETTING.getDefaultRaw(s), Booleans::parseBooleanExact, true, Setting.Scope.CLUSTER); public static final Setting> TRANSPORT_FILTER_ALLOW_SETTING = Setting.listSetting("shield.transport.filter.allow", Collections.emptyList(), Function.identity(), true, Setting.Scope.CLUSTER); public static final Setting> TRANSPORT_FILTER_DENY_SETTING = Setting.listSetting("shield.transport.filter.deny", Collections.emptyList(), Function.identity(), true, Setting.Scope.CLUSTER);