-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change method to input parameters for script (#677)
* Change default vm spec for script * Add init.sh for script initialization * Apply named param and merge cmd scripts * Apply named param for mcis create scripts * Apply named param for mcis clean scripts * Apply named param for mcis wv deploy script
- Loading branch information
1 parent
17f70e8
commit 19f3fd5
Showing
12 changed files
with
133 additions
and
258 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
source ../common-functions.sh | ||
readParametersByName "$@" | ||
set -- "$CSP" "$REGION" "$POSTFIX" "$TestSetFile" "$OPTION01" "$OPTION02" "$OPTION03" | ||
|
||
FILE=../credentials.conf | ||
if [ ! -f "$FILE" ]; then | ||
echo "$FILE does not exist." | ||
exit | ||
fi | ||
|
||
if [ ! -f "$TestSetFile" ]; then | ||
echo "$TestSetFile does not exist." | ||
exit | ||
fi | ||
source $TestSetFile | ||
source ../conf.env | ||
source ../credentials.conf | ||
|
||
getCloudIndex $CSP | ||
MCISID=${MCISPREFIX}-${POSTFIX} | ||
|
||
echo "[Check jq package (if not, install)]" | ||
if ! dpkg-query -W -f='${Status}' jq | grep "ok installed"; then sudo apt install -y jq; fi |
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
50 changes: 21 additions & 29 deletions
50
src/testclient/scripts/sequentialFullTest/command-mcis-custom.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 |
---|---|---|
@@ -1,44 +1,36 @@ | ||
#!/bin/bash | ||
|
||
#function command_mcis_custom() { | ||
|
||
TestSetFile=${4:-../testSet.env} | ||
if [ ! -f "$TestSetFile" ]; then | ||
echo "$TestSetFile does not exist." | ||
exit | ||
fi | ||
source $TestSetFile | ||
source ../conf.env | ||
|
||
echo "####################################################################" | ||
echo "## Command (SSH) to MCIS " | ||
echo "## Command (SSH) to MCIS with a user command" | ||
echo "####################################################################" | ||
|
||
CSP=${1} | ||
REGION=${2:-1} | ||
POSTFIX=${3:-developer} | ||
|
||
source ../common-functions.sh | ||
getCloudIndex $CSP | ||
source ../init.sh | ||
|
||
USERCMD=${5} | ||
USERCMD=$OPTION01 | ||
VMID=$OPTION02 | ||
|
||
MCISID=${CONN_CONFIG[$INDEX,$REGION]}-${POSTFIX} | ||
|
||
if [ "${INDEX}" == "0" ]; then | ||
# MCISPREFIX=avengers | ||
MCISID=${MCISPREFIX}-${POSTFIX} | ||
if [ -z "$USERCMD" ]; then | ||
USERCMD="echo -n [Public IP: ; curl https://api.ipify.org ; echo -n ], [Hostname: ; hostname ; echo -n ]" | ||
fi | ||
|
||
VAR1=$( | ||
curl -H "${AUTH}" -sX POST http://$TumblebugServer/tumblebug/ns/$NSID/cmd/mcis/$MCISID -H 'Content-Type: application/json' -d @- <<EOF | ||
if [ -z "$VMID" ]; then | ||
|
||
VAR1=$( | ||
curl -H "${AUTH}" -sX POST http://$TumblebugServer/tumblebug/ns/$NSID/cmd/mcis/$MCISID -H 'Content-Type: application/json' -d @- <<EOF | ||
{ | ||
"command" : "${USERCMD}" | ||
} | ||
EOF | ||
) | ||
echo "${VAR1}" | jq '' | ||
) | ||
else | ||
VAR1=$( | ||
curl -H "${AUTH}" -sX POST http://$TumblebugServer/tumblebug/ns/$NSID/cmd/mcis/$MCISID/vm/$VMID -H 'Content-Type: application/json' -d @- <<EOF | ||
{ | ||
"command" : "${USERCMD}" | ||
} | ||
EOF | ||
) | ||
|
||
#} | ||
fi | ||
|
||
#command_mcis_custom | ||
echo "${VAR1}" | jq '' |
45 changes: 0 additions & 45 deletions
45
src/testclient/scripts/sequentialFullTest/command-mcis-vm-custom.sh
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.