diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/VersionCollection.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/VersionCollection.groovy index 7d5b793254fe4..79a21c8450300 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/VersionCollection.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/VersionCollection.groovy @@ -182,10 +182,15 @@ class VersionCollection { * * @return All earlier versions that should be tested for index BWC with the current version. */ - List getIndexCompatible() { + List getIndexCompatible(boolean inFipsJvm = false) { int actualMajor = (currentVersion.major == 5 ? 2 : currentVersion.major - 1) + Version fromVersion = Version.fromString("${actualMajor}.0.0") + // Versions before 6.4.0 cannot be run in a FIPS 140 JVM, so exclude them + if (inFipsJvm && fromVersion.before("6.4.0")){ + fromVersion = Version.fromString("6.4.0") + } return versionSet - .tailSet(Version.fromString("${actualMajor}.0.0")) + .tailSet(fromVersion) .headSet(currentVersion) .asList() } @@ -217,9 +222,13 @@ class VersionCollection { * * @return All earlier versions that should be tested for wire BWC with the current version. */ - List getWireCompatible() { + List getWireCompatible(boolean inFipsJvm = false) { // Get the last minor of the previous major Version lowerBound = getHighestPreviousMinor(currentVersion.major) + // Versions before 6.4.0 cannot be run in a FIPS 140 JVM, so exclude them + if (inFipsJvm && Version.fromString("${lowerBound.major}.${lowerBound.minor}.0").before("6.4.0")){ + lowerBound = Version.fromString("6.4.0") + } return versionSet .tailSet(Version.fromString("${lowerBound.major}.${lowerBound.minor}.0")) .headSet(currentVersion) @@ -229,9 +238,9 @@ class VersionCollection { /** * Ensures the types of snapshot are not null and are also in the wire compat list */ - List getSnapshotsWireCompatible() { + List getSnapshotsWireCompatible(boolean inFipsJvm = false) { List compatSnapshots = [] - List allCompatVersions = getWireCompatible() + List allCompatVersions = getWireCompatible(inFipsJvm) if (allCompatVersions.contains(nextMinorSnapshot)) { compatSnapshots.add(nextMinorSnapshot) } diff --git a/x-pack/qa/full-cluster-restart/build.gradle b/x-pack/qa/full-cluster-restart/build.gradle index 3cf2970120675..4a1c242a3deed 100644 --- a/x-pack/qa/full-cluster-restart/build.gradle +++ b/x-pack/qa/full-cluster-restart/build.gradle @@ -129,8 +129,7 @@ subprojects { .file('src/test/resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple/testnode.jks') into outputDir } - - for (Version version : bwcVersions.indexCompatible) { + for (Version version : bwcVersions.getIndexCompatible(inFipsJvm)) { String baseName = "v${version}" Task oldClusterTest = tasks.create(name: "${baseName}#oldClusterTest", type: RestIntegTestTask) { @@ -240,7 +239,7 @@ subprojects { // basic integ tests includes testing bwc against the most recent version task integTest { if (project.bwc_tests_enabled) { - for (final def version : bwcVersions.snapshotsIndexCompatible) { + for (final def version : bwcVersions.getSnapshotsWireCompatible(inFipsJvm)) { dependsOn "v${version}#bwcTest" } } diff --git a/x-pack/qa/full-cluster-restart/with-system-key/build.gradle b/x-pack/qa/full-cluster-restart/with-system-key/build.gradle index 928280b6584bd..e69de29bb2d1d 100644 --- a/x-pack/qa/full-cluster-restart/with-system-key/build.gradle +++ b/x-pack/qa/full-cluster-restart/with-system-key/build.gradle @@ -1,8 +0,0 @@ -import org.elasticsearch.gradle.test.RestIntegTestTask - -// Skip test on FIPS FIXME https://github.com/elastic/elasticsearch/issues/32737 -if (project.inFipsJvm) { - tasks.withType(RestIntegTestTask) { - enabled = false - } -} diff --git a/x-pack/qa/rolling-upgrade/build.gradle b/x-pack/qa/rolling-upgrade/build.gradle index b983caa866937..623e5b56261ef 100644 --- a/x-pack/qa/rolling-upgrade/build.gradle +++ b/x-pack/qa/rolling-upgrade/build.gradle @@ -111,8 +111,7 @@ subprojects { .file('src/test/resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple/testnode.jks') into outputDir } - - for (Version version : bwcVersions.wireCompatible) { + for (Version version : bwcVersions.getWireCompatible(inFipsJvm)) { String baseName = "v${version}" Task oldClusterTest = tasks.create(name: "${baseName}#oldClusterTest", type: RestIntegTestTask) { @@ -276,7 +275,7 @@ subprojects { // basic integ tests includes testing bwc against the most recent version task integTest { if (project.bwc_tests_enabled) { - for (final def version : bwcVersions.snapshotsWireCompatible) { + for (final def version : bwcVersions.getSnapshotsWireCompatible(inFipsJvm)) { dependsOn "v${version}#bwcTest" } } diff --git a/x-pack/qa/rolling-upgrade/with-system-key/build.gradle b/x-pack/qa/rolling-upgrade/with-system-key/build.gradle index 5aaa1ed1eff9b..f5639100cc7ee 100644 --- a/x-pack/qa/rolling-upgrade/with-system-key/build.gradle +++ b/x-pack/qa/rolling-upgrade/with-system-key/build.gradle @@ -1,10 +1,3 @@ import org.elasticsearch.gradle.test.RestIntegTestTask -// Skip test on FIPS FIXME https://github.com/elastic/elasticsearch/issues/32737 -if (project.inFipsJvm) { - tasks.withType(RestIntegTestTask) { - enabled = false - } -} - group = "${group}.x-pack.qa.rolling-upgrade.with-system-key"