X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=scripts%2Fsdc%2Fsetup_sdc_for_sanity.sh;h=90ffa230e49fddb84ab630e3c54f7cc20eb395de;hb=2d19c2a1aa6aa8df3a7bd775e991a6af94104c3c;hp=2d644c3f7d18e5667182cabd129e0fceeea3e286;hpb=e12a5ef7fa61256acdc2d44df637bdb3aee370f3;p=integration%2Fcsit.git diff --git a/scripts/sdc/setup_sdc_for_sanity.sh b/scripts/sdc/setup_sdc_for_sanity.sh index 2d644c3f..90ffa230 100644 --- a/scripts/sdc/setup_sdc_for_sanity.sh +++ b/scripts/sdc/setup_sdc_for_sanity.sh @@ -1,9 +1,20 @@ #!/bin/bash function usage { - echo "usage: setup_sdc_for_sanity.sh {tad|tud}" - echo "setup sdc and run api test suite: setup_sdc_for_sanity.sh tad" - echo "setup sdc and run ui test suite: setup_sdc_for_sanity.sh tud" +cat < @@ -38,11 +49,24 @@ set -exo pipefail echo "This is ${WORKSPACE}/scripts/sdc/setup_sdc_for_sanity.sh" - -if [ "$1" != "tad" ] && [ "$1" != "tud" ]; then - usage - exit 1 -fi +ENABLE_SIMULATOR= +case "$1" in + tad|tud) + # enable test + export TEST_SUITE="-${1}" + ;; + '') + # we will just setup sdc - no tests + export TEST_SUITE="" + + # this is mandatory + ENABLE_SIMULATOR="--simulator" + ;; + *) + usage + exit 1 + ;; +esac # Clone sdc enviroment template mkdir -p "${WORKSPACE}/data/environments/" @@ -50,6 +74,7 @@ mkdir -p "${WORKSPACE}/data/clone/" cd "${WORKSPACE}/data/clone" if using_local_images && [ -n "$SDC_LOCAL_GITREPO" ] ; then + SDC_LOCAL_GITREPO=$(realpath "$SDC_LOCAL_GITREPO") if [ -d "$SDC_LOCAL_GITREPO" ] ; then rm -rf ./sdc cp -a "$SDC_LOCAL_GITREPO" ./sdc @@ -58,7 +83,7 @@ if using_local_images && [ -n "$SDC_LOCAL_GITREPO" ] ; then exit 1 fi else - git clone --depth 1 http://gerrit.onap.org/r/sdc -b ${GERRIT_BRANCH} + git clone --depth 1 "https://gerrit.onap.org/r/sdc" -b ${GERRIT_BRANCH} fi # TODO: why? @@ -68,9 +93,8 @@ chmod -R 777 "${WORKSPACE}/data/clone" export ENV_NAME='CSIT' export MR_IP_ADDR='10.0.0.1' -export TEST_SUITE="$1" -ifconfig +ip a IP_ADDRESS=`ip route get 8.8.8.8 | awk '/src/{ print $7 }'` export HOST_IP="$IP_ADDRESS" @@ -110,13 +134,13 @@ if using_local_images ; then --local \ -r "${RELEASE}" \ -e "${ENV_NAME}" \ - -p 10001 "-${TEST_SUITE}" + -p 10001 ${TEST_SUITE} ${ENABLE_SIMULATOR} else echo "[INFO]: We will download images from the default registry (tag: ${RELEASE})" ${WORKSPACE}/scripts/sdc/docker_run.sh \ -r "${RELEASE}" \ -e "${ENV_NAME}" \ - -p 10001 "-${TEST_SUITE}" + -p 10001 ${TEST_SUITE} ${ENABLE_SIMULATOR} fi # final step if the robot test needs to be adjusted