-
Notifications
You must be signed in to change notification settings - Fork 115
Gangams/e2e test framework #503
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
fade8ba
add agent e2e fw and tests
ganga1980 316511e
doc and script updates
ganga1980 022eae5
add validation script
ganga1980 f738a2b
doc updates
ganga1980 e99c5ed
yaml updates
ganga1980 3d089a6
fix typo
ganga1980 df83256
doc updates
ganga1980 ad7dc64
more doc updates
ganga1980 38c6b94
add ISTEST for helm chart to use arc conf
ganga1980 20d4e8e
refactor test code
ganga1980 51b4b3b
fix pr feedback
ganga1980 928ab11
fix pr feedback
ganga1980 a367922
fix pr feedback
ganga1980 5c5e4a7
fix pr feedback
ganga1980 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,35 @@ | ||
| #!/bin/bash | ||
|
|
||
| echo "start: update placeholders of e2e-tests.yaml ..." | ||
|
|
||
| for ARGUMENT in "$@" | ||
| do | ||
| KEY=$(echo $ARGUMENT | cut -f1 -d=) | ||
| VALUE=$(echo $ARGUMENT | cut -f2 -d=) | ||
|
|
||
| case "$KEY" in | ||
| TENANT_ID) TENANT_ID=$VALUE ;; | ||
| *) | ||
| esac | ||
| done | ||
|
|
||
| echo "start: read appid and appsecret" | ||
| # used the same SP which used for acr | ||
| CLIENT_ID=$(cat ~/acrappid) | ||
| CLIENT_SECRET=$(cat ~/acrappsecret) | ||
| echo "end: read appid and appsecret" | ||
|
|
||
| echo "Service Principal CLIENT_ID:$CLIENT_ID" | ||
| echo "replace CLIENT_ID value" | ||
| sed -i "s=SP_CLIENT_ID_VALUE=$CLIENT_ID=g" e2e-tests.yaml | ||
|
|
||
| # only uncomment for debug purpose | ||
| # echo "Service Principal CLIENT_SECRET:$CLIENT_SECRET" | ||
| echo "replace CLIENT_SECRET value" | ||
| sed -i "s=SP_CLIENT_SECRET_VALUE=$CLIENT_SECRET=g" e2e-tests.yaml | ||
|
|
||
| echo "Service Principal TENANT_ID:$TENANT_ID" | ||
| echo "replace TENANT_ID value" | ||
| sed -i "s=SP_TENANT_ID_VALUE=$TENANT_ID=g" e2e-tests.yaml | ||
|
|
||
| echo "end: update placeholders of e2e-tests.yaml." | ||
This file contains hidden or 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,71 @@ | ||
| #!/bin/bash | ||
| echo "start: validating results of e2e-tests ..." | ||
| DEFAULT_SONOBUOY_VERSION="0.20.0" | ||
| DEFAULT_TIME_OUT_IN_MINS=60 | ||
| for ARGUMENT in "$@" | ||
| do | ||
| KEY=$(echo $ARGUMENT | cut -f1 -d=) | ||
| VALUE=$(echo $ARGUMENT | cut -f2 -d=) | ||
|
|
||
| case "$KEY" in | ||
| SONOBUOY_VERSION) SONOBUOY_VERSION=$VALUE ;; | ||
| *) | ||
| esac | ||
| done | ||
|
|
||
| if [ -z $SONOBUOY_VERSION ]; then | ||
| SONOBUOY_VERSION=$DEFAULT_SONOBUOY_VERSION | ||
| fi | ||
|
|
||
| echo "sonobuoy version: ${SONOBUOY_VERSION}" | ||
|
|
||
| echo "start: downloading sonobuoy" | ||
| curl -LO https://github.com/vmware-tanzu/sonobuoy/releases/download/v${SONOBUOY_VERSION}/sonobuoy_${SONOBUOY_VERSION}_linux_amd64.tar.gz | ||
| echo "end: downloading sonobuoy" | ||
|
|
||
| echo "start: extract sonobuoy tar file" | ||
| mkdir -p sonobuoy-install/ | ||
| tar -zxf sonobuoy_${SONOBUOY_VERSION}_*.tar.gz -C sonobuoy-install/ | ||
| echo "end: extract sonobuoy tar file" | ||
|
|
||
| echo "start: move sonobuoy binaries to /usr/local/bin/" | ||
ganga1980 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| mv -f sonobuoy-install/sonobuoy /usr/local/bin/ | ||
| echo "end: move sonobuoy binaries to /usr/local/bin/" | ||
|
|
||
| rm -rf sonobuoy_${SONOBUOY_VERSION}_*.tar.gz sonobuoy-install/ | ||
|
|
||
| results=$(sonobuoy retrieve) | ||
| mins=0 | ||
| IsSucceeded=true | ||
| while [ $mins -le $DEFAULT_TIME_OUT_IN_MINS ] | ||
| do | ||
| # check the status | ||
| echo "checking test status" | ||
| status=$(sonobuoy status) | ||
| status=$(echo $status | sed 's/`//g') | ||
| if [[ $status == *"completed"* ]]; then | ||
| echo "test run completed" | ||
| mins=$DEFAULT_TIME_OUT_IN_MINS | ||
| if [[ $status == *"failed"* ]]; then | ||
| IsSucceeded=false | ||
| fi | ||
| else | ||
| echo "sleep for 1m to check the status again" | ||
| sleep 1m | ||
| fi | ||
| mins=$(( $mins + 1 )) | ||
| done | ||
| echo "status:${IsSucceeded}" | ||
|
|
||
| results=$(sonobuoy retrieve) | ||
| sonobuoy results $results | ||
|
|
||
| if $IsSucceeded == true; then | ||
| echo "all test passed" | ||
| exit 0 | ||
| else | ||
| echo "tests are failed. please review the results by downloading tar file via sonobuoy retrieve command" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "end: validating results of e2e-tests ..." | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.