diff --git a/.github/workflows/test-with-security.yml b/.github/workflows/test-with-security.yml index d2a0938c..34cd2450 100644 --- a/.github/workflows/test-with-security.yml +++ b/.github/workflows/test-with-security.yml @@ -29,4 +29,4 @@ jobs: - name: Run Job-scheduler Integ Tests with Security run: | echo "Running integ tests with security..." - ./gradlew :integTest --tests "*RestIT" -Dhttps=true -Dsecurity=true -Dtests.opensearch.secure=true -Dtests.opensearch.username=admin -Dtests.opensearch.password=admin -Duser=admin -Dpassword=admin + ./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 diff --git a/build.gradle b/build.gradle index 3443796e..44238a45 100644 --- a/build.gradle +++ b/build.gradle @@ -51,15 +51,18 @@ ext { licenseFile = rootProject.file('LICENSE.txt') noticeFile = rootProject.file('NOTICE') - ['esnode.pem', 'esnode-key.pem', 'kirk.pem', 'kirk-key.pem', 'root-ca.pem', 'sample.pem', 'test-kirk.jks'].forEach { file -> - File local = getLayout().getBuildDirectory().file(file).get().getAsFile() - download.run { - src "https://raw.githubusercontent.com/opensearch-project/security/refs/heads/main/bwc-test/src/test/resources/security/" + file - dest local - overwrite false - } - processResources { - from(local) + runIntegTestWithSecurityPlugin= System.getProperty("security.enabled") + if (runIntegTestWithSecurityPlugin == "true"){ + ['esnode.pem', 'esnode-key.pem', 'kirk.pem', 'kirk-key.pem', 'root-ca.pem', 'sample.pem', 'test-kirk.jks'].forEach { file -> + File local = getLayout().getBuildDirectory().file(file).get().getAsFile() + download.run { + src "https://raw.githubusercontent.com/opensearch-project/security/refs/heads/main/bwc-test/src/test/resources/security/" + file + dest local + overwrite false + } + processResources { + from(local) + } } } } @@ -278,7 +281,7 @@ def securityPluginFile = resolvePluginFile("opensearch-security") // === Setup security test === // This flag indicates the existence of security plugin -def securityEnabled = System.getProperty("security", "false") == "true" || System.getProperty("https", "false") == "true" +def securityEnabled = System.getProperty("security.enabled", "false") == "true" || System.getProperty("https", "false") == "true" afterEvaluate { testClusters.integTest.nodes.each { node -> def plugins = node.plugins @@ -357,7 +360,7 @@ task integTestRemote(type: RestIntegTestTask) { systemProperty 'java.io.tmpdir', opensearch_tmp_dir.absolutePath systemProperty "https", System.getProperty("https") - systemProperty "security", System.getProperty("security") + systemProperty "security.enabled", System.getProperty("security.enabled") systemProperty "user", System.getProperty("user") systemProperty "password", System.getProperty("password") systemProperty 'tests.rest.cluster', 'localhost:9200'