diff --git a/elasticsearch/qa/security-migrate-tests/src/test/java/org/elasticsearch/xpack/security/MigrateToolTestCase.java b/elasticsearch/qa/security-migrate-tests/src/test/java/org/elasticsearch/xpack/security/MigrateToolTestCase.java index 76f57f802ff..bf72ecb2efc 100644 --- a/elasticsearch/qa/security-migrate-tests/src/test/java/org/elasticsearch/xpack/security/MigrateToolTestCase.java +++ b/elasticsearch/qa/security-migrate-tests/src/test/java/org/elasticsearch/xpack/security/MigrateToolTestCase.java @@ -15,6 +15,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.InetSocketTransportAddress; import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.node.internal.InternalSettingsPreparer; +import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.xpack.security.Security; import org.elasticsearch.xpack.XPackPlugin; import org.junit.After; @@ -45,6 +46,7 @@ import static org.hamcrest.Matchers.notNullValue; * your test. */ @LuceneTestCase.SuppressSysoutChecks(bugUrl = "we log a lot on purpose") +@ESIntegTestCase.SuppressLocalMode public abstract class MigrateToolTestCase extends LuceneTestCase { /** @@ -77,7 +79,6 @@ public abstract class MigrateToolTestCase extends LuceneTestCase { .put("client.transport.ignore_cluster_name", true) .put("path.home", tempDir) .put(Security.USER_SETTING.getKey(), "transport_user:changeme") - .put("node.mode", "network") // we require network here! .build(); TransportClient.Builder transportClientBuilder = TransportClient.builder() diff --git a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/xpack/TribeTransportTestCase.java b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/xpack/TribeTransportTestCase.java index 6a6f545ab9c..f6bc9baa3fa 100644 --- a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/xpack/TribeTransportTestCase.java +++ b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/xpack/TribeTransportTestCase.java @@ -19,6 +19,7 @@ import org.elasticsearch.common.UUIDs; import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.TransportAddress; +import org.elasticsearch.discovery.DiscoveryModule; import org.elasticsearch.discovery.zen.ping.unicast.UnicastZenPing; import org.elasticsearch.xpack.monitoring.Monitoring; import org.elasticsearch.node.Node; @@ -59,7 +60,8 @@ public abstract class TribeTransportTestCase extends ESIntegTestCase { protected final Settings nodeSettings(int nodeOrdinal) { final Settings.Builder builder = Settings.builder() .put(NetworkModule.HTTP_ENABLED.getKey(), false) - .put(Node.NODE_LOCAL_SETTING.getKey(), true); + .put("transport.type", "local") + .put(DiscoveryModule.DISCOVERY_TYPE_SETTING.getKey(), "local"); List enabledFeatures = enabledFeatures(); for (String feature : ALL_FEATURES) { builder.put(XPackPlugin.featureEnabledSetting(feature), enabledFeatures.contains(feature)); @@ -99,7 +101,7 @@ public abstract class TribeTransportTestCase extends ESIntegTestCase { return TribeTransportTestCase.this.transportClientPlugins(); } }; - final InternalTestCluster cluster2 = new InternalTestCluster(InternalTestCluster.configuredNodeMode(), + final InternalTestCluster cluster2 = new InternalTestCluster( randomLong(), createTempDir(), true, 2, 2, UUIDs.randomBase64UUID(random()), nodeConfigurationSource, 1, false, "tribe_node2", getMockPlugins(), getClientWrapper()); @@ -131,13 +133,17 @@ public abstract class TribeTransportTestCase extends ESIntegTestCase { Settings merged = Settings.builder() .put("tribe.t1.cluster.name", internalCluster().getClusterName()) .put("tribe.t2.cluster.name", cluster2.getClusterName()) + .put("tribe.t1.transport.type", "local") + .put("tribe.t2.transport.type", "local") + .put("tribe.t1.discovery.type", "local") + .put("tribe.t2.discovery.type", "local") .put("tribe.blocks.write", false) .put(tribe1Defaults.build()) .put(tribe2Defaults.build()) .put(NetworkModule.HTTP_ENABLED.getKey(), false) .put(internalCluster().getDefaultSettings()) .put("node.name", "tribe_node") // make sure we can identify threads from this node - .put(Node.NODE_LOCAL_SETTING.getKey(), true) + .put("transport.type", "local") .build(); final Node tribeNode = new Node(merged).start(); diff --git a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/test/SecuritySettingsSource.java b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/test/SecuritySettingsSource.java index 89930773377..29a1b9532a2 100644 --- a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/test/SecuritySettingsSource.java +++ b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/test/SecuritySettingsSource.java @@ -10,6 +10,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.PathUtils; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; +import org.elasticsearch.discovery.DiscoveryModule; import org.elasticsearch.xpack.MockNettyPlugin; import org.elasticsearch.xpack.monitoring.Monitoring; import org.elasticsearch.plugins.Plugin; @@ -53,7 +54,7 @@ import static org.elasticsearch.xpack.security.test.SecurityTestUtils.writeFile; public class SecuritySettingsSource extends ClusterDiscoveryConfiguration.UnicastZen { public static final Settings DEFAULT_SETTINGS = Settings.builder() - .put("node.mode", "network") + .put(DiscoveryModule.DISCOVERY_TYPE_SETTING.getKey(), "zen") .build(); public static final String DEFAULT_USER_NAME = "test_user"; diff --git a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrailMutedTests.java b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrailMutedTests.java index 587ce8141ac..47105853454 100644 --- a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrailMutedTests.java +++ b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrailMutedTests.java @@ -62,7 +62,7 @@ public class IndexAuditTrailMutedTests extends ESTestCase { LocalTransportAddress.buildUnique())); threadPool = new TestThreadPool("index audit trail tests"); - transportClient = TransportClient.builder().settings(Settings.EMPTY).build(); + transportClient = TransportClient.builder().settings(Settings.builder().put("transport.type", "local")).build(); clientCalled = new AtomicBoolean(false); class IClient extends FilterClient implements InternalClient { IClient(Client transportClient){ diff --git a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrailTests.java b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrailTests.java index 752f7dc5409..f48d5b114e7 100644 --- a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrailTests.java +++ b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrailTests.java @@ -158,7 +158,7 @@ public class IndexAuditTrailTests extends SecurityIntegTestCase { if (useSecurity == false) { mockPlugins.add(MockTcpTransportPlugin.class); } - remoteCluster = new InternalTestCluster("network", randomLong(), createTempDir(), false, numNodes, numNodes, cluster2Name, + remoteCluster = new InternalTestCluster(randomLong(), createTempDir(), false, numNodes, numNodes, cluster2Name, cluster2SettingsSource, 0, false, SECOND_CLUSTER_NODE_PREFIX, mockPlugins, useSecurity ? getClientWrapper() : Function.identity()); remoteCluster.beforeTest(random(), 0.5); diff --git a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/audit/index/RemoteIndexAuditTrailStartingTests.java b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/audit/index/RemoteIndexAuditTrailStartingTests.java index 477e828d149..aa4d5989103 100644 --- a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/audit/index/RemoteIndexAuditTrailStartingTests.java +++ b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/audit/index/RemoteIndexAuditTrailStartingTests.java @@ -105,7 +105,7 @@ public class RemoteIndexAuditTrailStartingTests extends SecurityIntegTestCase { return builder.build(); } }; - remoteCluster = new InternalTestCluster("network", randomLong(), createTempDir(), false, + remoteCluster = new InternalTestCluster(randomLong(), createTempDir(), false, numNodes, numNodes, cluster2Name, cluster2SettingsSource, 0, false, SECOND_CLUSTER_NODE_PREFIX, getMockPlugins(), getClientWrapper()); remoteCluster.beforeTest(random(), 0.5); diff --git a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/transport/ServerTransportFilterIntegrationTests.java b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/transport/ServerTransportFilterIntegrationTests.java index cb046fdfe4d..6f9011122b1 100644 --- a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/transport/ServerTransportFilterIntegrationTests.java +++ b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/transport/ServerTransportFilterIntegrationTests.java @@ -93,7 +93,6 @@ public class ServerTransportFilterIntegrationTests extends SecurityIntegTestCase // test that starting up a node works Settings nodeSettings = Settings.builder() .put(getSSLSettingsForStore("/org/elasticsearch/xpack/security/transport/ssl/certs/simple/testnode.jks", "testnode")) - .put("node.mode", "network") .put("node.name", "my-test-node") .put("network.host", "localhost") .put("cluster.name", internalCluster().getClusterName()) @@ -124,7 +123,6 @@ public class ServerTransportFilterIntegrationTests extends SecurityIntegTestCase .put("xpack.security.authc.realms.file.files.users_roles", writeFile(folder, "users_roles", configUsersRoles())) .put(FileRolesStore.ROLES_FILE_SETTING.getKey(), writeFile(folder, "roles.yml", configRoles())) .put(getSSLSettingsForStore("/org/elasticsearch/xpack/security/transport/ssl/certs/simple/testnode.jks", "testnode")) - .put("node.mode", "network") .put("node.name", "my-test-node") .put(Security.USER_SETTING.getKey(), "test_user:changeme") .put("cluster.name", internalCluster().getClusterName())