-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance registerExistingSSHKey feature
- Loading branch information
1 parent
c458ede
commit bf2ebef
Showing
7 changed files
with
174 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
src/testclient/scripts/5.sshKey/spider-test-register-sshKey.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/bin/bash | ||
|
||
function CallSpider() { | ||
echo "- Get sshKey in ${MCIRRegionName}" | ||
|
||
resp=$( | ||
curl -H "${AUTH}" -sX POST http://$SpiderServer/spider/regkeypair -H 'Content-Type: application/json' -d @- <<EOF | ||
{ | ||
"ConnectionName": "${CONN_CONFIG[$INDEX,$REGION]}", | ||
"ReqInfo": { | ||
"Name": "${CONN_CONFIG[$INDEX,$REGION]}-${POSTFIX}", | ||
"CSPId": "jhseo-test" | ||
} | ||
} | ||
EOF | ||
); echo ${resp} | jq '' | ||
echo "" | ||
} | ||
|
||
#function spider_get_sshKey() { | ||
|
||
echo "####################################################################" | ||
echo "## 5. sshKey: Get" | ||
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]} | ||
|
||
CallSpider | ||
|
||
done | ||
|
||
done | ||
wait | ||
|
||
else | ||
echo "" | ||
|
||
MCIRRegionName=${CONN_CONFIG[$INDEX,$REGION]} | ||
|
||
CallSpider | ||
|
||
fi | ||
|
||
#} | ||
|
||
#spider_get_sshKey |
56 changes: 56 additions & 0 deletions
56
src/testclient/scripts/5.sshKey/test-register-csp-sshKey.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/bin/bash | ||
|
||
function CallTB() { | ||
echo "- Register sshKey in ${MCIRRegionName}" | ||
|
||
curl -H "${AUTH}" -sX POST http://$TumblebugServer/tumblebug/ns/$NSID/resources/sshKey?option=register -H 'Content-Type: application/json' -d \ | ||
'{ | ||
"connectionName": "'${CONN_CONFIG[$INDEX,$REGION]}'", | ||
"name": "'${CONN_CONFIG[$INDEX,$REGION]}'-'${POSTFIX}'", | ||
"cspSshKeyId": "jhseo-test", | ||
"fingerprint": "test-fingerprint", | ||
"username": "test-username", | ||
"publicKey": "test-public-key", | ||
"privateKey": "test-private-key" | ||
}' | jq '' | ||
} | ||
|
||
#function register_sshKey() { | ||
|
||
echo "####################################################################" | ||
echo "## 5. sshKey: Register" | ||
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 | ||
|
||
#} | ||
|
||
#register_sshKey |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters