49 lines
2.0 KiB
Groovy
49 lines
2.0 KiB
Groovy
|
import org.elasticsearch.gradle.http.WaitForHttpResource
|
||
|
|
||
|
apply plugin: 'elasticsearch.standalone-rest-test'
|
||
|
apply plugin: 'elasticsearch.rest-test'
|
||
|
|
||
|
dependencies {
|
||
|
// "org.elasticsearch.plugin:x-pack-core:${version}" doesn't work with idea because the testArtifacts are also here
|
||
|
testCompile project(path: xpackModule('core'), configuration: 'default')
|
||
|
testCompile project(path: xpackModule('security'), configuration: 'testArtifacts')
|
||
|
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
|
||
|
}
|
||
|
|
||
|
forbiddenPatterns {
|
||
|
exclude '**/*.key'
|
||
|
exclude '**/*.p12'
|
||
|
}
|
||
|
|
||
|
File caFile = project.file('src/test/resources/ssl/ca.crt')
|
||
|
|
||
|
integTestCluster {
|
||
|
numNodes=2
|
||
|
|
||
|
extraConfigFile 'http.key', project.projectDir.toPath().resolve('src/test/resources/ssl/http.key')
|
||
|
extraConfigFile 'http.crt', project.projectDir.toPath().resolve('src/test/resources/ssl/http.crt')
|
||
|
extraConfigFile 'transport.key', project.projectDir.toPath().resolve('src/test/resources/ssl/transport.key')
|
||
|
extraConfigFile 'transport.crt', project.projectDir.toPath().resolve('src/test/resources/ssl/transport.crt')
|
||
|
extraConfigFile 'ca.crt', caFile
|
||
|
|
||
|
setting 'xpack.ilm.enabled', 'false'
|
||
|
setting 'xpack.ml.enabled', 'false'
|
||
|
setting 'xpack.license.self_generated.type', 'basic'
|
||
|
setting 'xpack.security.http.ssl.enabled', 'true'
|
||
|
setting 'xpack.security.http.ssl.certificate', 'http.crt'
|
||
|
setting 'xpack.security.http.ssl.key', 'http.key'
|
||
|
setting 'xpack.security.http.ssl.key_passphrase', 'http-password'
|
||
|
setting 'xpack.security.transport.ssl.enabled', 'true'
|
||
|
setting 'xpack.security.transport.ssl.certificate', 'transport.crt'
|
||
|
setting 'xpack.security.transport.ssl.key', 'transport.key'
|
||
|
setting 'xpack.security.transport.ssl.key_passphrase', 'transport-password'
|
||
|
setting 'xpack.security.transport.ssl.certificate_authorities', 'ca.crt'
|
||
|
|
||
|
waitCondition = { node, ant ->
|
||
|
WaitForHttpResource http = new WaitForHttpResource("https", node.httpUri(), numNodes)
|
||
|
http.setCertificateAuthorities(caFile)
|
||
|
return http.wait(5000)
|
||
|
}
|
||
|
}
|
||
|
|