build.gradle 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. apply plugin: 'elasticsearch.standalone-rest-test'
  2. apply plugin: 'elasticsearch.rest-test'
  3. dependencies {
  4. // "org.elasticsearch.plugin:x-pack-core:${version}" doesn't work with idea because the testArtifacts are also here
  5. testCompile project(path: xpackModule('core'), configuration: 'default')
  6. testCompile project(path: xpackModule('security'), configuration: 'testArtifacts')
  7. testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
  8. testCompile project(path: ':modules:reindex')
  9. }
  10. integTestCluster {
  11. // Whitelist reindexing from the local node so we can test it.
  12. setting 'reindex.remote.whitelist', '127.0.0.1:*'
  13. setting 'xpack.security.enabled', 'true'
  14. setting 'xpack.ml.enabled', 'false'
  15. setting 'xpack.license.self_generated.type', 'trial'
  16. extraConfigFile 'roles.yml', 'roles.yml'
  17. [
  18. test_admin: 'superuser',
  19. powerful_user: 'superuser',
  20. minimal_user: 'minimal',
  21. readonly_user: 'readonly',
  22. dest_only_user: 'dest_only',
  23. can_not_see_hidden_docs_user: 'can_not_see_hidden_docs',
  24. can_not_see_hidden_fields_user: 'can_not_see_hidden_fields',
  25. ].each { String user, String role ->
  26. setupCommand 'setupUser#' + user,
  27. 'bin/elasticsearch-users', 'useradd', user, '-p', 'x-pack-test-password', '-r', role
  28. }
  29. waitCondition = { node, ant ->
  30. File tmpFile = new File(node.cwd, 'wait.success')
  31. ant.get(src: "http://${node.httpUri()}/_cluster/health?wait_for_nodes=>=${numNodes}&wait_for_status=yellow",
  32. dest: tmpFile.toString(),
  33. username: 'test_admin',
  34. password: 'x-pack-test-password',
  35. ignoreerrors: true,
  36. retries: 10)
  37. return tmpFile.exists()
  38. }
  39. }