diff options
-rwxr-xr-x | plans/policy/drools-pdp/setup.sh | 4 | ||||
-rwxr-xr-x | plans/policy/health/setup.sh | 4 | ||||
-rwxr-xr-x | scripts/policy/drools-pdp-script.sh | 82 | ||||
-rwxr-xr-x | scripts/policy/engine.sh | 76 | ||||
-rwxr-xr-x | scripts/policy/wait_for_port.sh | 15 | ||||
-rw-r--r-- | tests/vid/newVNFChange/test1.robot | 3 |
6 files changed, 142 insertions, 42 deletions
diff --git a/plans/policy/drools-pdp/setup.sh b/plans/policy/drools-pdp/setup.sh index 459805be..4851cd7e 100755 --- a/plans/policy/drools-pdp/setup.sh +++ b/plans/policy/drools-pdp/setup.sh @@ -17,6 +17,10 @@ # Place the scripts in run order: source ${SCRIPTS}/common_functions.sh +docker login -u docker -p docker nexus3.onap.org:10001 +docker pull nexus3.onap.org:10001/onap/policy-common-alpine:1.4.0 +docker tag nexus3.onap.org:10001/onap/policy-common-alpine:1.4.0 onap/policy-common-alpine:1.4.0 + source ${WORKSPACE}/scripts/policy/drools-pdp-script.sh # Pass any variables required by Robot test suites in ROBOT_VARIABLES diff --git a/plans/policy/health/setup.sh b/plans/policy/health/setup.sh index c99af3fa..1b1155d8 100755 --- a/plans/policy/health/setup.sh +++ b/plans/policy/health/setup.sh @@ -17,6 +17,10 @@ # Place the scripts in run order: source ${SCRIPTS}/common_functions.sh +docker login -u docker -p docker nexus3.onap.org:10001 +docker pull nexus3.onap.org:10001/onap/policy-common-alpine:1.4.0 +docker tag nexus3.onap.org:10001/onap/policy-common-alpine:1.4.0 onap/policy-common-alpine:1.4.0 + source ${WORKSPACE}/scripts/policy/engine.sh # Pass any variables required by Robot test suites in ROBOT_VARIABLES diff --git a/scripts/policy/drools-pdp-script.sh b/scripts/policy/drools-pdp-script.sh index 0a128faf..fc8556ff 100755 --- a/scripts/policy/drools-pdp-script.sh +++ b/scripts/policy/drools-pdp-script.sh @@ -1,6 +1,6 @@ -#!/bin/bash +#!/bin/bash -x # -# Copyright 2017-2018 AT&T Intellectual Property. All rights reserved. +# Copyright 2017-2019 AT&T Intellectual Property. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -159,25 +159,72 @@ fi netstat -tnl -docker logs mariadb ${DIR}/wait_for_port.sh ${MARIADB_IP} 3306 +rc=$? +if [[ $rc != 0 ]]; then + echo "cannot open ${MARIADB_IP} 3306" + telnet ${MARIADB_IP} 3306 < /dev/null + nc -vz ${MARIADB_IP} 3306 + docker logs mariadb + exit $rc +fi + +${DIR}/wait_for_port.sh ${NEXUS_IP} 8081 +rc=$? +if [[ $rc != 0 ]]; then + echo "cannot open ${NEXUS_IP} 8081" + telnet ${NEXUS_IP} 8081 < /dev/null + nc -vz ${NEXUS_IP} 8081 + docker logs nexus + exit $rc +fi + +${DIR}/wait_for_port.sh ${POLICY_IP} 9696 +rc=$? +if [[ $rc != 0 ]]; then + echo "cannot open ${POLICY_IP} 9696" + telnet ${POLICY_IP} 9696 < /dev/null + nc -vz ${POLICY_IP} 9696 + docker logs drools + exit $rc +fi -docker logs pap ${DIR}/wait_for_port.sh ${PAP_IP} 9091 +rc=$? +if [[ $rc != 0 ]]; then + echo "cannot open ${PAP_IP} 9091" + telnet ${PAP_IP} 9091 < /dev/null + nc -vz ${PAP_IP} 9091 + docker logs pap + exit $rc +fi -docker logs pdp ${DIR}/wait_for_port.sh ${PDP_IP} 8081 +rc=$? +if [[ $rc != 0 ]]; then + echo "cannot open ${PDP_IP} 8081" + telnet ${PDP_IP} 8081 < /dev/null + nc -vz ${PDP_IP} 8081 + docker logs pdp + exit $rc +fi -docker logs brmsgw ${DIR}/wait_for_port.sh ${BRMS_IP} 9989 - -docker logs nexus -${DIR}/wait_for_port.sh ${NEXUS_IP} 8081 +rc=$? +if [[ $rc != 0 ]]; then + echo "cannot open ${BRMS_IP} 9989" + telnet ${BRMS_IP} 9989" < /dev/null + nc -vz ${BRMS_IP} 9989" + docker logs brmsgw + exit $rc +fi docker logs drools -${DIR}/wait_for_port.sh ${POLICY_IP} 9696 +docker logs pap +docker logs pdp +docker logs brmsgw -TIME_OUT=600 +TIME_OUT=300 INTERVAL=20 TIME=0 while [ "$TIME" -lt "$TIME_OUT" ]; do @@ -189,19 +236,6 @@ while [ "$TIME" -lt "$TIME_OUT" ]; do done -TIME_OUT=600 -INTERVAL=20 -TIME=0 -while [ "$TIME" -lt "$TIME_OUT" ]; do - - curl -k -i -v -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'ClientAuth: cHl0aG9uOnRlc3Q=' -H 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' -H 'Environment: TEST' -d '{"policyName": ".*"}' https://${PDP_IP}:8081/pdp/api/getConfig && break - -echo Sleep: $INTERVAL seconds before testing if Policy is up. Total wait time up now is: $TIME seconds. Timeout is: $TIME_OUT seconds - sleep $INTERVAL - TIME=$(($TIME+$INTERVAL)) - -done - # # Add more sleep for everything to settle # diff --git a/scripts/policy/engine.sh b/scripts/policy/engine.sh index b806cec5..ef02be5a 100755 --- a/scripts/policy/engine.sh +++ b/scripts/policy/engine.sh @@ -1,6 +1,6 @@ -#!/bin/bash +#!/bin/bash -x # -# Copyright 2017-2018 AT&T Intellectual Property. All rights reserved. +# Copyright 2017-2019 AT&T Intellectual Property. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -159,25 +159,77 @@ fi netstat -tnl -docker logs mariadb ${DIR}/wait_for_port.sh ${MARIADB_IP} 3306 +rc=$? +if [[ $rc != 0 ]]; then + echo "cannot open ${MARIADB_IP} 3306" + telnet ${MARIADB_IP} 3306 < /dev/null + nc -vz ${MARIADB_IP} 3306 + docker logs mariadb + exit $rc +fi + +${DIR}/wait_for_port.sh ${NEXUS_IP} 8081 +rc=$? +if [[ $rc != 0 ]]; then + echo "cannot open ${NEXUS_IP} 8081" + netstat -tnl + telnet ${NEXUS_IP} 8081 < /dev/null + nc -vz ${NEXUS_IP} 8081 + docker logs nexus + exit $rc +fi + +${DIR}/wait_for_port.sh ${POLICY_IP} 9696 +rc=$? +if [[ $rc != 0 ]]; then + echo "cannot open ${POLICY_IP} 9696" + netstat -tnl + telnet ${POLICY_IP} 9696 < /dev/null + nc -vz ${POLICY_IP} 9696 + docker logs drools + exit $rc +fi -docker logs pap ${DIR}/wait_for_port.sh ${PAP_IP} 9091 +rc=$? +if [[ $rc != 0 ]]; then + echo "cannot open ${PAP_IP} 9091" + netstat -tnl + telnet ${PAP_IP} 9091 < /dev/null + nc -vz ${PAP_IP} 9091 + docker logs pap + exit $rc +fi -docker logs pdp ${DIR}/wait_for_port.sh ${PDP_IP} 8081 +rc=$? +if [[ $rc != 0 ]]; then + echo "cannot open ${PDP_IP} 8081" + netstat -tnl + telnet ${PDP_IP} 8081 < /dev/null + nc -vz ${PDP_IP} 8081 + docker logs pdp + exit $rc +fi -docker logs brmsgw ${DIR}/wait_for_port.sh ${BRMS_IP} 9989 - -docker logs nexus -${DIR}/wait_for_port.sh ${NEXUS_IP} 8081 +rc=$? +if [[ $rc != 0 ]]; then + echo "cannot open ${BRMS_IP} 9989" + netstat -tnl + telnet ${BRMS_IP} 9989" < /dev/null + nc -vz ${BRMS_IP} 9989" + docker logs brmsgw + exit $rc +fi docker logs drools -${DIR}/wait_for_port.sh ${POLICY_IP} 6969 +docker logs pap +docker logs pdp +docker logs brmsgw -TIME_OUT=600 +TIME_OUT=300 INTERVAL=20 TIME=0 while [ "$TIME" -lt "$TIME_OUT" ]; do @@ -189,7 +241,7 @@ while [ "$TIME" -lt "$TIME_OUT" ]; do done -TIME_OUT=600 +TIME_OUT=300 INTERVAL=20 TIME=0 while [ "$TIME" -lt "$TIME_OUT" ]; do diff --git a/scripts/policy/wait_for_port.sh b/scripts/policy/wait_for_port.sh index 10f08ded..58bf25d0 100755 --- a/scripts/policy/wait_for_port.sh +++ b/scripts/policy/wait_for_port.sh @@ -5,14 +5,17 @@ if [[ $# -ne 2 ]]; then exit 1 fi -host=$1 -port=$2 +export host=$1 +export port=$2 echo "Waiting for $host port $port open" -until telnet $host $port </dev/null 2>/dev/null | grep -q '^Connected'; do - sleep 1 -done +timeout 120 bash -c 'until nc -vz "$host" "$port"; do echo -n "."; sleep 1; done' +rc=$? -echo "$host port $port is open" +if [[ $rc != 0 ]]; then + echo "$host port $port cannot be reached" + exit $rc +fi +echo "$host port $port is open" exit 0 diff --git a/tests/vid/newVNFChange/test1.robot b/tests/vid/newVNFChange/test1.robot index 33d0ae3a..44977ed5 100644 --- a/tests/vid/newVNFChange/test1.robot +++ b/tests/vid/newVNFChange/test1.robot @@ -18,6 +18,7 @@ add new VNF Change in VID GUI From Local worfkow Setup Browser Go To ${VID_LOGIN_URL} + Set Selenium Speed ${GLOBAL_SELENIUM_DELAY} Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT} @@ -27,6 +28,8 @@ add new VNF Change in VID GUI From Local worfkow Click Button xpath=//input[@id='loginBtn'] Wait Until Page Contains Welcome to VID ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} + Run Process ${CURDIR}/../resources/scripts/SetFeatureFlag.sh FLAG_HANDLE_SO_WORKFLOWS false shell=True cwd=${CURDIR}/../resources/scripts/ + Reload Page Wait Until Page Contains VNF Changes ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT} |