diff options
author | jhh <jorge.hernandez-herrero@att.com> | 2019-04-29 20:17:45 -0500 |
---|---|---|
committer | Bilal A <bilal@research.att.com> | 2019-06-03 17:58:53 +0000 |
commit | 1e0b621a2449411fcd0e5f2cce247170b6d12bd7 (patch) | |
tree | 1b10ec7b8e57629431a5e0f7b61d752a1d89e12b /scripts/policy/drools-pdp-script.sh | |
parent | 7c6988932beb63e6c572e14086983208cd61ca34 (diff) |
Restructure CSITs for info and timeouts
Change-Id: I8a1bf5d44da267e58f26e877fc0eba7189166424
Issue-ID: POLICY-1712
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
(cherry picked from commit de399b090495c66e7c8ae5f07c1b60056b886656)
Diffstat (limited to 'scripts/policy/drools-pdp-script.sh')
-rwxr-xr-x | scripts/policy/drools-pdp-script.sh | 82 |
1 files changed, 58 insertions, 24 deletions
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 # |