Add tests for wire compatibility when system key is enabled (elastic/x-pack-elasticsearch#1557)
Reworks the rolling restart tests so they'd have caugh an
incompatibility in the wire protocol that we say between 5.4.0 and
5.4.1.
Original commit: elastic/x-pack-elasticsearch@f5e69cf58ed30b11fae267335130fd02de3e786f
@@ -63,8 +63,10 @@ task copyTestNodeKeystore(type: Copy) {
into outputDir
}
+for (boolean withSystemKey: [true, false]) {
+ String baseNameForSystemKey = (withSystemKey ? 'With' : 'Without') + 'SystemKey'
for (Version version : wireCompatVersions) {
- String baseName = "v${version}"
+ String baseName = "v${version}${baseNameForSystemKey}"
Task oldClusterTest = tasks.create(name: "${baseName}#oldClusterTest", type: RestIntegTestTask) {
mustRunAfter(precommit)
@@ -85,6 +87,13 @@ for (Version version : wireCompatVersions) {
setting 'xpack.ssl.keystore.path', 'testnode.jks'
setting 'xpack.ssl.keystore.password', 'testnode'
extraConfigFile 'testnode.jks', new File(outputDir + '/testnode.jks')
+ if (withSystemKey) {
+ if (version.onOrAfter('5.1.0')) {
+ // The setting didn't exist until 5.1.0
+ setting 'xpack.security.system_key.required', 'true'
+ }
+ extraConfigFile 'x-pack/system_key', 'src/test/resources/system_key'
+ }
}
Task oldClusterTestRunner = tasks.getByName("${baseName}#oldClusterTestRunner")
@@ -105,6 +114,10 @@ for (Version version : wireCompatVersions) {
setting 'xpack.ssl.keystore.path', 'testnode.jks'
setting 'xpack.ssl.keystore.password', 'testnode'
extraConfigFile 'testnode.jks', new File(outputDir + '/testnode.jks')
+ if (withSystemKey) {
+ setting 'xpack.security.system_key.required', 'true'
+ extraConfigFile 'x-pack/system_key', 'src/test/resources/system_key'
+ }
}
Task mixedClusterTestRunner = tasks.getByName("${baseName}#mixedClusterTestRunner")
@@ -126,6 +139,10 @@ for (Version version : wireCompatVersions) {
setting 'xpack.ssl.keystore.path', 'testnode.jks'
setting 'xpack.ssl.keystore.password', 'testnode'
extraConfigFile 'testnode.jks', new File(outputDir + '/testnode.jks')
+ if (withSystemKey) {
+ setting 'xpack.security.system_key.required', 'true'
+ extraConfigFile 'x-pack/system_key', 'src/test/resources/system_key'
+ }
}
Task upgradedClusterTestRunner = tasks.getByName("${baseName}#upgradedClusterTestRunner")
@@ -153,12 +170,16 @@ for (Version version : wireCompatVersions) {
bwcTest.dependsOn(versionBwcTest)
}
+}
test.enabled = false // no unit tests for rolling upgrades, only the rest integration test
// basic integ tests includes testing bwc against the most recent version
task integTest {
- dependsOn = ["v${wireCompatVersions[-1]}#bwcTest"]
+ dependsOn = [
+ "v${wireCompatVersions[-1]}WithSystemKey#bwcTest",
+ "v${wireCompatVersions[-1]}WithoutSystemKey#bwcTest",
+ ]
}
check.dependsOn(integTest)
