-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 6 CSP Test Scenarios for the Certification Test
- Loading branch information
1 parent
59f5efc
commit f8e8d05
Showing
37 changed files
with
1,345 additions
and
0 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
23 changes: 23 additions & 0 deletions
23
test/vm-cb-user-validation-cli/2.6-csp-test/00.prepare-00.sh
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,23 @@ | ||
#!/bin/bash | ||
|
||
if [ "$1" = "" ]; then | ||
echo | ||
echo -e 'usage: '$0' mock|aws|azure|gcp|alibaba|tencent|ibm|openstack|ncp|ncpvpc|nhncloud' | ||
echo -e '\n\tex) '$0' aws' | ||
echo | ||
exit 0; | ||
fi | ||
|
||
echo -e "###########################################################" | ||
echo -e "# 1.create: VPC/Subnet => SG01 => Keypair(save private key)" | ||
echo -e "###########################################################" | ||
|
||
source ../common/setup.env $1 | ||
source setup.env $1 | ||
|
||
|
||
### 1.create: VPC/Subnet => SG01 => Keypair(save private key) | ||
../common/1.prepare-resources.sh $1 | ||
|
||
echo -e "\n\n" | ||
|
43 changes: 43 additions & 0 deletions
43
test/vm-cb-user-validation-cli/2.6-csp-test/01.loop-vm-ssh-case-01.sh
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,43 @@ | ||
#!/bin/bash | ||
|
||
if [ "$1" = "" ]; then | ||
echo | ||
echo -e 'usage: '$0' mock|aws|azure|gcp|alibaba|tencent|ibm|openstack|cloudit|ncp|ncpvpc|nhncloud number' | ||
echo -e '\n\tex) '$0' aws 5' | ||
echo | ||
exit 0; | ||
fi | ||
|
||
if [ "$2" = "" ]; then | ||
echo | ||
echo -e 'usage: '$0' mock|aws|azure|gcp|alibaba|tencent|ibm|openstack|cloudit|ncp|ncpvpc|nhncloud number' | ||
echo -e '\n\tex) '$0' aws 5' | ||
echo | ||
exit 0; | ||
fi | ||
|
||
source ../common/setup.env $1 | ||
source setup.env $1 | ||
|
||
rm -f $RESULT_FNAME | ||
rm -f $TERMINATED_FNAME | ||
|
||
echo -e "\n\n" | ||
echo -e "###########################################################" | ||
echo -e "# Try to create $1 VMs: $2" | ||
echo -e "###########################################################" | ||
echo -e "\n\n" | ||
|
||
|
||
for (( num=1; num <= $2; num++ )) | ||
do | ||
# ex) ./vm-ssh-test.sh aws 1 | ||
./vm-ssh-test.sh $1 $num & | ||
if [ `expr $num % 10` = 0 ]; then # tencent RequestLimitExceeded = 10/sec | ||
sleep 3 | ||
fi | ||
echo -e "\n\n" | ||
done | ||
|
||
echo -e "\n\n" | ||
|
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,23 @@ | ||
#!/bin/bash | ||
|
||
if [ "$1" = "" ]; then | ||
echo | ||
echo -e 'usage: '$0' mock|aws|azure|gcp|alibaba|tencent|ibm|openstack|ncp|ncpvpc|nhncloud' | ||
echo -e '\n\tex) '$0' aws' | ||
echo | ||
exit 0; | ||
fi | ||
|
||
echo -e "###########################################################" | ||
echo -e "# 1.create: Disk" | ||
echo -e "###########################################################" | ||
|
||
source ../common/setup.env $1 | ||
source setup.env $1 | ||
|
||
|
||
### 1.create: Disk | ||
../common/11.disk-create.sh $1 | ||
|
||
echo -e "\n\n" | ||
|
23 changes: 23 additions & 0 deletions
23
test/vm-cb-user-validation-cli/2.6-csp-test/03.myimage-01.sh
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,23 @@ | ||
#!/bin/bash | ||
|
||
if [ "$1" = "" ]; then | ||
echo | ||
echo -e 'usage: '$0' mock|aws|azure|gcp|alibaba|tencent|ibm|openstack|ncp|ncpvpc|nhncloud' | ||
echo -e '\n\tex) '$0' aws' | ||
echo | ||
exit 0; | ||
fi | ||
|
||
echo -e "###########################################################" | ||
echo -e "# 1.create: MyImage" | ||
echo -e "###########################################################" | ||
|
||
source ../common/setup.env $1 | ||
source setup.env $1 | ||
|
||
|
||
### 1.create: MyImage | ||
../common/12.myimage-create.sh $1 | ||
|
||
echo -e "\n\n" | ||
|
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,23 @@ | ||
#!/bin/bash | ||
|
||
if [ "$1" = "" ]; then | ||
echo | ||
echo -e 'usage: '$0' mock|aws|azure|gcp|alibaba|tencent|ibm|openstack|ncp|ncpvpc|nhncloud' | ||
echo -e '\n\tex) '$0' aws' | ||
echo | ||
exit 0; | ||
fi | ||
|
||
echo -e "###########################################################" | ||
echo -e "# 1.create: NLB" | ||
echo -e "###########################################################" | ||
|
||
source ../common/setup.env $1 | ||
source setup.env $1 | ||
|
||
|
||
### 1.create: NLB | ||
../common/13.nlb-create.sh $1 | ||
|
||
echo -e "\n\n" | ||
|
21 changes: 21 additions & 0 deletions
21
test/vm-cb-user-validation-cli/2.6-csp-test/10.destroy_all.sh
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,21 @@ | ||
#!/bin/bash | ||
|
||
if [ "$1" = "" ]; then | ||
echo | ||
echo -e 'usage: '$0' mock|aws|azure|gcp|alibaba|tencent|ibm|openstack|ncp|ncpvpc|nhncloud' | ||
echo -e '\n\tex) '$0' aws' | ||
echo | ||
exit 0; | ||
fi | ||
|
||
echo -e "###########################################################" | ||
echo -e "# 1.destroy: All Resources in Connection " | ||
echo -e "###########################################################" | ||
|
||
source ../common/setup.env $1 | ||
source setup.env $1 | ||
|
||
../common/10.destroy.sh $1 | ||
|
||
echo -e "\n\n" | ||
|
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,19 @@ | ||
#!/bin/bash | ||
|
||
CSPLIST=( aws azure gcp alibaba tencent openstack ) | ||
|
||
function run() { | ||
param=$1 | ||
num=0 | ||
for CSP in "${CSPLIST[@]}" | ||
do | ||
echo "============ test ${CSP} ... ============" | ||
|
||
./one_csp_run.sh ${CSP} ${param} & | ||
|
||
echo -e "\n\n" | ||
done | ||
} | ||
|
||
run "$@" | ||
|
17 changes: 17 additions & 0 deletions
17
test/vm-cb-user-validation-cli/2.6-csp-test/all_destroy.sh
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,17 @@ | ||
#!/bin/bash | ||
|
||
CSPLIST=( aws azure gcp alibaba tencent openstack ) | ||
|
||
function run() { | ||
param=$1 | ||
for CSP in "${CSPLIST[@]}" | ||
do | ||
echo "============ test ${CSP} ... ============" | ||
|
||
./10.destroy_all.sh ${CSP} & | ||
|
||
echo -e "\n\n" | ||
done | ||
} | ||
|
||
run "$@" |
19 changes: 19 additions & 0 deletions
19
test/vm-cb-user-validation-cli/2.6-csp-test/all_snapshot.sh
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,19 @@ | ||
#!/bin/bash | ||
|
||
CSPLIST=( aws azure gcp alibaba tencent openstack ) | ||
|
||
function run() { | ||
param=$1 | ||
num=0 | ||
for CSP in "${CSPLIST[@]}" | ||
do | ||
echo "============ test ${CSP} ... ============" | ||
|
||
./one_csp_snapshot.sh ${CSP} ${param} & | ||
|
||
echo -e "\n\n" | ||
done | ||
} | ||
|
||
run "$@" | ||
|
2 changes: 2 additions & 0 deletions
2
test/vm-cb-user-validation-cli/2.6-csp-test/connection/.alibaba-credential.sample
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,2 @@ | ||
alibaba_client_id="YOUR_ALIBABA_CLIENT_ID" | ||
alibaba_client_secret="YOUR_ALIBABA_CLIENT_SECRET" |
2 changes: 2 additions & 0 deletions
2
test/vm-cb-user-validation-cli/2.6-csp-test/connection/.aws-credential.sample
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,2 @@ | ||
aws_access_key_id="YOUR_AWS_ACCESS_KEY_ID" | ||
aws_secret_access_key="YOUR_AWS_SECRET_ACCESS_KEY" |
4 changes: 4 additions & 0 deletions
4
test/vm-cb-user-validation-cli/2.6-csp-test/connection/.azure-credential.sample
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,4 @@ | ||
azure_client_id="YOUR_AZURE_CLIENT_ID" | ||
azure_client_secret="YOUR_AZURE_CLIENT_SECRET" | ||
azure_tenant_id="YOUR_AZURE_TENANT_ID" | ||
azure_subscription_id="YOUR_AZURE_SUBSCRIPTION_ID" |
3 changes: 3 additions & 0 deletions
3
test/vm-cb-user-validation-cli/2.6-csp-test/connection/.gcp-credential.sample
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,3 @@ | ||
gcp_private_key="YOUR_GCP_PRIVATE_KEY" | ||
gcp_project_id="YOUR_GCP_PROJECT_ID" | ||
gcp_client_email="YOUR_GCP_CLIENT_EMAIL" |
5 changes: 5 additions & 0 deletions
5
test/vm-cb-user-validation-cli/2.6-csp-test/connection/.openstack-credential.sample
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,5 @@ | ||
openstack_identity_endpoint="YOUR_OPENSTACK_IDENTITY_ENDPOINT" | ||
openstack_username="YOUR_OPENSTACK_USERNAME" | ||
openstack_password="YOUR_OPENSTACK_PASSWORD" | ||
openstack_domain_name="YOUR_OPENSTACK_DOMAIN_NAME" | ||
openstack_project_id="YOUR_OPENSTACK_PROJECT_ID" |
2 changes: 2 additions & 0 deletions
2
test/vm-cb-user-validation-cli/2.6-csp-test/connection/.tencent-credential.sample
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,2 @@ | ||
tencent_secret_id="YOUR_TENCENT_SECRET_ID" | ||
tencent_secret_key="YOUR_TENCENT_SECRET_KEY" |
88 changes: 88 additions & 0 deletions
88
test/vm-cb-user-validation-cli/2.6-csp-test/connection/1.aws.sh
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,88 @@ | ||
echo "####################################################################" | ||
echo "## Cloud Driver Info" | ||
echo "####################################################################" | ||
|
||
# Load sensitive information from .aws-credential | ||
AWS_CREDENTIAL_FILE="./.aws-credential" | ||
if [[ -f $AWS_CREDENTIAL_FILE ]]; then | ||
source $AWS_CREDENTIAL_FILE | ||
else | ||
echo "Error: Credential file not found at $AWS_CREDENTIAL_FILE" | ||
exit 1 | ||
fi | ||
|
||
if [[ -z "$aws_access_key_id" || -z "$aws_secret_access_key" ]]; then | ||
echo "Error: Missing aws_access_key_id or aws_secret_access_key in credential file." | ||
exit 1 | ||
fi | ||
|
||
# Cloud Driver Info | ||
curl -X POST http://$RESTSERVER:1024/spider/driver \ | ||
-H 'Content-Type: application/json' \ | ||
-d '{ | ||
"DriverName": "aws-driver01", | ||
"ProviderName": "AWS", | ||
"DriverLibFileName": "aws-driver-v1.0.so" | ||
}' | ||
|
||
echo "####################################################################" | ||
echo "## Cloud Credential Info" | ||
echo "####################################################################" | ||
|
||
# Cloud Credential Info | ||
curl -X POST http://$RESTSERVER:1024/spider/credential \ | ||
-H 'Content-Type: application/json' \ | ||
-d '{ | ||
"CredentialName": "aws-credential01", | ||
"ProviderName": "AWS", | ||
"KeyValueInfoList": [ | ||
{"Key": "aws_access_key_id", "Value": "'"$aws_access_key_id"'"}, | ||
{"Key": "aws_secret_access_key", "Value": "'"$aws_secret_access_key"'"} | ||
] | ||
}' | ||
|
||
echo "####################################################################" | ||
echo "## Cloud Region Info" | ||
echo "####################################################################" | ||
|
||
# Cloud Region Info | ||
regions=("aws-ohio:us-east-2:us-east-2a" | ||
"aws-oregon:us-west-2:us-west-2a" | ||
"aws-singapore:ap-southeast-1:ap-southeast-1a" | ||
"aws-paris:eu-west-3:eu-west-3a" | ||
"aws-saopaulo:sa-east-1:sa-east-1a" | ||
"aws-tokyo:ap-northeast-1:ap-northeast-1a") | ||
|
||
for region in "${regions[@]}"; do | ||
IFS=":" read -r RegionName Region Zone <<< "$region" | ||
curl -X POST http://$RESTSERVER:1024/spider/region \ | ||
-H 'Content-Type: application/json' \ | ||
-d '{ | ||
"RegionName": "'$RegionName'", | ||
"ProviderName": "AWS", | ||
"KeyValueInfoList": [ | ||
{"Key": "Region", "Value": "'$Region'"}, | ||
{"Key": "Zone", "Value": "'$Zone'"} | ||
] | ||
}' | ||
done | ||
|
||
echo "####################################################################" | ||
echo "## Cloud Connection Config Info" | ||
echo "####################################################################" | ||
|
||
# Cloud Connection Config Info | ||
configs=("aws-config01:aws-ohio") | ||
|
||
for config in "${configs[@]}"; do | ||
IFS=":" read -r ConfigName RegionName <<< "$config" | ||
curl -X POST http://$RESTSERVER:1024/spider/connectionconfig \ | ||
-H 'Content-Type: application/json' \ | ||
-d '{ | ||
"ConfigName": "'$ConfigName'", | ||
"ProviderName": "AWS", | ||
"DriverName": "aws-driver01", | ||
"CredentialName": "aws-credential01", | ||
"RegionName": "'$RegionName'" | ||
}' | ||
done |
Oops, something went wrong.