Skip to content

Commit

Permalink
Update conf.env and testSet.env for Domestic CSPs, and Add modify_ngi…
Browse files Browse the repository at this point in the history
…nx.sh to Set nginx server on NCP Classic VM (#1604)

* Update conf.env and testSet.env to test Domestic CSPs

* Update NCP Classic KR and SGN region VMSpec

* Update credential template

* Update NCP Classic Korea and Singapore SPEC_NAME for Test scripts

* Add Resource Create/Clean Test codes for Domestic CSPs
  • Loading branch information
innodreamer committed Jun 5, 2024
1 parent adf56fd commit 6c9db65
Show file tree
Hide file tree
Showing 13 changed files with 962 additions and 161 deletions.
12 changes: 6 additions & 6 deletions assets/cloudspec.csv
Original file line number Diff line number Diff line change
Expand Up @@ -558,18 +558,18 @@ TENCENT,eu-moscow,S2.MEDIUM4,0.06,59.98,,,,,,,,,,default,default,,,,,
TENCENT,na-ashburn,S2.MEDIUM4,0.09,59.98,,,,,,,,,,default,default,,,,,
TENCENT,na-siliconvalley,SA2.MEDIUM4,0.04,59.98,,,,,,,,,,default,default,,,,,
TENCENT,na-toronto,S2.MEDIUM4,0.09,59.98,,,,,,,,,,default,default,,,,,
NCP,KR,SPSVRHICPUSSD002,,,,,,,,,,,,default,default,,,,,
NCP,KR,SPSVRHICPUSSD003,,,,,,,,,,,,default,default,,,,,
NCP,KR,SPSVRHICPUSSD004,,,,,,,,,,,,default,default,,,,,
NCP,KR,SPSVRSSD00000005,,,,,,,,,,,,default,default,,,,,
NCP,KR,SPSVRSSD00000007,,,,,,,,,,,,default,default,,,,,
NCP,KR,SPSVRSSD00000016,,,,,,,,,,,,default,default,,,,,
NCP,USWN,SPSVRSSD00000005,,,,,,,,,,,,default,default,,,,,
NCP,USWN,SPSVRSSD00000007,,,,,,,,,,,,default,default,,,,,
NCP,USWN,SPSVRSSD00000016,,,,,,,,,,,,default,default,,,,,
NCP,HK,SPSVRSTAND000005,,,,,,,,,,,,default,default,,,,,
NCP,HK,SPSVRSTAND000006,,,,,,,,,,,,default,default,,,,,
NCP,HK,SPSVRSTAND000046,,,,,,,,,,,,default,default,,,,,
NCP,SGN,SPSVRCPUSSD00002,,,,,,,,,,,,default,default,,,,,
NCP,SGN,SPSVRCPUSSD00003,,,,,,,,,,,,default,default,,,,,
NCP,SGN,SPSVRCPUSSD00004,,,,,,,,,,,,default,default,,,,,
NCP,SGN,SPSVRSSD00000005,,,,,,,,,,,,default,default,,,,,
NCP,SGN,SPSVRSSD00000007,,,,,,,,,,,,default,default,,,,,
NCP,SGN,SPSVRSSD00000016,,,,,,,,,,,,default,default,,,,,
NCP,JPN,SPSVRSSD00000005,,,,,,,,,,,,default,default,,,,,
NCP,JPN,SPSVRSSD00000007,,,,,,,,,,,,default,default,,,,,
NCP,JPN,SPSVRSSD00000016,,,,,,,,,,,,default,default,,,,,
Expand Down
4 changes: 1 addition & 3 deletions scripts/init/template.credentials.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ credentialholder:
IdentityEndpoint: https://api.ucloudbiz.olleh.com/d1/identity/v3/
Username:
Password:
ClientId:
ClientSecret:
DomainName:
ProjectID:
ncp:
Expand All @@ -69,7 +67,7 @@ credentialholder:
ClientId:
ClientSecret:
nhncloud:
IdentityEndpoint: https://api-identity.infrastructure.cloud.toast.com
IdentityEndpoint: https://api-identity-infrastructure.nhncloudservice.com
Username:
Password:
DomainName:
Expand Down
56 changes: 56 additions & 0 deletions src/testclient/scripts/3.vNet/create-vNet-ktvpc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash

function CallTB() {
echo "- Create vNet in ${MCIRRegionName}"

resp=$(
curl -H "${AUTH}" -sX POST http://$TumblebugServer/tumblebug/ns/$NSID/resources/vNet?option=register -H 'Content-Type: application/json' -d @- <<EOF
{
"name": "${CONN_CONFIG[$INDEX,$REGION]}-${POSTFIX}",
"connectionName": "${CONN_CONFIG[$INDEX,$REGION]}",
"cspVNetId": "60e5d9da-55cd-47be-a0d9-6cf67c54f15c"
}
EOF
); echo ${resp} | jq ''
echo ""
}

#function create_vNet() {

echo "####################################################################"
echo "## 3. vNet: Create"
echo "####################################################################"

source ../init.sh

if [ "${INDEX}" == "0" ]; then
echo "[Parallel execution for all CSP regions]"
INDEXX=${NumCSP}
for ((cspi = 1; cspi <= INDEXX; cspi++)); do
INDEXY=${NumRegion[$cspi]}
CSP=${CSPType[$cspi]}
echo "[$cspi] $CSP details"
for ((cspj = 1; cspj <= INDEXY; cspj++)); do
echo "[$cspi,$cspj] ${RegionName[$cspi,$cspj]}"

MCIRRegionName=${RegionName[$cspi,$cspj]}

CallTB

done

done
wait

else
echo ""

MCIRRegionName=${CONN_CONFIG[$INDEX,$REGION]}

CallTB

fi

#}

#create_vNet
81 changes: 81 additions & 0 deletions src/testclient/scripts/3.vNet/create-vNet-ncpvpc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#!/bin/bash

function CallTB() {
echo "- Create vNet in ${MCIRRegionName}"

CIDRNum=$(($INDEX+1))
CIDRDiff=$(($CIDRNum*$REGION))
CIDRDiff=$(($CIDRDiff%254))

CidrBlock="10.${CIDRDiff}.0.0/16"

# Original
# IPv4CIDR01="10.${CIDRDiff}.0.0/18"
# IPv4CIDR02="10.${CIDRDiff}.64.0/18"

# Modified by OH (For extra range for NLB subnet )
IPv4CIDR01="10.${CIDRDiff}.0.0/28"
IPv4CIDR02="10.${CIDRDiff}.64.0/28"

# CidrBlock="10.1.0.0/16" # for a temporal test for a limited CSP.
# IPv4CIDR01="10.1.0.0/18"
# IPv4CIDR02="10.1.64.0/18"

resp=$(
curl -H "${AUTH}" -sX POST http://$TumblebugServer/tumblebug/ns/$NSID/resources/vNet -H 'Content-Type: application/json' -d @- <<EOF
{
"name": "${CONN_CONFIG[$INDEX,$REGION]}-${POSTFIX}",
"connectionName": "${CONN_CONFIG[$INDEX,$REGION]}",
"cidrBlock": "${CidrBlock}",
"subnetInfoList": [ {
"Name": "${CONN_CONFIG[$INDEX,$REGION]}-${POSTFIX}",
"IPv4_CIDR": "${IPv4CIDR01}"
}, {
"Name": "${CONN_CONFIG[$INDEX,$REGION]}-${POSTFIX}-01",
"IPv4_CIDR": "${IPv4CIDR02}"
} ]
}
EOF
); echo ${resp} | jq ''
echo ""
}

#function create_vNet() {

echo "####################################################################"
echo "## 3. vNet: Create"
echo "####################################################################"

source ../init.sh

if [ "${INDEX}" == "0" ]; then
echo "[Parallel execution for all CSP regions]"
INDEXX=${NumCSP}
for ((cspi = 1; cspi <= INDEXX; cspi++)); do
INDEXY=${NumRegion[$cspi]}
CSP=${CSPType[$cspi]}
echo "[$cspi] $CSP details"
for ((cspj = 1; cspj <= INDEXY; cspj++)); do
echo "[$cspi,$cspj] ${RegionName[$cspi,$cspj]}"

MCIRRegionName=${RegionName[$cspi,$cspj]}

CallTB

done

done
wait

else
echo ""

MCIRRegionName=${CONN_CONFIG[$INDEX,$REGION]}

CallTB

fi

#}

#create_vNet
56 changes: 56 additions & 0 deletions src/testclient/scripts/3.vNet/create-vNet-nhn.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash

function CallTB() {
echo "- Create vNet in ${MCIRRegionName}"

resp=$(
curl -H "${AUTH}" -sX POST http://$TumblebugServer/tumblebug/ns/$NSID/resources/vNet?option=register -H 'Content-Type: application/json' -d @- <<EOF
{
"name": "${CONN_CONFIG[$INDEX,$REGION]}-${POSTFIX}",
"connectionName": "${CONN_CONFIG[$INDEX,$REGION]}",
"cspVNetId": "7e3af4cc-407b-47f6-beda-7c161ebe56f0"
}
EOF
); echo ${resp} | jq ''
echo ""
}

#function create_vNet() {

echo "####################################################################"
echo "## 3. vNet: Create"
echo "####################################################################"

source ../init.sh

if [ "${INDEX}" == "0" ]; then
echo "[Parallel execution for all CSP regions]"
INDEXX=${NumCSP}
for ((cspi = 1; cspi <= INDEXX; cspi++)); do
INDEXY=${NumRegion[$cspi]}
CSP=${CSPType[$cspi]}
echo "[$cspi] $CSP details"
for ((cspj = 1; cspj <= INDEXY; cspj++)); do
echo "[$cspi,$cspj] ${RegionName[$cspi,$cspj]}"

MCIRRegionName=${RegionName[$cspi,$cspj]}

CallTB

done

done
wait

else
echo ""

MCIRRegionName=${CONN_CONFIG[$INDEX,$REGION]}

CallTB

fi

#}

#create_vNet
101 changes: 101 additions & 0 deletions src/testclient/scripts/4.securityGroup/create-securityGroup-ktvpc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
#!/bin/bash

function CallTB() {
echo "- Create securityGroup in ${MCIRRegionName}"

resp=$(
curl -H "${AUTH}" -sX POST http://$TumblebugServer/tumblebug/ns/$NSID/resources/securityGroup -H 'Content-Type: application/json' -d @- <<EOF
{
"name": "${CONN_CONFIG[$INDEX,$REGION]}-${POSTFIX}",
"connectionName": "${CONN_CONFIG[$INDEX,$REGION]}",
"vNetId": "${CONN_CONFIG[$INDEX,$REGION]}-${POSTFIX}",
"description": "test description",
"firewallRules": [
{
"FromPort": "1",
"ToPort": "65535",
"IPProtocol": "tcp",
"Direction": "inbound",
"CIDR": "0.0.0.0/0"
},
{
"FromPort": "1",
"ToPort": "65535",
"IPProtocol": "udp",
"Direction": "inbound",
"CIDR": "0.0.0.0/0"
},
{
"FromPort": "-1",
"ToPort": "-1",
"IPProtocol": "icmp",
"Direction": "inbound",
"CIDR": "0.0.0.0/0"
},
{
"FromPort": "1",
"ToPort": "65535",
"IPProtocol": "tcp",
"Direction": "outbound",
"CIDR": "0.0.0.0/0"
},
{
"FromPort": "1",
"ToPort": "65535",
"IPProtocol": "udp",
"Direction": "outbound",
"CIDR": "0.0.0.0/0"
},
{
"FromPort": "-1",
"ToPort": "-1",
"IPProtocol": "icmp",
"Direction": "outbound",
"CIDR": "0.0.0.0/0"
}
]
}
EOF
); echo ${resp} | jq ''
echo ""
}

#function create_securityGroup() {

echo "####################################################################"
echo "## 4. SecurityGroup: Create"
echo "####################################################################"

source ../init.sh

if [ "${INDEX}" == "0" ]; then
echo "[Parallel execution for all CSP regions]"
INDEXX=${NumCSP}
for ((cspi = 1; cspi <= INDEXX; cspi++)); do
INDEXY=${NumRegion[$cspi]}
CSP=${CSPType[$cspi]}
echo "[$cspi] $CSP details"
for ((cspj = 1; cspj <= INDEXY; cspj++)); do
echo "[$cspi,$cspj] ${RegionName[$cspi,$cspj]}"

MCIRRegionName=${RegionName[$cspi,$cspj]}

CallTB

done

done
wait

else
echo ""

MCIRRegionName=${CONN_CONFIG[$INDEX,$REGION]}

CallTB

fi

#}

#create_securityGroup
Loading

0 comments on commit 6c9db65

Please sign in to comment.