2019-06-18 03:10:05 -04:00
|
|
|
apply plugin: 'elasticsearch.testclusters'
|
2018-07-10 03:26:48 -04:00
|
|
|
apply plugin: 'elasticsearch.standalone-rest-test'
|
|
|
|
apply plugin: 'elasticsearch.rest-test'
|
|
|
|
|
|
|
|
dependencies {
|
2020-06-14 16:30:44 -04:00
|
|
|
testImplementation project(path: xpackModule('core'), configuration: 'default')
|
|
|
|
testImplementation project(path: xpackModule('core'), configuration: 'testArtifacts')
|
2020-06-30 09:57:41 -04:00
|
|
|
testImplementation project(path: xpackModule('ml'))
|
2020-06-14 16:30:44 -04:00
|
|
|
testImplementation project(path: xpackModule('ml'), configuration: 'testArtifacts')
|
|
|
|
testImplementation project(path: ':modules:ingest-common')
|
2020-07-15 10:50:44 -04:00
|
|
|
testImplementation project(path: xpackModule('data-streams'))
|
2018-07-10 03:26:48 -04:00
|
|
|
}
|
|
|
|
|
2018-07-24 05:48:14 -04:00
|
|
|
// location for keys and certificates
|
2018-07-10 03:26:48 -04:00
|
|
|
File keystoreDir = new File(project.buildDir, 'keystore')
|
2018-07-24 05:48:14 -04:00
|
|
|
File nodeKey = file("$keystoreDir/testnode.pem")
|
|
|
|
File nodeCert = file("$keystoreDir/testnode.crt")
|
|
|
|
// Add key and certs to test classpath: it expects it there
|
2020-07-31 07:09:04 -04:00
|
|
|
tasks.register("copyKeyCerts", Copy) {
|
2019-11-14 06:01:23 -05:00
|
|
|
from(project(':x-pack:plugin:core').file('src/test/resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple/')) {
|
|
|
|
include 'testnode.crt', 'testnode.pem'
|
|
|
|
}
|
|
|
|
into keystoreDir
|
2018-07-10 03:26:48 -04:00
|
|
|
}
|
2018-07-24 05:48:14 -04:00
|
|
|
// Add keys and cets to test classpath: it expects it there
|
2018-07-10 03:26:48 -04:00
|
|
|
sourceSets.test.resources.srcDir(keystoreDir)
|
2020-07-31 07:09:04 -04:00
|
|
|
tasks.named("processTestResources").configure { dependsOn("copyKeyCerts") }
|
2018-07-10 03:26:48 -04:00
|
|
|
|
2019-06-18 03:10:05 -04:00
|
|
|
integTest {
|
2020-07-31 07:09:04 -04:00
|
|
|
dependsOn "copyKeyCerts"
|
2019-11-14 06:01:23 -05:00
|
|
|
runner {
|
|
|
|
/*
|
|
|
|
* We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each
|
|
|
|
* other if we allow them to set the number of available processors as it's set-once in Netty.
|
|
|
|
*/
|
|
|
|
systemProperty 'es.set.netty.runtime.available.processors', 'false'
|
|
|
|
}
|
2019-06-18 03:10:05 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
testClusters.integTest {
|
2019-11-14 06:01:23 -05:00
|
|
|
numberOfNodes = 3
|
|
|
|
testDistribution = 'DEFAULT'
|
|
|
|
|
|
|
|
setting 'xpack.security.enabled', 'true'
|
2020-04-20 10:37:19 -04:00
|
|
|
setting 'xpack.monitoring.elasticsearch.collection.enabled', 'false'
|
2019-11-14 06:01:23 -05:00
|
|
|
setting 'xpack.ml.enabled', 'true'
|
|
|
|
setting 'xpack.watcher.enabled', 'false'
|
|
|
|
setting 'xpack.security.authc.token.enabled', 'true'
|
|
|
|
setting 'xpack.security.transport.ssl.enabled', 'true'
|
|
|
|
setting 'xpack.security.transport.ssl.key', nodeKey.name
|
|
|
|
setting 'xpack.security.transport.ssl.certificate', nodeCert.name
|
|
|
|
setting 'xpack.security.transport.ssl.verification_mode', 'certificate'
|
|
|
|
setting 'xpack.security.audit.enabled', 'false'
|
|
|
|
setting 'xpack.license.self_generated.type', 'trial'
|
|
|
|
setting 'xpack.ml.min_disk_space_off_heap', '200mb'
|
2020-04-20 15:41:30 -04:00
|
|
|
setting 'indices.lifecycle.history_index_enabled', 'false'
|
|
|
|
setting 'slm.history_index_enabled', 'false'
|
2019-11-14 06:01:23 -05:00
|
|
|
|
|
|
|
keystore 'bootstrap.password', 'x-pack-test-password'
|
|
|
|
keystore 'xpack.security.transport.ssl.secure_key_passphrase', 'testnode'
|
|
|
|
|
|
|
|
user username: "x_pack_rest_user", password: "x-pack-test-password"
|
|
|
|
|
|
|
|
extraConfigFile nodeKey.name, nodeKey
|
|
|
|
extraConfigFile nodeCert.name, nodeCert
|
2018-07-10 03:26:48 -04:00
|
|
|
}
|