Skip to content

Commit

Permalink
Support domestic CSPs testing
Browse files Browse the repository at this point in the history
  • Loading branch information
seokho-son committed Jun 7, 2024
1 parent 8240688 commit 1ec2fee
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
15 changes: 14 additions & 1 deletion src/testclient/scripts/8.mcis/add-subgroup-to-mcis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@
else
RootDiskSize="${DISK_SIZE[$INDEX,$REGION]}"
fi


# Get a Subnet from the vNet (10.25.10.1/24 condition is only for KT cloud vpc)
echo "- Get vNet ${CONN_CONFIG[$INDEX,$REGION]}-${POSTFIX} to designate a Subnet"
VNETINFO=$(curl -H "${AUTH}" -sX GET http://$TumblebugServer/tumblebug/ns/$NSID/resources/vNet/${CONN_CONFIG[$INDEX,$REGION]}-${POSTFIX})
SUBNETARRAY=$(jq -r '.subnetInfoList' <<<"$VNETINFO")
echo "$SUBNETARRAY"
SUBNETID=$(jq -r '.subnetInfoList[] | select(.IPv4_CIDR == "10.25.10.1/24") | .Id' <<<"$VNETINFO")
if [ -z "$SUBNETID" ]; then
SUBNETID=$(jq -r '.subnetInfoList[0].Id' <<<"$VNETINFO")
fi
echo "Designated Subnet ID (for testing only): $SUBNETID"


curl -H "${AUTH}" -sX POST http://$TumblebugServer/tumblebug/ns/$NSID/mcis/$MCISID/vm -H 'Content-Type: application/json' -d \
'{
Expand All @@ -35,7 +48,7 @@
"'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'"
],
"vNetId": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
"subnetId": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
"subnetId": "'${SUBNETID}'",
"description": "description",
"vmUserPassword": "",
"rootDiskType": "'${RootDiskType}'",
Expand Down
14 changes: 13 additions & 1 deletion src/testclient/scripts/8.mcis/create-mcis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ else
RootDiskSize="${DISK_SIZE[$INDEX,$REGION]}"
fi

# Get a Subnet from the vNet
echo "- Get vNet ${CONN_CONFIG[$INDEX,$REGION]}-${POSTFIX} to designate a Subnet"
VNETINFO=$(curl -H "${AUTH}" -sX GET http://$TumblebugServer/tumblebug/ns/$NSID/resources/vNet/${CONN_CONFIG[$INDEX,$REGION]}-${POSTFIX})
SUBNETARRAY=$(jq -r '.subnetInfoList' <<<"$VNETINFO")
echo "$SUBNETARRAY"
SUBNETID=$(jq -r '.subnetInfoList[] | select(.IPv4_CIDR == "10.25.10.1/24") | .Id' <<<"$VNETINFO")
if [ -z "$SUBNETID" ]; then
SUBNETID=$(jq -r '.subnetInfoList[0].Id' <<<"$VNETINFO")
fi
echo "Designated Subnet ID (for testing only): $SUBNETID"


curl -H "${AUTH}" -sX POST http://$TumblebugServer/tumblebug/ns/$NSID/mcis -H 'Content-Type: application/json' -d \
'{
"name": "'${MCISID}'",
Expand All @@ -43,7 +55,7 @@ curl -H "${AUTH}" -sX POST http://$TumblebugServer/tumblebug/ns/$NSID/mcis -H 'C
"'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'"
],
"vNetId": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
"subnetId": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'",
"subnetId": "'${SUBNETID}'",
"description": "description",
"vmUserPassword": "",
"rootDiskType": "'${RootDiskType}'",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function clean_sequence() {

fi

#if ! [ "${CSP}" == "nhncloud" ]; then
if ! [ "${CSP}" == "nhncloud" ]; then
echo '## 3. vNet: Delete'
OUTPUT=$(../3.vNet/delete-vNet.sh -c $CSP -r $REGION -n $POSTFIX -f $TestSetFile)
echo "${OUTPUT}"
Expand Down Expand Up @@ -99,7 +99,7 @@ function clean_sequence() {
done

fi
#fi
fi

#../2.configureTumblebug/delete-ns.sh $CSP $REGION $POSTFIX

Expand Down

0 comments on commit 1ec2fee

Please sign in to comment.