Skip to content

Commit b107758

Browse files
Only download demo certs when integTest run with -Dsecurity.enabled=true (#737) (#740)
* Only download demo certs when integTest run with -Dsecurity.enabled=true * Make consistent with security.enabled --------- (cherry picked from commit 740d707) Signed-off-by: Craig Perkins <cwperx@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>
1 parent 6e0e2db commit b107758

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

.github/workflows/test-with-security.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ jobs:
2929
- name: Run Job-scheduler Integ Tests with Security
3030
run: |
3131
echo "Running integ tests with security..."
32-
./gradlew :integTest --tests "*RestIT" -Dhttps=true -Dsecurity=true -Dtests.opensearch.secure=true -Dtests.opensearch.username=admin -Dtests.opensearch.password=admin -Duser=admin -Dpassword=admin
32+
./gradlew :integTest --tests "*RestIT" -Dhttps=true -Dsecurity.enabled=true -Dtests.opensearch.secure=true -Dtests.opensearch.username=admin -Dtests.opensearch.password=admin -Duser=admin -Dpassword=admin

build.gradle

+14-11
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,18 @@ ext {
5151
licenseFile = rootProject.file('LICENSE.txt')
5252
noticeFile = rootProject.file('NOTICE')
5353

54-
['esnode.pem', 'esnode-key.pem', 'kirk.pem', 'kirk-key.pem', 'root-ca.pem', 'sample.pem', 'test-kirk.jks'].forEach { file ->
55-
File local = getLayout().getBuildDirectory().file(file).get().getAsFile()
56-
download.run {
57-
src "https://raw.githubusercontent.com/opensearch-project/security/refs/heads/main/bwc-test/src/test/resources/security/" + file
58-
dest local
59-
overwrite false
60-
}
61-
processResources {
62-
from(local)
54+
runIntegTestWithSecurityPlugin= System.getProperty("security.enabled")
55+
if (runIntegTestWithSecurityPlugin == "true"){
56+
['esnode.pem', 'esnode-key.pem', 'kirk.pem', 'kirk-key.pem', 'root-ca.pem', 'sample.pem', 'test-kirk.jks'].forEach { file ->
57+
File local = getLayout().getBuildDirectory().file(file).get().getAsFile()
58+
download.run {
59+
src "https://raw.githubusercontent.com/opensearch-project/security/refs/heads/main/bwc-test/src/test/resources/security/" + file
60+
dest local
61+
overwrite false
62+
}
63+
processResources {
64+
from(local)
65+
}
6366
}
6467
}
6568
}
@@ -278,7 +281,7 @@ def securityPluginFile = resolvePluginFile("opensearch-security")
278281

279282
// === Setup security test ===
280283
// This flag indicates the existence of security plugin
281-
def securityEnabled = System.getProperty("security", "false") == "true" || System.getProperty("https", "false") == "true"
284+
def securityEnabled = System.getProperty("security.enabled", "false") == "true" || System.getProperty("https", "false") == "true"
282285
afterEvaluate {
283286
testClusters.integTest.nodes.each { node ->
284287
def plugins = node.plugins
@@ -357,7 +360,7 @@ task integTestRemote(type: RestIntegTestTask) {
357360
systemProperty 'java.io.tmpdir', opensearch_tmp_dir.absolutePath
358361

359362
systemProperty "https", System.getProperty("https")
360-
systemProperty "security", System.getProperty("security")
363+
systemProperty "security.enabled", System.getProperty("security.enabled")
361364
systemProperty "user", System.getProperty("user")
362365
systemProperty "password", System.getProperty("password")
363366
systemProperty 'tests.rest.cluster', 'localhost:9200'

0 commit comments

Comments
 (0)