Skip to content

Commit

Permalink
Always test against default distribution when in a FIPS JVM (#51273) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-vieira committed Jan 23, 2020
1 parent 13d85e6 commit 11fd96d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions plugins/examples/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
import org.elasticsearch.gradle.info.BuildParams

// Subprojects aren't published so do not assemble
gradle.projectsEvaluated {
subprojects {
Task assemble = project.tasks.findByName('assemble')
if (assemble) {
assemble.enabled = false
}

// Disable example project testing with FIPS JVM
tasks.withType(Test) {
onlyIf {
BuildParams.inFipsJvm == false
}
}
}
}

Expand Down

0 comments on commit 11fd96d

Please sign in to comment.