build.gradle 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. apply plugin: 'elasticsearch.standalone-rest-test'
  2. apply plugin: 'elasticsearch.rest-test'
  3. dependencies {
  4. testCompile project(path: xpackModule('core'), configuration: 'runtime')
  5. testCompile project(path: xpackModule('security'), configuration: 'runtime')
  6. testCompile project(path: xpackProject('transport-client').path, configuration: 'runtime')
  7. }
  8. integTestCluster {
  9. setting 'xpack.security.enabled', 'true'
  10. setting 'xpack.license.self_generated.type', 'trial'
  11. extraConfigFile 'roles.yml', 'roles.yml'
  12. [
  13. test_admin: 'superuser',
  14. transport_user: 'superuser',
  15. existing: 'superuser',
  16. bob: 'actual_role'
  17. ].each { String user, String role ->
  18. setupCommand 'setupUser#' + user,
  19. 'bin/elasticsearch-users', 'useradd', user, '-p', 'x-pack-test-password', '-r', role
  20. }
  21. waitCondition = { node, ant ->
  22. File tmpFile = new File(node.cwd, 'wait.success')
  23. ant.get(src: "http://${node.httpUri()}/_cluster/health?wait_for_nodes=>=${numNodes}&wait_for_status=yellow",
  24. dest: tmpFile.toString(),
  25. username: 'test_admin',
  26. password: 'x-pack-test-password',
  27. ignoreerrors: true,
  28. retries: 10)
  29. return tmpFile.exists()
  30. }
  31. }