Skip to content

Commit

Permalink
add test scripts for each resource
Browse files Browse the repository at this point in the history
  • Loading branch information
powerkimhub committed May 4, 2020
1 parent 76c0d65 commit 9826b5b
Show file tree
Hide file tree
Showing 14 changed files with 116 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api-runtime/rest-runtime/test/each-test/1.aws-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export CONN_CONFIG=aws-ohio-config
export IMAGE_NAME=ami-f4f4cf91
export SPEC_NAME=t3.micro

./vpc-test.sh
5 changes: 5 additions & 0 deletions api-runtime/rest-runtime/test/each-test/2.azure-1.vpc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export CONN_CONFIG=azure-northeu-config
export IMAGE_NAME=Canonical:UbuntuServer:18.04-LTS:latest
export SPEC_NAME=Standard_B1ls

./vpc-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export CONN_CONFIG=azure-northeu-config
export IMAGE_NAME=Canonical:UbuntuServer:18.04-LTS:latest
export SPEC_NAME=Standard_B1ls

./securitygroup-test.sh
5 changes: 5 additions & 0 deletions api-runtime/rest-runtime/test/each-test/2.azure-3.keypair.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export CONN_CONFIG=azure-northeu-config
export IMAGE_NAME=Canonical:UbuntuServer:18.04-LTS:latest
export SPEC_NAME=Standard_B1ls

./keypair-test.sh
5 changes: 5 additions & 0 deletions api-runtime/rest-runtime/test/each-test/2.azure-4.vm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export CONN_CONFIG=azure-northeu-config
export IMAGE_NAME=Canonical:UbuntuServer:18.04-LTS:latest
export SPEC_NAME=Standard_B1ls

./vm-test.sh
8 changes: 8 additions & 0 deletions api-runtime/rest-runtime/test/each-test/2.azure-5.delete.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export CONN_CONFIG=azure-northeu-config
export IMAGE_NAME=Canonical:UbuntuServer:18.04-LTS:latest
export SPEC_NAME=Standard_B1ls

./vm-delete-test.sh
./keypair-delete-test.sh
./securitygroup-delete-test.sh
./vpc-delete-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

echo "####################################################################"
echo "## KeyPair Test Scripts for CB-Spider IID Working Version - 2020.04.21."
echo "## KeyPair: Delete"
echo "####################################################################"

curl -sX DELETE http://localhost:1024/spider/keypair/KEYPAIR-01 -H 'Content-Type: application/json' -d '{ "ConnectionName": "'${CONN_CONFIG}'"}' |json_pp
9 changes: 9 additions & 0 deletions api-runtime/rest-runtime/test/each-test/keypair-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

echo "####################################################################"
echo "## KeyPair Test Scripts for CB-Spider IID Working Version - 2020.04.21."
echo "## KeyPair: Create -> List -> Get"
echo "####################################################################"

curl -sX POST http://localhost:1024/spider/keypair -H 'Content-Type: application/json' -d '{ "ConnectionName": "'${CONN_CONFIG}'", "ReqInfo": { "Name": "KEYPAIR-01" } }' |json_pp
curl -sX GET http://localhost:1024/spider/keypair -H 'Content-Type: application/json' -d '{ "ConnectionName": "'${CONN_CONFIG}'"}' |json_pp
curl -sX GET http://localhost:1024/spider/keypair/KEYPAIR-01 -H 'Content-Type: application/json' -d '{ "ConnectionName": "'${CONN_CONFIG}'"}' |json_pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

echo "####################################################################"
echo "## SecurityGroup Test Scripts for CB-Spider IID Working Version - 2020.04.21."
echo "## SecurityGroup: Delete"
echo "####################################################################"

curl -sX DELETE http://localhost:1024/spider/securitygroup/SG-01 -H 'Content-Type: application/json' -d '{ "ConnectionName": "'${CONN_CONFIG}'"}' |json_pp
9 changes: 9 additions & 0 deletions api-runtime/rest-runtime/test/each-test/securitygroup-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

echo "####################################################################"
echo "## SecurityGroup Test Scripts for CB-Spider IID Working Version - 2020.04.21."
echo "## SecurityGroup: Create -> List -> Get"
echo "####################################################################"

curl -sX POST http://localhost:1024/spider/securitygroup -H 'Content-Type: application/json' -d '{ "ConnectionName": "'${CONN_CONFIG}'", "ReqInfo": { "Name": "SG-01", "VPCName": "VPC-01", "SecurityRules": [ {"FromPort": "1", "ToPort" : "65535", "IPProtocol" : "tcp", "Direction" : "inbound"} ] } }' |json_pp
curl -sX GET http://localhost:1024/spider/securitygroup -H 'Content-Type: application/json' -d '{ "ConnectionName": "'${CONN_CONFIG}'"}' |json_pp
curl -sX GET http://localhost:1024/spider/securitygroup/SG-01 -H 'Content-Type: application/json' -d '{ "ConnectionName": "'${CONN_CONFIG}'"}' |json_pp
10 changes: 10 additions & 0 deletions api-runtime/rest-runtime/test/each-test/vm-delete-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

