-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Backport 8.x] Add argument to switch to non root user for running sm…
…oke test script (#573) Signed-off-by: Zelin Hao <[email protected]> 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> Co-authored-by: Zelin Hao <[email protected]>
- Loading branch information
1 parent
aded3ad
commit 63c0062
Showing
8 changed files
with
92 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,12 +3,13 @@ | |
RunSmokeTestScript_Jenkinsfile.echo(Executing on agent [label:none]) | ||
RunSmokeTestScript_Jenkinsfile.stage(smoke-test, groovy.lang.Closure) | ||
RunSmokeTestScript_Jenkinsfile.script(groovy.lang.Closure) | ||
RunSmokeTestScript_Jenkinsfile.runSmokeTestScript({jobName=dummy_job, buildManifest=tests/data/opensearch-2.18.0-build.yml, testManifest=tests/data/opensearch-2.18.0-test.yml, buildId=1234}) | ||
RunSmokeTestScript_Jenkinsfile.runSmokeTestScript({jobName=dummy_job, buildManifest=tests/data/opensearch-2.18.0-build.yml, testManifest=tests/data/opensearch-2.18.0-test.yml, buildId=1234, switchUserNonRoot=false}) | ||
runSmokeTestScript.legacySCM(groovy.lang.Closure) | ||
runSmokeTestScript.library({[email protected], retriever=null}) | ||
runSmokeTestScript.readYaml({file=tests/data/opensearch-2.18.0-build.yml}) | ||
BuildManifest.asBoolean() | ||
BuildManifest.getArtifactRootUrl(dummy_job, 1234) | ||
runSmokeTestScript.echo(Artifact root URL: https://ci.opensearch.org/ci/dbc/dummy_job/2.18.0/1234/linux/x64/tar) | ||
runSmokeTestScript.echo(Switch User to Non-Root (uid=1000): false) | ||
runSmokeTestScript.echo(Paths: opensearch=https://ci.opensearch.org/ci/dbc/dummy_job/2.18.0/1234/linux/x64/tar) | ||
runSmokeTestScript.sh(./test.sh smoke-test tests/data/opensearch-2.18.0-test.yml --test-run-id 9876 --paths opensearch=https://ci.opensearch.org/ci/dbc/dummy_job/2.18.0/1234/linux/x64/tar) | ||
runSmokeTestScript.sh( ./test.sh smoke-test tests/data/opensearch-2.18.0-test.yml --test-run-id 9876 --paths opensearch=https://ci.opensearch.org/ci/dbc/dummy_job/2.18.0/1234/linux/x64/tar ) |
27 changes: 27 additions & 0 deletions
27
tests/jenkins/jobs/RunSmokeTestScript_Switch_Non_Root_Jenkinsfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
pipeline { | ||
agent none | ||
stages { | ||
stage('smoke-test') { | ||
steps { | ||
script { | ||
runSmokeTestScript( | ||
jobName: 'dummy_job', | ||
buildManifest: 'tests/data/opensearch-2.18.0-build.yml', | ||
testManifest: 'tests/data/opensearch-2.18.0-test.yml', | ||
buildId: '2345', | ||
switchUserNonRoot: 'true' | ||
) | ||
} | ||
} | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
tests/jenkins/jobs/RunSmokeTestScript_Switch_Non_Root_Jenkinsfile.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
RunSmokeTestScript_Switch_Non_Root_Jenkinsfile.run() | ||
RunSmokeTestScript_Switch_Non_Root_Jenkinsfile.pipeline(groovy.lang.Closure) | ||
RunSmokeTestScript_Switch_Non_Root_Jenkinsfile.echo(Executing on agent [label:none]) | ||
RunSmokeTestScript_Switch_Non_Root_Jenkinsfile.stage(smoke-test, groovy.lang.Closure) | ||
RunSmokeTestScript_Switch_Non_Root_Jenkinsfile.script(groovy.lang.Closure) | ||
RunSmokeTestScript_Switch_Non_Root_Jenkinsfile.runSmokeTestScript({jobName=dummy_job, buildManifest=tests/data/opensearch-2.18.0-build.yml, testManifest=tests/data/opensearch-2.18.0-test.yml, buildId=2345, switchUserNonRoot=true}) | ||
runSmokeTestScript.legacySCM(groovy.lang.Closure) | ||
runSmokeTestScript.library({[email protected], retriever=null}) | ||
runSmokeTestScript.readYaml({file=tests/data/opensearch-2.18.0-build.yml}) | ||
BuildManifest.asBoolean() | ||
BuildManifest.getArtifactRootUrl(dummy_job, 2345) | ||
runSmokeTestScript.echo(Artifact root URL: https://ci.opensearch.org/ci/dbc/dummy_job/2.18.0/2345/linux/x64/tar) | ||
runSmokeTestScript.echo(Switch User to Non-Root (uid=1000): true) | ||
runSmokeTestScript.echo(Paths: opensearch=https://ci.opensearch.org/ci/dbc/dummy_job/2.18.0/2345/linux/x64/tar) | ||
runSmokeTestScript.sh(su `id -un 1000` -c " ./test.sh smoke-test tests/data/opensearch-2.18.0-test.yml --test-run-id 8765 --paths opensearch=https://ci.opensearch.org/ci/dbc/dummy_job/2.18.0/2345/linux/x64/tar ") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters