Skip to content

Commit

Permalink
Test: use trial license in qa tests with security
Browse files Browse the repository at this point in the history
QA tests that use security need to use a trial license instead of a
basic license. Basic licenses do not enable security so these tests are
not running in the expected configuration. This can also lead to issues
that seem completely unrelated such as authentication failures right
after cluster formation.

The authentication failure right after cluster formation happens since
a request makes it past the authentication license checks and the
request starts the authentication process. During authentication the
cluster forms and the license is updated to a basic license, which
disables all realms. The request that is being authenticated then tries
to iterate over the realms, but the realms are empty and the request
cannot be authenticated. This results in a authentication failure even
though the credentials provided are correct.

Closes #30306
  • Loading branch information
jaymode committed May 3, 2018
1 parent a1e23fe commit 9573492
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion x-pack/qa/multi-node/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ integTestCluster {
setting 'xpack.watcher.enabled', 'false'
setting 'xpack.monitoring.enabled', 'false'
setting 'xpack.ml.enabled', 'false'
setting 'logger.org.elasticsearch.xpack.security.authc', 'TRACE'
setting 'xpack.license.self_generated.type', 'trial'
extraConfigFile 'roles.yml', 'roles.yml'
setupCommand 'setup-test-user', 'bin/elasticsearch-users', 'useradd', 'test-user', '-p', 'x-pack-test-password', '-r', 'test'
setupCommand 'setup-super-user', 'bin/elasticsearch-users', 'useradd', 'super-user', '-p', 'x-pack-super-password', '-r', 'superuser'
Expand Down
1 change: 1 addition & 0 deletions x-pack/qa/smoke-test-plugins-ssl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ integTestCluster {
setting 'xpack.monitoring.exporters._http.auth.password', 'x-pack-test-password'
setting 'xpack.monitoring.exporters._http.ssl.verification_mode', 'full'

setting 'xpack.license.self_generated.type', 'trial'
setting 'xpack.security.enabled', 'true'
setting 'xpack.security.http.ssl.enabled', 'true'
setting 'xpack.security.http.ssl.keystore.path', nodeKeystore.name
Expand Down
3 changes: 1 addition & 2 deletions x-pack/qa/smoke-test-plugins/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import org.elasticsearch.gradle.MavenFilteringHack
import org.elasticsearch.gradle.plugin.MetaPluginBuildPlugin
import org.elasticsearch.gradle.plugin.PluginBuildPlugin

apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
Expand All @@ -18,6 +16,7 @@ project(':plugins').getChildProjects().each { pluginName, pluginProject ->

integTestCluster {
setting 'xpack.security.enabled', 'true'
setting 'xpack.license.self_generated.type', 'trial'
setupCommand 'setupDummyUser',
'bin/elasticsearch-users', 'useradd', 'test_user', '-p', 'x-pack-test-password', '-r', 'superuser'
waitCondition = { node, ant ->
Expand Down
2 changes: 2 additions & 0 deletions x-pack/qa/sql/security/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ subprojects {
setting 'xpack.security.audit.enabled', 'true'
setting 'xpack.security.audit.outputs', 'logfile'
setting 'xpack.security.enabled', 'true'
setting 'xpack.license.self_generated.type', 'trial'
// Setup roles used by tests
extraConfigFile 'roles.yml', '../roles.yml'
/* Setup the one admin user that we run the tests as.
Expand All @@ -45,6 +46,7 @@ subprojects {
setting 'xpack.security.audit.enabled', 'true'
setting 'xpack.security.audit.outputs', 'logfile'
setting 'xpack.security.enabled', 'true'
setting 'xpack.license.self_generated.type', 'trial'
// Setup roles used by tests
extraConfigFile 'roles.yml', '../roles.yml'
/* Setup the one admin user that we run the tests as.
Expand Down

0 comments on commit 9573492

Please sign in to comment.