|
@@ -1,60 +0,0 @@
|
|
|
-/*
|
|
|
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
|
- * or more contributor license agreements. Licensed under the Elastic License;
|
|
|
- * you may not use this file except in compliance with the Elastic License.
|
|
|
- */
|
|
|
-package org.elasticsearch.license;
|
|
|
-
|
|
|
-import org.elasticsearch.analysis.common.CommonAnalysisPlugin;
|
|
|
-import org.elasticsearch.common.settings.Settings;
|
|
|
-import org.elasticsearch.plugins.Plugin;
|
|
|
-import org.elasticsearch.test.ESIntegTestCase;
|
|
|
-import org.elasticsearch.test.discovery.TestZenDiscovery;
|
|
|
-import org.elasticsearch.transport.Netty4Plugin;
|
|
|
-import org.elasticsearch.xpack.core.LocalStateCompositeXPackPlugin;
|
|
|
-
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.Collection;
|
|
|
-
|
|
|
-import static org.elasticsearch.test.ESIntegTestCase.Scope.TEST;
|
|
|
-
|
|
|
-@ESIntegTestCase.ClusterScope(scope = TEST, numDataNodes = 0, numClientNodes = 0, maxNumDataNodes = 0, transportClientRatio = 0,
|
|
|
- autoMinMasterNodes = false)
|
|
|
-public class LicenseServiceClusterNotRecoveredTests extends AbstractLicensesIntegrationTestCase {
|
|
|
-
|
|
|
- @Override
|
|
|
- protected Settings nodeSettings(int nodeOrdinal) {
|
|
|
- return nodeSettingsBuilder(nodeOrdinal).build();
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- protected boolean addMockHttpTransport() {
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- private Settings.Builder nodeSettingsBuilder(int nodeOrdinal) {
|
|
|
- return Settings.builder()
|
|
|
- .put(super.nodeSettings(nodeOrdinal))
|
|
|
- .put("node.data", true)
|
|
|
- .put(TestZenDiscovery.USE_ZEN2.getKey(), false) // this test is just weird
|
|
|
- .put("resource.reload.interval.high", "500ms"); // for license mode file watcher
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- protected Collection<Class<? extends Plugin>> nodePlugins() {
|
|
|
- return Arrays.asList(LocalStateCompositeXPackPlugin.class, CommonAnalysisPlugin.class, Netty4Plugin.class);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- protected Collection<Class<? extends Plugin>> transportClientPlugins() {
|
|
|
- return nodePlugins();
|
|
|
- }
|
|
|
-
|
|
|
- public void testClusterNotRecovered() throws Exception {
|
|
|
- logger.info("--> start one master out of two [recovery state]");
|
|
|
- internalCluster().startNode(nodeSettingsBuilder(0).put("discovery.zen.minimum_master_nodes", 2).put("node.master", true));
|
|
|
- logger.info("--> start second master out of two [recovered state]");
|
|
|
- internalCluster().startNode(nodeSettingsBuilder(1).put("discovery.zen.minimum_master_nodes", 2).put("node.master", true));
|
|
|
- assertLicenseActive(true);
|
|
|
- }
|
|
|
-}
|