|
14 | 14 | import org.elasticsearch.common.settings.SecureString; |
15 | 15 | import org.elasticsearch.common.settings.Settings; |
16 | 16 | import org.elasticsearch.common.util.concurrent.ThreadContext; |
| 17 | +import org.elasticsearch.core.Booleans; |
17 | 18 | import org.elasticsearch.test.cluster.ElasticsearchCluster; |
18 | 19 | import org.elasticsearch.test.cluster.FeatureFlag; |
| 20 | +import org.elasticsearch.test.cluster.local.LocalClusterSpecBuilder; |
19 | 21 | import org.elasticsearch.test.cluster.local.distribution.DistributionType; |
20 | 22 | import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; |
21 | 23 | import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; |
|
26 | 28 |
|
27 | 29 | public class LogsdbTestSuiteIT extends ESClientYamlSuiteTestCase { |
28 | 30 |
|
29 | | - private static final String USER = "test_admin"; |
| 31 | + private static final String USER = "x_pack_rest_user"; |
30 | 32 | private static final String PASS = "x-pack-test-password"; |
31 | 33 |
|
32 | 34 | @ClassRule |
33 | | - public static final ElasticsearchCluster cluster = ElasticsearchCluster.local() |
34 | | - .module("logsdb") |
35 | | - .distribution(DistributionType.DEFAULT) |
36 | | - .user(USER, PASS, "superuser", false) |
37 | | - .setting("xpack.security.autoconfiguration.enabled", "false") |
38 | | - .setting("xpack.license.self_generated.type", "trial") |
39 | | - .feature(FeatureFlag.DOC_VALUES_SKIPPER) |
40 | | - .feature(FeatureFlag.BINARY_DOC_VALUE_COMPRESSION) |
41 | | - .build(); |
| 35 | + public static final ElasticsearchCluster cluster = createCluster(); |
| 36 | + |
| 37 | + private static ElasticsearchCluster createCluster() { |
| 38 | + LocalClusterSpecBuilder<ElasticsearchCluster> clusterBuilder = ElasticsearchCluster.local() |
| 39 | + .distribution(DistributionType.DEFAULT) |
| 40 | + .setting("xpack.security.enabled", "true") |
| 41 | + .user(USER, PASS) |
| 42 | + .keystore("bootstrap.password", "x-pack-test-password") |
| 43 | + .setting("xpack.license.self_generated.type", "trial") |
| 44 | + .feature(FeatureFlag.DOC_VALUES_SKIPPER) |
| 45 | + .feature(FeatureFlag.BINARY_DOC_VALUE_COMPRESSION); |
| 46 | + boolean setNodes = Booleans.parseBoolean(System.getProperty("yaml.rest.tests.set_num_nodes", "true")); |
| 47 | + if (setNodes) { |
| 48 | + clusterBuilder.nodes(1); |
| 49 | + } |
| 50 | + return clusterBuilder.build(); |
| 51 | + } |
42 | 52 |
|
43 | 53 | public LogsdbTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { |
44 | 54 | super(testCandidate); |
|
0 commit comments