diff --git a/src/testclient/scripts/8.mcis/add-subgroup-to-mcis.sh b/src/testclient/scripts/8.mcis/add-subgroup-to-mcis.sh index a46fef38d..06ec62a77 100755 --- a/src/testclient/scripts/8.mcis/add-subgroup-to-mcis.sh +++ b/src/testclient/scripts/8.mcis/add-subgroup-to-mcis.sh @@ -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 \ '{ @@ -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}'", diff --git a/src/testclient/scripts/8.mcis/create-mcis.sh b/src/testclient/scripts/8.mcis/create-mcis.sh index 88aa3a5d7..38f440364 100755 --- a/src/testclient/scripts/8.mcis/create-mcis.sh +++ b/src/testclient/scripts/8.mcis/create-mcis.sh @@ -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}'", @@ -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}'", diff --git a/src/testclient/scripts/sequentialFullTest/clean-mcir-ns-cloud-domestic.sh b/src/testclient/scripts/sequentialFullTest/clean-mcir-ns-cloud-domestic.sh index 890b298e3..89544c517 100755 --- a/src/testclient/scripts/sequentialFullTest/clean-mcir-ns-cloud-domestic.sh +++ b/src/testclient/scripts/sequentialFullTest/clean-mcir-ns-cloud-domestic.sh @@ -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}" @@ -99,7 +99,7 @@ function clean_sequence() { done fi - #fi + fi #../2.configureTumblebug/delete-ns.sh $CSP $REGION $POSTFIX