@@ -2,21 +2,21 @@ import java.nio.file.Path
22import java.nio.file.Paths
33import java.nio.file.Files
44
5+ apply plugin : ' elasticsearch.testclusters'
56apply plugin : ' elasticsearch.standalone-rest-test'
67apply plugin : ' elasticsearch.rest-test'
78apply plugin : ' elasticsearch.test.fixtures'
89
910testFixtures. useFixture " :test:fixtures:krb5kdc-fixture"
1011
11- integTest. enabled = true
12-
1312dependencies {
1413 testCompile " org.elasticsearch.plugin:x-pack-core:${ version} "
1514 testCompile project(path : xpackModule(' core' ), configuration : ' testArtifacts' )
1615 testCompile project(path : xpackModule(' security' ), configuration : ' testArtifacts' )
1716}
1817
19- integTestCluster {
18+ testClusters. integTest {
19+ distribution = ' DEFAULT'
2020 // force localhost IPv4 otherwise it is a chicken and egg problem where we need the keytab for the hostname when starting the cluster
2121 // but do not know the exact address that is first in the http ports file
2222 setting ' http.host' , ' 127.0.0.1'
@@ -31,29 +31,17 @@ integTestCluster {
3131 setting ' xpack.security.authc.realms.kerberos.kerberos.krb.debug' , ' true'
3232 setting ' xpack.security.authc.realms.kerberos.kerberos.remove_realm_name' , ' false'
3333
34- jvmArgs + = " -Djava.security.krb5.conf=${ project(':test:fixtures:krb5kdc-fixture').ext.krb5Conf("peppa")} "
35- jvmArgs + = " -Dsun.security.krb5.debug=true"
36-
37- extraConfigFile(" es.keytab" , project(' :test:fixtures:krb5kdc-fixture' ). ext. krb5Keytabs(" peppa" , " HTTP_localhost.keytab" ))
3834
39- setupCommand ' setupTestAdmin ' ,
40- ' bin/elasticsearch-users ' , ' useradd ' , " test_admin " , ' -p ' , ' x-pack-test-password ' , ' -r ' , " superuser "
35+ systemProperty " java.security.krb5.conf " , { project( ' :test:fixtures:krb5kdc-fixture ' ) . ext . krb5Conf( " peppa " ) . toString() }
36+ systemProperty " sun.security.krb5.debug " , " true "
4137
42- waitCondition = { node , ant ->
43- File tmpFile = new File (node. cwd, ' wait.success' )
44- ant. get(src : " http://${ node.httpUri()} /_cluster/health?wait_for_nodes=>=${ numNodes} &wait_for_status=yellow" ,
45- dest : tmpFile. toString(),
46- username : ' test_admin' ,
47- password : ' x-pack-test-password' ,
48- ignoreerrors : true ,
49- retries : 10 )
50- return tmpFile. exists()
51- }
38+ extraConfigFile " es.keytab" , project(' :test:fixtures:krb5kdc-fixture' ). ext. krb5Keytabs(" peppa" , " HTTP_localhost.keytab" )
5239
40+ user username : " test_admin" , password : " x-pack-test-password"
5341}
5442
5543String realm = " BUILD.ELASTIC.CO"
56- integTestRunner {
44+ integTest . runner {
5745 Path peppaKeytab = Paths . get(" ${ project.buildDir} " , " generated-resources" , " keytabs" , " peppa.keytab" )
5846 nonInputProperties. systemProperty ' test.userkt' , " peppa@${ realm} "
5947 nonInputProperties. systemProperty ' test.userkt.keytab' , " ${ peppaKeytab} "
0 commit comments