Skip to content

Commit

Permalink
Fixing security tests (#477)
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Palis <[email protected]>
  • Loading branch information
joshpalis authored Jan 30, 2024
1 parent 4bfdaa4 commit 69c0c61
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 @@ -216,6 +216,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 @@ -229,14 +232,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 @@ -269,7 +272,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 @@ -376,6 +379,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 69c0c61

Please sign in to comment.