63 lines
2.7 KiB
Groovy
63 lines
2.7 KiB
Groovy
apply plugin: 'elasticsearch.java-rest-test'
|
|
|
|
dependencies {
|
|
javaRestTestImplementation project(path: xpackModule('core'), configuration: 'default')
|
|
javaRestTestImplementation project(path: xpackModule('core'), configuration: 'testArtifacts')
|
|
javaRestTestImplementation project(path: xpackModule('ml'))
|
|
javaRestTestImplementation project(path: xpackModule('ml'), configuration: 'testArtifacts')
|
|
javaRestTestImplementation project(path: ':modules:ingest-common')
|
|
javaRestTestImplementation project(path: xpackModule('data-streams'))
|
|
}
|
|
|
|
// location for keys and certificates
|
|
File keystoreDir = new File(project.buildDir, 'keystore')
|
|
File nodeKey = file("$keystoreDir/testnode.pem")
|
|
File nodeCert = file("$keystoreDir/testnode.crt")
|
|
// Add key and certs to test classpath: it expects it there
|
|
tasks.register("copyKeyCerts", Copy) {
|
|
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
|
|
}
|
|
// Add keys and cets to test classpath: it expects it there
|
|
sourceSets.javaRestTest.resources.srcDir(keystoreDir)
|
|
tasks.named("processJavaRestTestResources").configure { dependsOn("copyKeyCerts") }
|
|
|
|
javaRestTest {
|
|
dependsOn "copyKeyCerts"
|
|
/*
|
|
* 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'
|
|
}
|
|
|
|
testClusters.all {
|
|
numberOfNodes = 3
|
|
testDistribution = 'DEFAULT'
|
|
|
|
setting 'xpack.security.enabled', 'true'
|
|
setting 'xpack.monitoring.elasticsearch.collection.enabled', 'false'
|
|
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'
|
|
setting 'indices.lifecycle.history_index_enabled', 'false'
|
|
setting 'slm.history_index_enabled', 'false'
|
|
|
|
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
|
|
}
|