|
| 1 | +import org.elasticsearch.gradle.test.RestIntegTestTask |
| 2 | + |
1 | 3 | /*
|
2 | 4 | * Licensed to Elasticsearch under one or more contributor
|
3 | 5 | * license agreements. See the NOTICE file distributed with
|
@@ -106,33 +108,49 @@ File nodeTrustStore = file("./testnode.jks")
|
106 | 108 | File pkiTrustCert = file("./src/test/resources/org/elasticsearch/client/security/delegate_pki/testRootCA.crt")
|
107 | 109 |
|
108 | 110 | integTest.runner {
|
| 111 | + systemProperty 'tests.rest.async', 'false' |
109 | 112 | systemProperty 'tests.rest.cluster.username', System.getProperty('tests.rest.cluster.username', 'test_user')
|
110 | 113 | systemProperty 'tests.rest.cluster.password', System.getProperty('tests.rest.cluster.password', 'test-password')
|
111 | 114 | }
|
112 | 115 |
|
113 |
| -testClusters.integTest { |
114 |
| - testDistribution = 'DEFAULT' |
115 |
| - systemProperty 'es.scripting.update.ctx_in_params', 'false' |
116 |
| - setting 'reindex.remote.whitelist', '[ "[::1]:*", "127.0.0.1:*" ]' |
117 |
| - setting 'xpack.license.self_generated.type', 'trial' |
118 |
| - setting 'xpack.security.enabled', 'true' |
119 |
| - setting 'xpack.security.authc.token.enabled', 'true' |
120 |
| - setting 'xpack.security.authc.api_key.enabled', 'true' |
121 |
| - // Truststore settings are not used since TLS is not enabled. Included for testing the get certificates API |
122 |
| - setting 'xpack.security.http.ssl.certificate_authorities', 'testnode.crt' |
123 |
| - setting 'xpack.security.transport.ssl.truststore.path', 'testnode.jks' |
124 |
| - setting 'xpack.security.authc.realms.file.default_file.order', '0' |
125 |
| - setting 'xpack.security.authc.realms.native.default_native.order', '1' |
126 |
| - setting 'xpack.security.authc.realms.pki.pki1.order', '2' |
127 |
| - setting 'xpack.security.authc.realms.pki.pki1.certificate_authorities', '[ "testRootCA.crt" ]' |
128 |
| - setting 'xpack.security.authc.realms.pki.pki1.delegation.enabled', 'true' |
129 |
| - |
130 |
| - setting 'indices.lifecycle.poll_interval', '1000ms' |
131 |
| - keystore 'xpack.security.transport.ssl.truststore.secure_password', 'testnode' |
132 |
| - user username: System.getProperty('tests.rest.cluster.username', 'test_user'), |
133 |
| - password: System.getProperty('tests.rest.cluster.password', 'test-password') |
134 |
| - |
135 |
| - extraConfigFile nodeCert.name, nodeCert |
136 |
| - extraConfigFile nodeTrustStore.name, nodeTrustStore |
137 |
| - extraConfigFile pkiTrustCert.name, pkiTrustCert |
| 116 | +// TODO: we can't use task avoidance here because RestIntegTestTask does the testcluster creation |
| 117 | +RestIntegTestTask asyncIntegTest = tasks.create("asyncIntegTest", RestIntegTestTask) { |
| 118 | + runner { |
| 119 | + systemProperty 'tests.rest.async', 'true' |
| 120 | + systemProperty 'tests.rest.cluster.username', System.getProperty('tests.rest.cluster.username', 'test_user') |
| 121 | + systemProperty 'tests.rest.cluster.password', System.getProperty('tests.rest.cluster.password', 'test-password') |
| 122 | + } |
| 123 | +} |
| 124 | + |
| 125 | +check.dependsOn(asyncIntegTest) |
| 126 | + |
| 127 | +['integTest', 'asyncIntegTest'].each { integName -> |
| 128 | + testClusters { |
| 129 | + "${integName}" { |
| 130 | + testDistribution = 'DEFAULT' |
| 131 | + systemProperty 'es.scripting.update.ctx_in_params', 'false' |
| 132 | + setting 'reindex.remote.whitelist', '[ "[::1]:*", "127.0.0.1:*" ]' |
| 133 | + setting 'xpack.license.self_generated.type', 'trial' |
| 134 | + setting 'xpack.security.enabled', 'true' |
| 135 | + setting 'xpack.security.authc.token.enabled', 'true' |
| 136 | + setting 'xpack.security.authc.api_key.enabled', 'true' |
| 137 | + // Truststore settings are not used since TLS is not enabled. Included for testing the get certificates API |
| 138 | + setting 'xpack.security.http.ssl.certificate_authorities', 'testnode.crt' |
| 139 | + setting 'xpack.security.transport.ssl.truststore.path', 'testnode.jks' |
| 140 | + setting 'xpack.security.authc.realms.file.default_file.order', '0' |
| 141 | + setting 'xpack.security.authc.realms.native.default_native.order', '1' |
| 142 | + setting 'xpack.security.authc.realms.pki.pki1.order', '2' |
| 143 | + setting 'xpack.security.authc.realms.pki.pki1.certificate_authorities', '[ "testRootCA.crt" ]' |
| 144 | + setting 'xpack.security.authc.realms.pki.pki1.delegation.enabled', 'true' |
| 145 | + |
| 146 | + setting 'indices.lifecycle.poll_interval', '1000ms' |
| 147 | + keystore 'xpack.security.transport.ssl.truststore.secure_password', 'testnode' |
| 148 | + user username: System.getProperty('tests.rest.cluster.username', 'test_user'), |
| 149 | + password: System.getProperty('tests.rest.cluster.password', 'test-password') |
| 150 | + |
| 151 | + extraConfigFile nodeCert.name, nodeCert |
| 152 | + extraConfigFile nodeTrustStore.name, nodeTrustStore |
| 153 | + extraConfigFile pkiTrustCert.name, pkiTrustCert |
| 154 | + } |
| 155 | + } |
138 | 156 | }
|
0 commit comments