2018-06-15 09:49:14 -04:00
|
|
|
/*
|
|
|
|
* Licensed to Elasticsearch under one or more contributor
|
|
|
|
* license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright
|
|
|
|
* ownership. Elasticsearch licenses this file to you under
|
|
|
|
* the Apache License, Version 2.0 (the "License"); you may
|
|
|
|
* not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing,
|
|
|
|
* software distributed under the License is distributed on an
|
|
|
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
|
|
* KIND, either express or implied. See the License for the
|
|
|
|
* specific language governing permissions and limitations
|
|
|
|
* under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
import org.elasticsearch.gradle.MavenFilteringHack
|
|
|
|
import org.elasticsearch.gradle.test.AntFixture
|
|
|
|
|
|
|
|
apply plugin: 'elasticsearch.standalone-rest-test'
|
|
|
|
apply plugin: 'elasticsearch.rest-test'
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
testCompile project(path: ':plugins:discovery-ec2', configuration: 'runtime')
|
|
|
|
}
|
|
|
|
|
|
|
|
final int ec2NumberOfNodes = 3
|
|
|
|
|
|
|
|
/** A task to start the AmazonEC2Fixture which emulates an EC2 service **/
|
|
|
|
task ec2Fixture(type: AntFixture) {
|
|
|
|
dependsOn compileTestJava
|
|
|
|
env 'CLASSPATH', "${ -> project.sourceSets.test.runtimeClasspath.asPath }"
|
|
|
|
executable = new File(project.runtimeJavaHome, 'bin/java')
|
2019-04-26 11:34:03 -04:00
|
|
|
args 'org.elasticsearch.discovery.ec2.AmazonEC2Fixture', baseDir, "${buildDir}/testclusters/integTest-1/config/unicast_hosts.txt"
|
2018-06-15 09:49:14 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
Map<String, Object> expansions = [
|
|
|
|
'expected_nodes': ec2NumberOfNodes
|
|
|
|
]
|
|
|
|
|
|
|
|
processTestResources {
|
|
|
|
inputs.properties(expansions)
|
|
|
|
MavenFilteringHack.filter(it, expansions)
|
|
|
|
}
|
|
|
|
|
2019-04-26 11:34:03 -04:00
|
|
|
integTest {
|
|
|
|
dependsOn ec2Fixture, project(':plugins:discovery-ec2').bundlePlugin
|
|
|
|
}
|
|
|
|
|
|
|
|
testClusters.integTest {
|
|
|
|
numberOfNodes = ec2NumberOfNodes
|
|
|
|
plugin file(project(':plugins:discovery-ec2').bundlePlugin.archiveFile)
|
|
|
|
|
|
|
|
keystore 'discovery.ec2.access_key', 'ec2_integration_test_access_key'
|
|
|
|
keystore 'discovery.ec2.secret_key', 'ec2_integration_test_secret_key'
|
|
|
|
|
2019-02-05 03:46:52 -05:00
|
|
|
setting 'discovery.seed_providers', 'ec2'
|
2018-11-05 09:02:09 -05:00
|
|
|
setting 'network.host', '_ec2_'
|
2019-04-26 11:34:03 -04:00
|
|
|
setting 'discovery.ec2.endpoint', { "http://${ec2Fixture.addressAndPort}" }
|
2018-11-05 09:02:09 -05:00
|
|
|
|
2019-04-26 11:34:03 -04:00
|
|
|
systemProperty "com.amazonaws.sdk.ec2MetadataServiceEndpointOverride", { "http://${ec2Fixture.addressAndPort}" }
|
2018-06-15 09:49:14 -04:00
|
|
|
}
|