aboutsummaryrefslogtreecommitdiffstats
path: root/plans/so/integration-etsi-testing
diff options
context:
space:
mode:
authorwaqas.ikram <waqas.ikram@est.tech>2019-08-14 14:27:41 +0000
committerWaqas Ikram <waqas.ikram@est.tech>2019-08-14 14:28:05 +0000
commit50e7ec9e942e0aaa75867ed854c926639514e5e7 (patch)
tree21465a80a69911967167d16b4196ff4577245a6d /plans/so/integration-etsi-testing
parent75c1171a3a0d0fbfe8a71b8b9fe308356f45c35d (diff)
Minor update to wait-for-container script
Change-Id: I60fe89b1c16b961718e371f5bcf54b9d884160a7 Issue-ID: SO-2144 Signed-off-by: waqas.ikram <waqas.ikram@est.tech>
Diffstat (limited to 'plans/so/integration-etsi-testing')
-rw-r--r--plans/so/integration-etsi-testing/config/env1
-rwxr-xr-xplans/so/integration-etsi-testing/config/wait-for-container.sh24
-rwxr-xr-xplans/so/integration-etsi-testing/setup.sh12
3 files changed, 24 insertions, 13 deletions
diff --git a/plans/so/integration-etsi-testing/config/env b/plans/so/integration-etsi-testing/config/env
index 5334c8cb..54d67205 100644
--- a/plans/so/integration-etsi-testing/config/env
+++ b/plans/so/integration-etsi-testing/config/env
@@ -2,3 +2,4 @@ NEXUS_DOCKER_REPO_MSO=nexus3.onap.org:10001
TAG=1.4.0-STAGING-latest
TIME_OUT_DEFAULT_VALUE_SEC=1200
PROJECT_NAME=etsiintegrationtesting
+DEFAULT_NETWORK_NAME=etsiintegrationtesting_default
diff --git a/plans/so/integration-etsi-testing/config/wait-for-container.sh b/plans/so/integration-etsi-testing/config/wait-for-container.sh
index c2cbc262..598715d9 100755
--- a/plans/so/integration-etsi-testing/config/wait-for-container.sh
+++ b/plans/so/integration-etsi-testing/config/wait-for-container.sh
@@ -32,11 +32,11 @@ usage()
cat<<-EOF
Command Arguments:
- -n, --name
+ -c, --container-name
Mandatory argument. container name
- -p, --project-name
- Mandatory argument. project name
+ -n, --network-name
+ Mandatory argument. network name
-t, --timeout
Mandatory argument. time out value in seconds (must be number)
@@ -64,8 +64,8 @@ invalid_arguments()
process_arguments()
{
- SHORT_ARGS="n:p:t:"
- LONG_ARGS="help,name:,project-name:,timeout:"
+ SHORT_ARGS="c:n:t:"
+ LONG_ARGS="help,container-name:,network-name:,timeout:"
args=$(getopt -o $SHORT_ARGS -l $LONG_ARGS -n "$0" -- "$@" 2>&1 )
[[ $? -ne 0 ]] && invalid_arguments $( echo " $args"| head -1 )
@@ -76,11 +76,11 @@ process_arguments()
while true; do
case "$1" in
- -n|--name)
+ -c|--container-name)
NAME=$2
shift 2 ;;
- -p|project-name)
- PROJECT_NAME=$2
+ -n|--network-name)
+ NETWORK_NAME=$2
shift 2 ;;
-t|--timeout)
TIME_OUT=$2
@@ -102,8 +102,8 @@ process_arguments()
echo "$SCRIPT_NAME $(current_timestamp): error: Container name must not be empty! $NAME" >&2; exit 1
fi
- if [ -z "$PROJECT_NAME" ]; then
- echo "$SCRIPT_NAME $(current_timestamp): error: project name must not be empty! $PROJECT_NAME" >&2; exit 1
+ if [ -z "$NETWORK_NAME" ]; then
+ echo "$SCRIPT_NAME $(current_timestamp): error: network name must not be empty! $NETWORK_NAME" >&2; exit 1
fi
regex='^[0-9]+$'
@@ -118,10 +118,10 @@ process_arguments()
exit 1
fi
- HOST_IP=$(docker inspect --format '{{ index .NetworkSettings.Networks "'$PROJECT_NAME'" "IPAddress"}}' $CONTAINER_NAME)
+ HOST_IP=$(docker inspect --format '{{ index .NetworkSettings.Networks "'$NETWORK_NAME'" "IPAddress"}}' $CONTAINER_NAME)
if [ $? -ne 0 ]; then
- echo "$SCRIPT_NAME $(current_timestamp) ERROR: Unable to find HOST IP using project name: $PROJECT_NAME and container name: $CONTAINER_NAME"
+ echo "$SCRIPT_NAME $(current_timestamp) ERROR: Unable to find HOST IP using network name: $NETWORK_NAME and container name: $CONTAINER_NAME"
exit 1
fi
diff --git a/plans/so/integration-etsi-testing/setup.sh b/plans/so/integration-etsi-testing/setup.sh
index 6f0c0106..ee0058ef 100755
--- a/plans/so/integration-etsi-testing/setup.sh
+++ b/plans/so/integration-etsi-testing/setup.sh
@@ -47,6 +47,16 @@ echo "Running $SCRIPT_HOME/$SCRIPT_NAME ..."
export $(egrep -v '^#' $ENV_FILE | xargs)
+MANDATORY_VARIABLES_NAMES=( "NEXUS_DOCKER_REPO_MSO" "TAG" "TIME_OUT_DEFAULT_VALUE_SEC" "PROJECT_NAME" "DEFAULT_NETWORK_NAME")
+
+for var in "${MANDATORY_VARIABLES_NAMES[@]}"
+ do
+ if [ -z "${!var}" ]; then
+ echo "Missing mandatory attribute $var in $ENV_FILE"
+ exit 1
+ fi
+done
+
if [[ ! "$TEMP_DIR_PATH" || ! -d "$TEMP_DIR_PATH" ]]; then
echo "Creating temporary directory $TEMP_DIR_PATH"
mkdir $TEMP_DIR_PATH
@@ -154,7 +164,7 @@ fi
API_INFRA_CONTAINER_NAME="api-handler-infra"
echo "Will execute $WAIT_FOR_CONTAINER_SCRIPT to wait for $API_INFRA_CONTAINER_NAME container to start up"
-$WAIT_FOR_CONTAINER_SCRIPT -n "$API_INFRA_CONTAINER_NAME" -t "300" -p "${PROJECT_NAME}_default"
+$WAIT_FOR_CONTAINER_SCRIPT -c "$API_INFRA_CONTAINER_NAME" -t "300" -n "$DEFAULT_NETWORK_NAME"
if [ $? -ne 0 ]; then
echo "ERROR: $WAIT_FOR_CONTAINER_SCRIPT failed"