Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

build/tests: new tests.ssl option to force SSL when supported (#4454)

David Smileyab4564b746ed
diff --git a/gradle/testing/randomization.gradle b/gradle/testing/randomization.gradle
index 83d71e7e907..2bf7d2ae965 100644
--- a/gradle/testing/randomization.gradle
+++ b/gradle/testing/randomization.gradle
@@ -133,6 +133,7 @@ configure(allprojects.findAll {project -> project.path.startsWith(":solr")}) {
testOptions += [
[propName: 'tests.src.home', value: null, description: "See SOLR-14023."],
[propName: 'solr.tests.use.numeric.points', value: null, description: "Point implementation to use (true=numerics, false=trie)."],
+ [propName: 'tests.ssl', value: false, description: "Force SSL on for all tests that support it (respects @SuppressSSL)."],
]
}
}
diff --git a/solr/test-framework/src/java/org/apache/solr/util/RandomizeSSL.java b/solr/test-framework/src/java/org/apache/solr/util/RandomizeSSL.java
index 54e19285363..1e8afd0a506 100644
--- a/solr/test-framework/src/java/org/apache/solr/util/RandomizeSSL.java
+++ b/solr/test-framework/src/java/org/apache/solr/util/RandomizeSSL.java
@@ -126,6 +126,10 @@ public @interface RandomizeSSL {
LuceneTestCase.TEST_NIGHTLY,
LuceneTestCase.RANDOM_MULTIPLIER));
+ if (Boolean.getBoolean("tests.ssl") && ssl > 0.0D) {
+ return new SSLTestConfig(true, useClientAuth);
+ }
+
return new SSLTestConfig(useSSL, useClientAuth);
}