|
| 1 | +apply plugin: 'elasticsearch.standalone-rest-test' |
| 2 | +apply plugin: 'elasticsearch.rest-test' |
| 3 | + |
| 4 | +dependencies { |
| 5 | + testCompile project(path: xpackProject('plugin').path, configuration: 'testArtifacts') |
| 6 | +} |
| 7 | + |
| 8 | +// bring in ILM rest test suite |
| 9 | +task copyILMRestTests(type: Copy) { |
| 10 | + into project.sourceSets.test.output.resourcesDir |
| 11 | + from xpackProject('plugin').sourceSets.test.resources.srcDirs |
| 12 | + include 'rest-api-spec/test/index_lifecycle/**' |
| 13 | +} |
| 14 | + |
| 15 | +def clusterCredentials = [username: System.getProperty('tests.rest.cluster.username', 'test_user'), |
| 16 | + password: System.getProperty('tests.rest.cluster.password', 'x-pack-test-password')] |
| 17 | + |
| 18 | +integTestRunner { |
| 19 | + systemProperty 'tests.rest.cluster.username', clusterCredentials.username |
| 20 | + systemProperty 'tests.rest.cluster.password', clusterCredentials.password |
| 21 | +} |
| 22 | + |
| 23 | +integTestCluster { |
| 24 | + dependsOn copyILMRestTests |
| 25 | + setting 'xpack.index_lifecycle.enabled', 'true' |
| 26 | + setting 'xpack.security.enabled', 'true' |
| 27 | + setting 'xpack.watcher.enabled', 'false' |
| 28 | + setting 'xpack.monitoring.enabled', 'false' |
| 29 | + setting 'xpack.ml.enabled', 'false' |
| 30 | + setting 'xpack.license.self_generated.type', 'trial' |
| 31 | + setupCommand 'setupDummyUser', |
| 32 | + 'bin/elasticsearch-users', |
| 33 | + 'useradd', clusterCredentials.username, |
| 34 | + '-p', clusterCredentials.password, |
| 35 | + '-r', 'superuser' |
| 36 | + waitCondition = { node, ant -> |
| 37 | + File tmpFile = new File(node.cwd, 'wait.success') |
| 38 | + ant.get(src: "http://${node.httpUri()}/_cluster/health?wait_for_nodes=>=${numNodes}&wait_for_status=yellow", |
| 39 | + dest: tmpFile.toString(), |
| 40 | + username: clusterCredentials.username, |
| 41 | + password: clusterCredentials.password, |
| 42 | + ignoreerrors: true, |
| 43 | + retries: 10) |
| 44 | + return tmpFile.exists() |
| 45 | + } |
| 46 | +} |
0 commit comments