2015-12-04 02:36:35 -05:00
|
|
|
import org.elasticsearch.gradle.MavenFilteringHack
|
2019-10-08 07:39:58 -04:00
|
|
|
|
2019-04-04 06:44:03 -04:00
|
|
|
import org.elasticsearch.gradle.http.WaitForHttpResource
|
2015-11-25 03:13:59 -05:00
|
|
|
|
2019-06-20 02:21:29 -04:00
|
|
|
apply plugin: 'elasticsearch.testclusters'
|
2017-01-04 14:27:53 -05:00
|
|
|
apply plugin: 'elasticsearch.standalone-rest-test'
|
2015-11-24 23:19:04 -05:00
|
|
|
apply plugin: 'elasticsearch.rest-test'
|
|
|
|
|
|
|
|
dependencies {
|
2019-06-04 16:50:23 -04:00
|
|
|
testCompile project(':x-pack:plugin:core')
|
2015-11-24 23:19:04 -05:00
|
|
|
}
|
|
|
|
|
2018-04-26 18:36:14 -04:00
|
|
|
String outputDir = "${buildDir}/generated-resources/${project.name}"
|
2016-04-12 09:19:07 -04:00
|
|
|
task copyXPackPluginProps(type: Copy) {
|
2018-01-27 00:48:30 -05:00
|
|
|
from project(xpackModule('core')).file('src/main/plugin-metadata')
|
|
|
|
from project(xpackModule('core')).tasks.pluginProperties
|
2016-04-12 09:19:07 -04:00
|
|
|
into outputDir
|
|
|
|
}
|
|
|
|
project.sourceSets.test.output.dir(outputDir, builtBy: copyXPackPluginProps)
|
|
|
|
|
2016-02-08 08:33:27 -05:00
|
|
|
// location of generated keystores and certificates
|
|
|
|
File keystoreDir = new File(project.buildDir, 'keystore')
|
2018-07-24 05:48:14 -04:00
|
|
|
File nodeKeystore = file("$keystoreDir/testnode.jks")
|
|
|
|
File nodeKey = file("$keystoreDir/testnode.pem")
|
|
|
|
File nodeCert = file("$keystoreDir/testnode.crt")
|
|
|
|
File clientKeyStore = file("$keystoreDir/testclient.jks")
|
|
|
|
File clientKey = file("$keystoreDir/testclient.pem")
|
|
|
|
File clientCert = file("$keystoreDir/testclient.crt")
|
2016-02-08 08:33:27 -05:00
|
|
|
|
2018-07-24 05:48:14 -04:00
|
|
|
// Add keystores to test classpath: it expects it there
|
|
|
|
task copyKeyCerts(type: Copy) {
|
|
|
|
from('./') {
|
2019-11-14 06:01:23 -05:00
|
|
|
include '*.crt', '*.pem', '*.jks'
|
2016-02-08 08:33:27 -05:00
|
|
|
}
|
2018-07-24 05:48:14 -04:00
|
|
|
into keystoreDir
|
2016-02-08 08:33:27 -05:00
|
|
|
}
|
|
|
|
// Add keystores to test classpath: it expects it there
|
|
|
|
sourceSets.test.resources.srcDir(keystoreDir)
|
2018-07-24 05:48:14 -04:00
|
|
|
processTestResources.dependsOn(copyKeyCerts)
|
2015-11-25 03:13:59 -05:00
|
|
|
|
2019-06-20 02:21:29 -04:00
|
|
|
integTest.runner.dependsOn(copyKeyCerts)
|
2017-09-14 14:18:54 -04:00
|
|
|
|
2019-06-20 02:21:29 -04:00
|
|
|
def pluginsCount = 0
|
|
|
|
testClusters.integTest {
|
2019-07-15 20:53:05 -04:00
|
|
|
testDistribution = 'DEFAULT'
|
2018-02-23 10:33:34 -05:00
|
|
|
setting 'xpack.monitoring.collection.interval', '1s'
|
2017-02-22 03:56:52 -05:00
|
|
|
|
2018-05-03 12:33:08 -04:00
|
|
|
setting 'xpack.license.self_generated.type', 'trial'
|
2018-03-21 23:09:44 -04:00
|
|
|
setting 'xpack.security.enabled', 'true'
|
2017-02-22 03:56:52 -05:00
|
|
|
setting 'xpack.security.http.ssl.enabled', 'true'
|
2018-07-24 05:48:14 -04:00
|
|
|
setting 'xpack.security.http.ssl.key', 'testnode.pem'
|
|
|
|
setting 'xpack.security.http.ssl.certificate', 'testnode.crt'
|
2019-01-14 16:06:22 -05:00
|
|
|
setting 'xpack.security.http.ssl.certificate_authorities', 'testnode.crt'
|
2019-06-20 02:21:29 -04:00
|
|
|
keystore 'xpack.security.http.ssl.secure_key_passphrase', 'testnode'
|
2017-02-22 03:56:52 -05:00
|
|
|
|
2017-03-02 12:01:05 -05:00
|
|
|
setting 'xpack.ml.enabled', 'false'
|
2018-07-24 05:48:14 -04:00
|
|
|
// copy keystores, keys and certificates into config/
|
2017-02-22 03:56:52 -05:00
|
|
|
extraConfigFile nodeKeystore.name, nodeKeystore
|
2018-07-24 05:48:14 -04:00
|
|
|
extraConfigFile nodeKey.name, nodeKey
|
|
|
|
extraConfigFile nodeCert.name, nodeCert
|
2017-02-22 03:56:52 -05:00
|
|
|
extraConfigFile clientKeyStore.name, clientKeyStore
|
2018-07-24 05:48:14 -04:00
|
|
|
extraConfigFile clientKey.name, clientKey
|
|
|
|
extraConfigFile clientCert.name, clientCert
|
2017-02-22 03:56:52 -05:00
|
|
|
|
2019-06-20 02:21:29 -04:00
|
|
|
user username: "test_user", password: "x-pack-test-password"
|
|
|
|
user username: "monitoring_agent", password: "x-pack-test-password", role: "remote_monitoring_agent"
|
2017-02-22 03:56:52 -05:00
|
|
|
|
2019-06-20 02:21:29 -04:00
|
|
|
project(':plugins').getChildProjects().each { pluginName, pluginProject ->
|
2020-04-13 11:53:35 -04:00
|
|
|
plugin pluginProject.tasks.bundlePlugin.archiveFile
|
2019-06-20 02:21:29 -04:00
|
|
|
tasks.integTest.dependsOn pluginProject.tasks.bundlePlugin
|
|
|
|
pluginsCount += 1
|
2015-11-24 23:19:04 -05:00
|
|
|
}
|
2015-11-28 21:07:37 -05:00
|
|
|
}
|
2015-12-04 02:36:35 -05:00
|
|
|
|
|
|
|
ext.expansions = [
|
|
|
|
'expected.plugins.count': pluginsCount
|
|
|
|
]
|
|
|
|
|
|
|
|
processTestResources {
|
|
|
|
from(sourceSets.test.resources.srcDirs) {
|
2017-05-17 21:07:42 -04:00
|
|
|
include '**/*.yml'
|
2015-12-04 02:36:35 -05:00
|
|
|
inputs.properties(expansions)
|
|
|
|
MavenFilteringHack.filter(it, expansions)
|
|
|
|
}
|
2018-08-21 20:03:28 -04:00
|
|
|
}
|