Always test against default distribution when in a FIPS JVM (#51273) (#51333)

This commit is contained in:
Mark Vieira 2020-01-23 14:54:57 -08:00 committed by GitHub
parent 1ca5dd13de
commit f86de2a9cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -34,6 +34,8 @@ import org.elasticsearch.gradle.precommit.PrecommitTasks
import org.elasticsearch.gradle.test.ErrorReportingTestListener
import org.elasticsearch.gradle.testclusters.ElasticsearchCluster
import org.elasticsearch.gradle.testclusters.TestClustersPlugin
import org.elasticsearch.gradle.testclusters.TestDistribution
import org.elasticsearch.gradle.tool.Boilerplate
import org.gradle.api.Action
import org.gradle.api.GradleException
import org.gradle.api.InvalidUserDataException
@ -158,6 +160,7 @@ class BuildPlugin implements Plugin<Project> {
NamedDomainObjectContainer<ElasticsearchCluster> testClusters = project.extensions.findByName(TestClustersPlugin.EXTENSION_NAME) as NamedDomainObjectContainer<ElasticsearchCluster>
if (testClusters != null) {
testClusters.all { ElasticsearchCluster cluster ->
cluster.setTestDistribution(TestDistribution.DEFAULT)
cluster.systemProperty 'javax.net.ssl.trustStorePassword', 'password'
cluster.systemProperty 'javax.net.ssl.keyStorePassword', 'password'
// Can't use our DiagnosticTrustManager with SunJSSE in FIPS mode

View File

@ -1,3 +1,5 @@
import org.elasticsearch.gradle.info.BuildParams
// Subprojects aren't published so do not assemble
gradle.projectsEvaluated {
subprojects {
@ -5,6 +7,13 @@ gradle.projectsEvaluated {
if (assemble) {
assemble.enabled = false
}
// Disable example project testing with FIPS JVM
tasks.withType(Test) {
onlyIf {
BuildParams.inFipsJvm == false
}
}
}
}