Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mute bwc tests for old versions in FIPS JVMs #32839

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,15 @@ class VersionCollection {
*
* @return All earlier versions that should be tested for index BWC with the current version.
*/
List<Version> getIndexCompatible() {
List<Version> 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()
}
Expand Down Expand Up @@ -217,9 +222,13 @@ class VersionCollection {
*
* @return All earlier versions that should be tested for wire BWC with the current version.
*/
List<Version> getWireCompatible() {
List<Version> 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)
Expand All @@ -229,9 +238,9 @@ class VersionCollection {
/**
* Ensures the types of snapshot are not null and are also in the wire compat list
*/
List<Version> getSnapshotsWireCompatible() {
List<Version> getSnapshotsWireCompatible(boolean inFipsJvm = false) {
List<Version> compatSnapshots = []
List<Version> allCompatVersions = getWireCompatible()
List<Version> allCompatVersions = getWireCompatible(inFipsJvm)
if (allCompatVersions.contains(nextMinorSnapshot)) {
compatSnapshots.add(nextMinorSnapshot)
}
Expand Down
5 changes: 2 additions & 3 deletions x-pack/qa/full-cluster-restart/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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"
}
}
Expand Down
8 changes: 0 additions & 8 deletions x-pack/qa/full-cluster-restart/with-system-key/build.gradle
Original file line number Diff line number Diff line change
@@ -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
}
}
5 changes: 2 additions & 3 deletions x-pack/qa/rolling-upgrade/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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"
}
}
Expand Down
7 changes: 0 additions & 7 deletions x-pack/qa/rolling-upgrade/with-system-key/build.gradle
Original file line number Diff line number Diff line change
@@ -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"