Reenable TribeWithSecurityIT tests (elastic/x-pack-elasticsearch#2511)
This is related to elastic/x-pack-elasticsearch#1996. These tests were disabled during the bootstrap password work. They can now be reenabled. Additionally, I made the test password used in tests consistent. Original commit: elastic/x-pack-elasticsearch@5b490c8231
This commit is contained in:
parent
96e01dce47
commit
b3914afd30
|
@ -53,6 +53,7 @@ import java.util.Map;
|
|||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.elasticsearch.test.SecuritySettingsSource.TEST_PASSWORD_SECURE_STRING;
|
||||
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
|
||||
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoTimeout;
|
||||
import static org.elasticsearch.xpack.security.SecurityLifecycleService.SECURITY_INDEX_NAME;
|
||||
|
@ -83,7 +84,7 @@ public abstract class SecurityIntegTestCase extends ESIntegTestCase {
|
|||
|
||||
@BeforeClass
|
||||
public static void generateBootstrapPassword() {
|
||||
BOOTSTRAP_PASSWORD = new SecureString("FOOBAR".toCharArray());
|
||||
BOOTSTRAP_PASSWORD = TEST_PASSWORD_SECURE_STRING.clone();
|
||||
}
|
||||
|
||||
//UnicastZen requires the number of nodes in a cluster to generate the unicast configuration.
|
||||
|
|
|
@ -72,6 +72,7 @@ integTestCluster {
|
|||
setting 'tribe.cluster2.discovery.zen.ping.unicast.hosts', "'${-> cluster2Nodes.get(0).transportUri()}'"
|
||||
setting 'tribe.cluster2.http.enabled', 'true'
|
||||
setting 'tribe.cluster2.xpack.ml.enabled', 'false'
|
||||
keystoreSetting 'bootstrap.password', 'x-pack-test-password'
|
||||
waitCondition = { node, ant ->
|
||||
File tmpFile = new File(node.cwd, 'wait.success')
|
||||
// 5 nodes: tribe + clusterOne (1 node + tribe internal node) + clusterTwo (1 node + tribe internal node)
|
||||
|
|
|
@ -106,15 +106,13 @@ public class TribeWithSecurityIT extends SecurityIntegTestCase {
|
|||
return new ExternalTestCluster(createTempDir(), externalClusterClientSettings(), transportClientPlugins(), transportAddresses);
|
||||
}
|
||||
|
||||
@LuceneTestCase.AwaitsFix(bugUrl = "https://github.com/elastic/x-pack-elasticsearch/issues/1996")
|
||||
public void testThatTribeCanAuthenticateElasticUser() throws Exception {
|
||||
ClusterHealthResponse response = tribeNode.client().filterWithHeader(Collections.singletonMap("Authorization",
|
||||
UsernamePasswordToken.basicAuthHeaderValue("elastic", SecuritySettingsSource.TEST_PASSWORD_SECURE_STRING)))
|
||||
UsernamePasswordToken.basicAuthHeaderValue("elastic", BOOTSTRAP_PASSWORD)))
|
||||
.admin().cluster().prepareHealth().get();
|
||||
assertNoTimeout(response);
|
||||
}
|
||||
|
||||
@LuceneTestCase.AwaitsFix(bugUrl = "https://github.com/elastic/x-pack-elasticsearch/issues/1996")
|
||||
public void testThatTribeCanAuthenticateElasticUserWithChangedPassword() throws Exception {
|
||||
securityClient(client()).prepareChangePassword("elastic", "password".toCharArray()).get();
|
||||
|
||||
|
@ -125,7 +123,6 @@ public class TribeWithSecurityIT extends SecurityIntegTestCase {
|
|||
assertNoTimeout(response);
|
||||
}
|
||||
|
||||
@LuceneTestCase.AwaitsFix(bugUrl = "https://github.com/elastic/x-pack-elasticsearch/issues/1996")
|
||||
public void testThatTribeClustersHaveDifferentPasswords() throws Exception {
|
||||
securityClient().prepareChangePassword("elastic", "password".toCharArray()).get();
|
||||
securityClient(cluster2.client()).prepareChangePassword("elastic", "password2".toCharArray()).get();
|
||||
|
|
Loading…
Reference in New Issue