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

Fixing security tests #477

Merged
merged 2 commits into from
Jan 30, 2024
Merged
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
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") {
dbwiddis marked this conversation as resolved.
Show resolved Hide resolved
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
Loading