Skip to content

Commit

Permalink
[Backport 2.x] Fixing security tests (#479)
Browse files Browse the repository at this point in the history
Fixing security tests (#477)


(cherry picked from commit 69c0c61)

Signed-off-by: Joshua Palis <jpalis@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 2b50758 commit 931f199
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ integTest {
is_https = is_https == null ? 'true' : is_https
user = user == null ? 'admin' : user
password = password == null ? 'admin' : password
System.setProperty("https", is_https)
System.setProperty("user", user)
System.setProperty("password", password)
}
systemProperty('https', is_https)
systemProperty('user', user)
Expand All @@ -228,14 +231,14 @@ integTest {
}

// Exclude integration tests that require security plugin
if (System.getProperty("security.enabled") == null || System.getProperty("security.enabled") == "false") {
if (System.getProperty("https") == null || System.getProperty("https") == "false") {
filter {
excludeTestsMatching "org.opensearch.flowframework.rest.FlowFrameworkSecureRestApiIT"
}
}

// Include only secure integration tests in security enabled clusters
if (System.getProperty("security.enabled") != null && System.getProperty("security.enabled") == "true") {
if (System.getProperty("https") != null && System.getProperty("https") == "true") {
filter {
includeTestsMatching "org.opensearch.flowframework.rest.FlowFrameworkSecureRestApiIT"
excludeTestsMatching "org.opensearch.flowframework.rest.FlowFrameworkRestApiIT"
Expand Down Expand Up @@ -268,7 +271,7 @@ testClusters.integTest {
testDistribution = "ARCHIVE"

// Optionally install security
if (System.getProperty("security.enabled") != null && System.getProperty("security.enabled") == "true") {
if (System.getProperty("https") != null && System.getProperty("https") == "true") {
// Retrieve Security Plugin Zip from zipArchive
configurations.secureIntegTestPluginArchive.asFileTree.each {
if(it.name.contains("opensearch-security")) {
Expand Down Expand Up @@ -375,6 +378,9 @@ task integTestRemote(type: RestIntegTestTask) {
is_https = is_https == null ? 'true' : is_https
user = user == null ? 'admin' : user
password = password == null ? 'admin' : password
System.setProperty("https", is_https)
System.setProperty("user", user)
System.setProperty("password", password)
}
systemProperty('https', is_https)
systemProperty('user', user)
Expand Down

0 comments on commit 931f199

Please sign in to comment.