-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix cluster default initialization Part 1 (#4002)
Signed-off-by: Andrey Pleskach <[email protected]>
- Loading branch information
1 parent
dc8bd61
commit b0d26dd
Showing
20 changed files
with
1,930 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...tegrationTest/java/org/opensearch/security/DefaultConfigurationMultiNodeClusterTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
* | ||
*/ | ||
package org.opensearch.security; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import org.junit.ClassRule; | ||
|
||
import org.opensearch.test.framework.cluster.ClusterManager; | ||
import org.opensearch.test.framework.cluster.LocalCluster; | ||
|
||
public class DefaultConfigurationMultiNodeClusterTests extends AbstractDefaultConfigurationTests { | ||
|
||
@ClassRule | ||
public static LocalCluster cluster = new LocalCluster.Builder().clusterManager(ClusterManager.THREE_CLUSTER_MANAGERS) | ||
.nodeSettings( | ||
Map.of( | ||
"plugins.security.allow_default_init_securityindex", | ||
true, | ||
"plugins.security.restapi.roles_enabled", | ||
List.of("user_admin__all_access") | ||
) | ||
) | ||
.defaultConfigurationInitDirectory(configurationFolder.toString()) | ||
.loadConfigurationIntoIndex(false) | ||
.build(); | ||
|
||
public DefaultConfigurationMultiNodeClusterTests() { | ||
super(cluster); | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
...ava/org/opensearch/security/DefaultConfigurationMultiNodeClusterUseClusterStateTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
* | ||
*/ | ||
package org.opensearch.security; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import org.junit.ClassRule; | ||
|
||
import org.opensearch.test.framework.cluster.ClusterManager; | ||
import org.opensearch.test.framework.cluster.LocalCluster; | ||
|
||
public class DefaultConfigurationMultiNodeClusterUseClusterStateTests extends AbstractDefaultConfigurationTests { | ||
|
||
@ClassRule | ||
public static LocalCluster cluster = new LocalCluster.Builder().clusterManager(ClusterManager.THREE_CLUSTER_MANAGERS) | ||
.nodeSettings( | ||
Map.of( | ||
"plugins.security.allow_default_init_securityindex", | ||
true, | ||
"plugins.security.allow_default_init_securityindex.use_cluster_state", | ||
true, | ||
"plugins.security.restapi.roles_enabled", | ||
List.of("user_admin__all_access") | ||
) | ||
) | ||
.defaultConfigurationInitDirectory(configurationFolder.toString()) | ||
.loadConfigurationIntoIndex(false) | ||
.build(); | ||
|
||
public DefaultConfigurationMultiNodeClusterUseClusterStateTests() { | ||
super(cluster); | ||
} | ||
|
||
} |
44 changes: 44 additions & 0 deletions
44
...egrationTest/java/org/opensearch/security/DefaultConfigurationSingleNodeClusterTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
* | ||
*/ | ||
package org.opensearch.security; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import com.carrotsearch.randomizedtesting.annotations.ThreadLeakScope; | ||
import org.junit.ClassRule; | ||
import org.junit.runner.RunWith; | ||
|
||
import org.opensearch.test.framework.cluster.ClusterManager; | ||
import org.opensearch.test.framework.cluster.LocalCluster; | ||
|
||
@RunWith(com.carrotsearch.randomizedtesting.RandomizedRunner.class) | ||
@ThreadLeakScope(ThreadLeakScope.Scope.NONE) | ||
public class DefaultConfigurationSingleNodeClusterTests extends AbstractDefaultConfigurationTests { | ||
|
||
@ClassRule | ||
public static LocalCluster cluster = new LocalCluster.Builder().clusterManager(ClusterManager.SINGLENODE) | ||
.nodeSettings( | ||
Map.of( | ||
"plugins.security.allow_default_init_securityindex", | ||
true, | ||
"plugins.security.restapi.roles_enabled", | ||
List.of("user_admin__all_access") | ||
) | ||
) | ||
.defaultConfigurationInitDirectory(configurationFolder.toString()) | ||
.loadConfigurationIntoIndex(false) | ||
.build(); | ||
|
||
public DefaultConfigurationSingleNodeClusterTests() { | ||
super(cluster); | ||
} | ||
|
||
} |
42 changes: 42 additions & 0 deletions
42
...va/org/opensearch/security/DefaultConfigurationSingleNodeClusterUseClusterStateTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
* | ||
*/ | ||
package org.opensearch.security; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import org.junit.ClassRule; | ||
|
||
import org.opensearch.test.framework.cluster.ClusterManager; | ||
import org.opensearch.test.framework.cluster.LocalCluster; | ||
|
||
public class DefaultConfigurationSingleNodeClusterUseClusterStateTests extends AbstractDefaultConfigurationTests { | ||
|
||
@ClassRule | ||
public static LocalCluster cluster = new LocalCluster.Builder().clusterManager(ClusterManager.SINGLENODE) | ||
.nodeSettings( | ||
Map.of( | ||
"plugins.security.allow_default_init_securityindex", | ||
true, | ||
"plugins.security.allow_default_init_securityindex.use_cluster_state", | ||
true, | ||
"plugins.security.restapi.roles_enabled", | ||
List.of("user_admin__all_access") | ||
) | ||
) | ||
.defaultConfigurationInitDirectory(configurationFolder.toString()) | ||
.loadConfigurationIntoIndex(false) | ||
.build(); | ||
|
||
public DefaultConfigurationSingleNodeClusterUseClusterStateTests() { | ||
super(cluster); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.