2016-03-07 12:00:30 -05:00
|
|
|
import org.elasticsearch.gradle.MavenFilteringHack
|
|
|
|
import org.elasticsearch.gradle.VersionProperties
|
2015-11-24 20:10:46 -05:00
|
|
|
|
2016-03-07 12:00:30 -05:00
|
|
|
apply plugin: 'elasticsearch.build'
|
2015-11-24 20:10:46 -05:00
|
|
|
|
|
|
|
dependencies {
|
2016-03-07 12:00:30 -05:00
|
|
|
provided "org.elasticsearch:elasticsearch:${versions.elasticsearch}"
|
2017-02-10 14:02:42 -05:00
|
|
|
provided project(path: ':x-pack-elasticsearch:plugin', configuration: 'runtime')
|
2016-08-31 11:48:26 -04:00
|
|
|
|
|
|
|
testCompile "org.elasticsearch.test:framework:${project.versions.elasticsearch}"
|
2017-02-10 14:02:42 -05:00
|
|
|
testCompile project(path: ':x-pack-elasticsearch:transport-client', configuration: 'runtime')
|
2015-11-24 20:10:46 -05:00
|
|
|
}
|
|
|
|
|
2016-03-07 12:00:30 -05:00
|
|
|
Map generateSubstitutions() {
|
|
|
|
def stringSnap = { version ->
|
|
|
|
if (version.endsWith("-SNAPSHOT")) {
|
|
|
|
return version.substring(0, version.length() - 9)
|
|
|
|
}
|
|
|
|
return version
|
|
|
|
}
|
|
|
|
return [
|
|
|
|
'version': stringSnap(version),
|
|
|
|
'xpack.version': stringSnap(VersionProperties.elasticsearch),
|
|
|
|
'java.version': targetCompatibility as String
|
|
|
|
]
|
|
|
|
}
|
2015-11-24 20:10:46 -05:00
|
|
|
|
2016-04-12 09:19:07 -04:00
|
|
|
String outputDir = "generated-resources/${project.name}"
|
|
|
|
task copyXPackPluginProps(type: Copy) {
|
2017-02-10 14:02:42 -05:00
|
|
|
from project(':x-pack-elasticsearch:plugin').file('src/main/plugin-metadata')
|
|
|
|
from project(':x-pack-elasticsearch:plugin').tasks.pluginProperties
|
2016-04-12 09:19:07 -04:00
|
|
|
into outputDir
|
|
|
|
}
|
|
|
|
project.sourceSets.test.output.dir(outputDir, builtBy: copyXPackPluginProps)
|
|
|
|
|
2016-03-07 12:00:30 -05:00
|
|
|
processResources {
|
|
|
|
MavenFilteringHack.filter(it, generateSubstitutions())
|
|
|
|
}
|
|
|
|
|
|
|
|
task buildZip(type:Zip, dependsOn: [jar]) {
|
2016-03-30 03:07:57 -04:00
|
|
|
from 'build/resources/main/x-pack-extension-descriptor.properties'
|
2016-06-02 08:43:00 -04:00
|
|
|
from 'build/resources/main/x-pack-extension-security.policy'
|
2016-03-07 12:00:30 -05:00
|
|
|
from project.jar
|
|
|
|
}
|
|
|
|
|
2017-04-17 19:04:09 -04:00
|
|
|
task integTest(type: org.elasticsearch.gradle.test.RestIntegTestTask) {
|
2017-02-22 03:56:52 -05:00
|
|
|
mustRunAfter precommit
|
|
|
|
}
|
|
|
|
|
|
|
|
integTestRunner {
|
2016-12-21 16:05:43 -05:00
|
|
|
systemProperty 'tests.security.manager', 'false'
|
2017-02-22 03:56:52 -05:00
|
|
|
}
|
|
|
|
integTestCluster {
|
2017-04-17 19:04:09 -04:00
|
|
|
dependsOn buildZip
|
2017-02-22 03:56:52 -05:00
|
|
|
plugin ':x-pack-elasticsearch:plugin'
|
|
|
|
setting 'xpack.security.authc.realms.custom.order', '0'
|
|
|
|
setting 'xpack.security.authc.realms.custom.type', 'custom'
|
|
|
|
setting 'xpack.security.authc.realms.custom.filtered_setting', 'should be filtered'
|
|
|
|
setting 'xpack.security.authc.realms.esusers.order', '1'
|
|
|
|
setting 'xpack.security.authc.realms.esusers.type', 'file'
|
2017-03-01 12:20:34 -05:00
|
|
|
setting 'xpack.security.authc.realms.native.type', 'native'
|
|
|
|
setting 'xpack.security.authc.realms.native.order', '2'
|
2017-03-02 12:01:05 -05:00
|
|
|
setting 'xpack.ml.enabled', 'false'
|
2015-11-24 20:10:46 -05:00
|
|
|
|
2017-02-22 03:56:52 -05:00
|
|
|
setupCommand 'setupDummyUser',
|
|
|
|
'bin/x-pack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'superuser'
|
|
|
|
setupCommand 'installExtension',
|
|
|
|
'bin/x-pack/extension', 'install', 'file:' + buildZip.archivePath
|
|
|
|
waitCondition = { node, ant ->
|
|
|
|
File tmpFile = new File(node.cwd, 'wait.success')
|
2017-03-15 13:23:26 -04:00
|
|
|
ant.get(src: "http://${node.httpUri()}/_cluster/health?wait_for_nodes=>=${numNodes}&wait_for_status=yellow",
|
2017-02-22 03:56:52 -05:00
|
|
|
dest: tmpFile.toString(),
|
|
|
|
username: 'test_user',
|
|
|
|
password: 'changeme',
|
|
|
|
ignoreerrors: true,
|
|
|
|
retries: 10)
|
|
|
|
return tmpFile.exists()
|
2015-11-24 20:10:46 -05:00
|
|
|
}
|
|
|
|
}
|
2016-03-07 12:00:30 -05:00
|
|
|
check.dependsOn integTest
|