Skip to content

Commit 7d4957e

Browse files
authored
TestClusters: convert kerberos-tests (#43232) (#43611)
Looks like cluster formation tasks no longer plays nice wit test.fixtures so we just convert this to use testclusters.
1 parent 58a1a1d commit 7d4957e

File tree

1 file changed

+8
-20
lines changed

1 file changed

+8
-20
lines changed

x-pack/qa/kerberos-tests/build.gradle

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@ import java.nio.file.Path
22
import java.nio.file.Paths
33
import java.nio.file.Files
44

5+
apply plugin: 'elasticsearch.testclusters'
56
apply plugin: 'elasticsearch.standalone-rest-test'
67
apply plugin: 'elasticsearch.rest-test'
78
apply plugin: 'elasticsearch.test.fixtures'
89

910
testFixtures.useFixture ":test:fixtures:krb5kdc-fixture"
1011

11-
integTest.enabled = true
12-
1312
dependencies {
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

5543
String 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

Comments
 (0)