echo "####################################################################"
echo "## VM Test Scripts for CB-Spider IID Working Version - 2020.04.21."
echo "## VM: Terminate"
echo "####################################################################"

curl -sX DELETE http://localhost:1024/spider/vm/VM-01 -H 'Content-Type: application/json' -d '{ "ConnectionName": "'${CONN_CONFIG}'"}' |json_pp
echo "============== sleep 15 after delete VM"
sleep 15

23 changes: 23 additions & 0 deletions api-runtime/rest-runtime/test/each-test/vm-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

echo "####################################################################"
echo "## VM Test Scripts for CB-Spider IID Working Version - 2020.04.21."
echo "## VM: StartVM -> List -> Get -> ListStatus -> GetStatus -> Suspend -> Resume -> Reboot"
echo "####################################################################"

curl -sX POST http://localhost:1024/spider/vm -H 'Content-Type: application/json' -d '{ "ConnectionName": "'${CONN_CONFIG}'", "ReqInfo": { "Name": "VM-01", "ImageName": "'${IMAGE_NAME}'", "VPCName": "VPC-01", "SubnetName": "Subnet-01", "SecurityGroupNames": [ "SG-01" ], "VMSpecName": "'${SPEC_NAME}'", "KeyPairName": "KEYPAIR-01"} }' |json_pp
echo "============== sleep 30 after start VM"
sleep 30
curl -sX GET http://localhost:1024/spider/vm -H 'Content-Type: application/json' -d '{ "ConnectionName": "'${CONN_CONFIG}'"}' |json_pp
curl -sX GET http://localhost:1024/spider/vm/VM-01 -H 'Content-Type: application/json' -d '{ "ConnectionName": "'${CONN_CONFIG}'"}' |json_pp
curl -sX GET http://localhost:1024/spider/vmstatus -H 'Content-Type: application/json' -d '{ "ConnectionName": "'${CONN_CONFIG}'"}' |json_pp
curl -sX GET http://localhost:1024/spider/vmstatus/VM-01 -H 'Content-Type: application/json' -d '{ "ConnectionName": "'${CONN_CONFIG}'"}' |json_pp
curl -sX GET http://localhost:1024/spider/controlvm/VM-01?action=suspend -H 'Content-Type: application/json' -d '{ "ConnectionName": "'${CONN_CONFIG}'"}' |json_pp
echo "============== sleep 50 after suspend VM"
sleep 50
curl -sX GET http://localhost:1024/spider/controlvm/VM-01?action=resume -H 'Content-Type: application/json' -d '{ "ConnectionName": "'${CONN_CONFIG}'"}' |json_pp
echo "============== sleep 30 after resume VM"
sleep 30
curl -sX GET http://localhost:1024/spider/controlvm/VM-01?action=reboot -H 'Content-Type: application/json' -d '{ "ConnectionName": "'${CONN_CONFIG}'"}' |json_pp
echo "============== sleep 60 after reboot VM"
sleep 60

8 changes: 8 additions & 0 deletions api-runtime/rest-runtime/test/each-test/vpc-delete-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

echo "####################################################################"
echo "## VPC Test Scripts for CB-Spider IID Working Version - 2020.04.21."
echo "## VPC: Delete"
echo "####################################################################"

curl -sX DELETE http://localhost:1024/spider/vpc/VPC-01 -H 'Content-Type: application/json' -d '{ "ConnectionName": "'${CONN_CONFIG}'"}' |json_pp

10 changes: 10 additions & 0 deletions api-runtime/rest-runtime/test/each-test/vpc-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

echo "####################################################################"
echo "## VPC Test Scripts for CB-Spider IID Working Version - 2020.04.21."
echo "## VPC: Create -> List -> Get"
echo "####################################################################"

curl -sX POST http://localhost:1024/spider/vpc -H 'Content-Type: application/json' -d '{ "ConnectionName": "'${CONN_CONFIG}'", "ReqInfo": { "Name": "VPC-01", "IPv4_CIDR": "192.168.0.0/16", "SubnetInfoList": [ { "Name": "Subnet-01", "IPv4_CIDR": "192.168.1.0/24"} ] } }' |json_pp
curl -sX GET http://localhost:1024/spider/vpc -H 'Content-Type: application/json' -d '{ "ConnectionName": "'${CONN_CONFIG}'"}' |json_pp
curl -sX GET http://localhost:1024/spider/vpc/VPC-01 -H 'Content-Type: application/json' -d '{ "ConnectionName": "'${CONN_CONFIG}'"}' |json_pp

0 comments on commit 9826b5b

Please sign in to comment.