59 lines
2.7 KiB
Groovy
59 lines
2.7 KiB
Groovy
import org.elasticsearch.gradle.internal.info.BuildParams
|
|
|
|
apply plugin: 'elasticsearch.internal-yaml-rest-test'
|
|
apply plugin: 'elasticsearch.rest-resources'
|
|
|
|
dependencies {
|
|
yamlRestTestImplementation(testArtifact(project(xpackModule('core'))))
|
|
yamlRestTestImplementation(testArtifact(project(xpackModule('security'))))
|
|
yamlRestTestImplementation(project(':modules:reindex'))
|
|
yamlRestTestImplementation(project(":client:rest-high-level"))
|
|
}
|
|
|
|
tasks.named('yamlRestTestTestingConventions').configure {
|
|
baseClass 'org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase'
|
|
baseClass 'org.elasticsearch.test.rest.ESRestTestCase'
|
|
}
|
|
|
|
tasks.named("forbiddenPatterns").configure {
|
|
exclude '**/*.key'
|
|
exclude '**/*.pem'
|
|
exclude '**/*.p12'
|
|
exclude '**/*.jks'
|
|
}
|
|
|
|
File caFile = project.file('src/yamlRestTest/resources/ssl/ca.crt')
|
|
|
|
testClusters.matching { it.name == "yamlRestTest" }.configureEach {
|
|
testDistribution = 'DEFAULT'
|
|
// Whitelist reindexing from the local node so we can test it.
|
|
extraConfigFile 'http.key', file('src/yamlRestTest/resources/ssl/http.key')
|
|
extraConfigFile 'http.crt', file('src/yamlRestTest/resources/ssl/http.crt')
|
|
extraConfigFile 'ca.crt', caFile
|
|
setting 'reindex.remote.whitelist', '127.0.0.1:*'
|
|
setting 'xpack.security.enabled', 'true'
|
|
setting 'xpack.ml.enabled', 'false'
|
|
setting 'xpack.license.self_generated.type', 'trial'
|
|
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 'reindex.ssl.certificate_authorities', 'ca.crt'
|
|
setting 'xpack.security.autoconfiguration.enabled', 'false'
|
|
|
|
// Workaround for JDK-8212885
|
|
if (BuildParams.runtimeJavaVersion.isJava12Compatible() == false) {
|
|
setting 'reindex.ssl.supported_protocols', 'TLSv1.2'
|
|
}
|
|
|
|
extraConfigFile 'roles.yml', file('roles.yml')
|
|
user username: "test_admin", password: 'x-pack-test-password', role: "superuser"
|
|
user username: "powerful_user", password: 'x-pack-test-password', role: "superuser"
|
|
user username: "minimal_user", password: 'x-pack-test-password', role: "minimal"
|
|
user username: "minimal_with_task_user", password: 'x-pack-test-password', role: "minimal_with_task"
|
|
user username: "readonly_user", password: 'x-pack-test-password', role: "readonly"
|
|
user username: "dest_only_user", password: 'x-pack-test-password', role: "dest_only"
|
|
user username: "can_not_see_hidden_docs_user", password: 'x-pack-test-password', role: "can_not_see_hidden_docs"
|
|
user username: "can_not_see_hidden_fields_user", password: 'x-pack-test-password', role: "can_not_see_hidden_fields"
|
|
}
|