diff options
author | Filip Krzywka <filip.krzywka@nokia.com> | 2019-01-10 07:59:56 +0100 |
---|---|---|
committer | Filip Krzywka <filip.krzywka@nokia.com> | 2019-01-10 08:43:59 +0100 |
commit | 23ebedbae53f8cb91332744133c99ef502c595ec (patch) | |
tree | bbf54ff9d6d2ec83a8b786742e16fb81236d9b49 /development/bin/run-xnf-simulator.sh | |
parent | 867f482cbb9241df483b815c16be01d9ff391f09 (diff) |
Update development scripts
This changeset is mostly follow-up after merges in DCAEGEN2-1063
- new options for hv-ves hostname and port in xnf simulations scripts
- new option for disabling SSL in xnf simulations scripts
- fail start-simulation script on not completing all simulations
- use docker-healthchecks to determine xNF simulator readiness in
development scripts
- fix logging in xNF simulator on closing connection
- minor corrections in logs and usage for development scripts
Change-Id: Ic939a139fdaf86ad487e0b31d6abcfc6c8a28885
Issue-ID: DCAEGEN2-1063
Signed-off-by: Filip Krzywka <filip.krzywka@nokia.com>
Diffstat (limited to 'development/bin/run-xnf-simulator.sh')
-rwxr-xr-x | development/bin/run-xnf-simulator.sh | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/development/bin/run-xnf-simulator.sh b/development/bin/run-xnf-simulator.sh index d8de0097..e4d8d94a 100755 --- a/development/bin/run-xnf-simulator.sh +++ b/development/bin/run-xnf-simulator.sh @@ -21,7 +21,13 @@ set -euo pipefail usage() { echo "Start xnf-simulator container on given port and inside of given docker-network" - echo "Usage: $0 [-h|--help] [-v|--verbose] <xnf listen port> [<hv ves docker network>]" + echo "Usage: $0 [-h|--help] [-v|--verbose] [--ssl-disable] <xnf listen port> [<hv ves hostname> <hv ves port> <hv ves docker network>]" + echo "" + echo "Optional parameters:" + echo " - ssl-disable : Should xNF simulator be configured without using SSL/TLS connections" + echo "Default values:" + echo " - hv ves hostname: ves-hv-collector" + echo " - hv ves port: 6061" exit 1 } @@ -32,6 +38,8 @@ while getopts "$optspec" arg; do case "${OPTARG}" in verbose) VERBOSE=True ;; + ssl-disable) + SSL_DISABLE=True ;; help) usage ;; *) @@ -53,27 +61,42 @@ shift $((OPTIND-1)) LISTEN_PORT=$1 -if [ $# -gt 1 ]; then - HV_VES_NETWORK=${2} +HV_VES_HOSTNAME=${2:-ves-hv-collector} +HV_VES_PORT=${3:-6061} +if [ $# -gt 3 ]; then + HV_VES_NETWORK=${4} fi PORTS="${LISTEN_PORT}:${LISTEN_PORT}/tcp" HV_VES_REPO_HOME=$(realpath $(dirname "$0"))/.. +if [ -n "${SSL_DISABLE+x}" ]; then + SSL_CONFIGURATION="--ssl-disable" +else + SSL_CONFIGURATION="--key-store-password onaponap --trust-store-password onaponap" +fi + if [ -n "${VERBOSE+x}" ]; then - echo "Starting xnf-simulator with ports configuration: ${PORTS}" + echo "Starting xnf-simulator with " + echo " - ports configuration: ${PORTS}" + echo " - SSL configuration: ${SSL_CONFIGURATION}" echo "Container id:" fi + XNF_CONTAINER_ID=$(docker run -d \ -v ${HV_VES_REPO_HOME}/ssl/:/etc/ves-hv/ \ + --health-cmd='curl -s -f http://localhost:6063/health/ready || exit 1' \ + --health-interval=5s \ + --health-retries=3 \ + --health-start-period='10s' \ -p ${PORTS} \ onap/org.onap.dcaegen2.collectors.hv-ves.hv-collector-xnf-simulator \ --listen-port ${LISTEN_PORT} \ - --ves-host ves-hv-collector \ - --ves-port 6061 \ - --key-store-password onaponap \ - --trust-store-password onaponap) + --health-check-api-port 6063 \ + --ves-host ${HV_VES_HOSTNAME} \ + --ves-port ${HV_VES_PORT} \ + ${SSL_CONFIGURATION}) echo $XNF_CONTAINER_ID |