From 2e1463ab6629982a4f3a63e7e3586693729bc01c Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Mon, 15 Apr 2019 16:44:13 +0300 Subject: [PATCH] Add FIPS specific testclusters configuration ClusterFormationTasks auto configured these properties for clusters. This PR adds FIPS specific configuration across all test clusters from the main build script to prevent coupling betwwen testclusters and the build plugin. Closes #40904 --- build.gradle | 15 +++++++++++++++ .../org/elasticsearch/gradle/BuildPlugin.groovy | 6 ------ modules/reindex/build.gradle | 6 ------ 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/build.gradle b/build.gradle index c6ace445e9310..8e05cf17ce0c3 100644 --- a/build.gradle +++ b/build.gradle @@ -598,6 +598,21 @@ allprojects { } } +subprojects { + // Common config when running with a FIPS-140 runtime JVM + if (project.ext.has("inFipsJvm") && project.ext.inFipsJvm) { + tasks.withType(Test) { + systemProperty 'javax.net.ssl.trustStorePassword', 'password' + systemProperty 'javax.net.ssl.keyStorePassword', 'password' + } + project.pluginManager.withPlugin("elasticsearch.testclusters") { + project.testClusters.all { + systemProperty 'javax.net.ssl.trustStorePassword', 'password' + systemProperty 'javax.net.ssl.keyStorePassword', 'password' + } + } + } +} diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy index 3d8ba1f3b36a5..262f882ddd1d8 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy @@ -972,12 +972,6 @@ class BuildPlugin implements Plugin { // TODO: remove this once ctx isn't added to update script params in 7.0 systemProperty 'es.scripting.update.ctx_in_params', 'false' - // Set the system keystore/truststore password if we're running tests in a FIPS-140 JVM - if (project.inFipsJvm) { - systemProperty 'javax.net.ssl.trustStorePassword', 'password' - systemProperty 'javax.net.ssl.keyStorePassword', 'password' - } - testLogging { showExceptions = true showCauses = true diff --git a/modules/reindex/build.gradle b/modules/reindex/build.gradle index 48888d1bfce99..da184deedaa11 100644 --- a/modules/reindex/build.gradle +++ b/modules/reindex/build.gradle @@ -95,12 +95,6 @@ dependencies { es090 'org.elasticsearch:elasticsearch:0.90.13@zip' } -// Issue tracked in https://github.com/elastic/elasticsearch/issues/40904 -if (project.inFipsJvm) { - testingConventions.enabled = false - integTest.enabled = false -} - if (Os.isFamily(Os.FAMILY_WINDOWS)) { logger.warn("Disabling reindex-from-old tests because we can't get the pid file on windows") integTest.runner {