mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-26 14:54:56 +00:00
This change disables security for trial licenses unless security is explicitly enabled in the settings. This is done to facilitate users getting started and not having to deal with some of the complexities involved in getting security configured. In order to do this and avoid disabling security for existing users that have gold or platinum licenses, we have to disable security after cluster formation so that the license can be retrieved. relates elastic/x-pack-elasticsearch#4078 Original commit: elastic/x-pack-elasticsearch@96bdb889fc
53 lines
2.3 KiB
Groovy
53 lines
2.3 KiB
Groovy
apply plugin: 'elasticsearch.standalone-rest-test'
|
|
apply plugin: 'elasticsearch.rest-test'
|
|
|
|
dependencies {
|
|
testCompile project(path: xpackModule('core'), configuration: 'runtime')
|
|
}
|
|
|
|
// bring in watcher rest test suite
|
|
task copyWatcherRestTests(type: Copy) {
|
|
into project.sourceSets.test.output.resourcesDir
|
|
from project(xpackProject('plugin').path).sourceSets.test.resources.srcDirs
|
|
include 'rest-api-spec/test/watcher/**'
|
|
}
|
|
|
|
integTestRunner {
|
|
systemProperty 'tests.rest.blacklist',
|
|
['hijack/10_basic/*',
|
|
'getting_started/10_monitor_cluster_health/Getting started - Monitor cluster health'].join(',')
|
|
}
|
|
|
|
integTestCluster {
|
|
dependsOn copyWatcherRestTests
|
|
setting 'xpack.monitoring.enabled', 'false'
|
|
setting 'xpack.ml.enabled', 'false'
|
|
setting 'xpack.security.enabled', 'true'
|
|
// settings to test settings filtering on
|
|
setting 'xpack.notification.email.account._email.smtp.host', 'host.domain'
|
|
setting 'xpack.notification.email.account._email.smtp.port', '587'
|
|
setting 'xpack.notification.email.account._email.smtp.user', '_user'
|
|
setting 'xpack.notification.email.account._email.smtp.password', '_passwd'
|
|
setting 'xpack.license.self_generated.type', 'trial'
|
|
plugin xpackProject('plugin').path
|
|
extraConfigFile 'x-pack/roles.yml', 'roles.yml'
|
|
setupCommand 'setupTestAdminUser',
|
|
'bin/x-pack/users', 'useradd', 'test_admin', '-p', 'x-pack-test-password', '-r', 'superuser'
|
|
setupCommand 'setupXpackUserForTests',
|
|
'bin/x-pack/users', 'useradd', 'x_pack_rest_user', '-p', 'x-pack-test-password', '-r', 'watcher_manager'
|
|
setupCommand 'setupWatcherManagerUser',
|
|
'bin/x-pack/users', 'useradd', 'watcher_manager', '-p', 'x-pack-test-password', '-r', 'watcher_manager'
|
|
setupCommand 'setupPowerlessUser',
|
|
'bin/x-pack/users', 'useradd', 'powerless_user', '-p', 'x-pack-test-password', '-r', 'crappy_role'
|
|
waitCondition = { node, ant ->
|
|
File tmpFile = new File(node.cwd, 'wait.success')
|
|
ant.get(src: "http://${node.httpUri()}/_cluster/health?wait_for_nodes=>=${numNodes}&wait_for_status=yellow",
|
|
dest: tmpFile.toString(),
|
|
username: 'test_admin',
|
|
password: 'x-pack-test-password',
|
|
ignoreerrors: true,
|
|
retries: 10)
|
|
return tmpFile.exists()
|
|
}
|
|
}
|