Skip to content

Commit

Permalink
Update test scripts with new spctl usage
Browse files Browse the repository at this point in the history
  • Loading branch information
powerkimhub committed Nov 4, 2024
1 parent fc631e6 commit 128de95
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 8 deletions.
5 changes: 4 additions & 1 deletion test/vm-cb-user-validation-cli/common/7.key-delete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ SETUP_PATH=$CBSPIDER_ROOT/test/vm-cb-user-validation-cli/common
source $SETUP_PATH/setup.env $1

echo "============== before delete KeyPair: '${KEYPAIR_NAME}'"
$CLIPATH/spctl keypair delete --cname "${CONN_CONFIG}" -n "${KEYPAIR_NAME}" 2> /dev/null
$CLIPATH/spctl keypair delete -n "${KEYPAIR_NAME}" -d \
"{
\"ConnectionName\":\"${CONN_CONFIG}\"
}"
echo "============== after delete KeyPair: '${KEYPAIR_NAME}'"

echo -e "\n\n"
Expand Down
5 changes: 4 additions & 1 deletion test/vm-cb-user-validation-cli/common/7.sg-delete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ source $SETUP_PATH/setup.env $1


echo "============== before delete SecurityGroup: '${SG_NAME}'"
$CLIPATH/spctl security delete --cname "${CONN_CONFIG}" -n "${SG_NAME}" 2> /dev/null
$CLIPATH/spctl securitygroup delete -n "${SG_NAME}" -d \
"{
\"ConnectionName\":\"${CONN_CONFIG}\"
}"
echo "============== after delete SecurityGroup: '${SG_NAME}'"

echo -e "\n\n"
Expand Down
5 changes: 4 additions & 1 deletion test/vm-cb-user-validation-cli/common/7.vm-terminate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ source $SETUP_PATH/setup.env $1

VM_NAME=${VM_NAME}-$2
echo "============== before terminate VM: '${VM_NAME}'"
$CLIPATH/spctl --cname "${CONN_CONFIG}" vm terminate -n "${VM_NAME}" 2> /dev/null
$CLIPATH/spctl vm terminate -n "${VM_NAME}" -d \
"{
\"ConnectionName\":\"${CONN_CONFIG}\"
}"
echo "============== after terminate VM: '${VM_NAME}'"

echo -e "\n\n"
Expand Down
5 changes: 4 additions & 1 deletion test/vm-cb-user-validation-cli/common/7.vpc-delete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ SETUP_PATH=$CBSPIDER_ROOT/test/vm-cb-user-validation-cli/common
source $SETUP_PATH/setup.env $1

echo "============== before delete VPC/Subnet: '${VPC_NAME}'"
$CLIPATH/spctl vpc delete --cname "${CONN_CONFIG}" -n "${VPC_NAME}" 2> /dev/null
$CLIPATH/spctl vpc delete -n "${VPC_NAME}" -d \
"{
\"ConnectionName\":\"${CONN_CONFIG}\"
}"
echo "============== after delete VPC/Subnet: '${VPC_NAME}'"

echo -e "\n\n"
Expand Down
15 changes: 12 additions & 3 deletions test/vm-cb-user-validation-cli/common/8.clear-resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,28 @@ SETUP_PATH=$CBSPIDER_ROOT/test/vm-cb-user-validation-cli/common
source $SETUP_PATH/setup.env $1

echo "============== before delete KeyPair: '${KEYPAIR_NAME}'"
$CLIPATH/spctl keypair delete --cname "${CONN_CONFIG}" -n "${KEYPAIR_NAME}" 2> /dev/null
$CLIPATH/spctl keypair delete -n "${KEYPAIR_NAME}" -d \
"{
\"ConnectionName\":\"${CONN_CONFIG}\"
}"
echo "============== after delete KeyPair: '${KEYPAIR_NAME}'"

echo -e "\n\n"

echo "============== before delete SecurityGroup: '${SG_NAME}'"
$CLIPATH/spctl security delete --cname "${CONN_CONFIG}" -n "${SG_NAME}" 2> /dev/null
$CLIPATH/spctl securitygroup delete -n "${SG_NAME}" -d \
"{
\"ConnectionName\":\"${CONN_CONFIG}\"
}"
echo "============== after delete SecurityGroup: '${SG_NAME}'"

echo -e "\n\n"

echo "============== before delete VPC/Subnet: '${VPC_NAME}'"
$CLIPATH/spctl vpc delete --cname "${CONN_CONFIG}" -n "${VPC_NAME}" 2> /dev/null
$CLIPATH/spctl vpc delete -n "${VPC_NAME}" -d \
"{
\"ConnectionName\":\"${CONN_CONFIG}\"
}"
echo "============== after delete VPC/Subnet: '${VPC_NAME}'"

echo -e "\n\n"
Expand Down
2 changes: 1 addition & 1 deletion test/vm-cb-user-validation-cli/common/ktcloudvpc/setup.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SUBNET_CIDR=10.25.100.0/24
SUBNET_CIDR=10.25.102.0/24
CONN_CONFIG=ktcloudvpc-mokdong1-config
IMAGE_NAME=92e2be77-35e3-4f4c-96a3-2628475bb9e4
SPEC_NAME=4x8.itl

0 comments on commit 128de95

Please sign in to comment.