diff options
Diffstat (limited to 'test/ete/scripts')
-rwxr-xr-x | test/ete/scripts/deploy-onap.sh | 39 | ||||
-rwxr-xr-x | test/ete/scripts/install_openstack_cli.sh | 2 | ||||
-rwxr-xr-x | test/ete/scripts/remote/run-robot.sh | 16 | ||||
-rwxr-xr-x | test/ete/scripts/run-healthcheck.sh | 12 |
4 files changed, 56 insertions, 13 deletions
diff --git a/test/ete/scripts/deploy-onap.sh b/test/ete/scripts/deploy-onap.sh index 69296ab17..4802e02ce 100755 --- a/test/ete/scripts/deploy-onap.sh +++ b/test/ete/scripts/deploy-onap.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -x if [ -z "$WORKSPACE" ]; then export WORKSPACE=`git rev-parse --show-toplevel` @@ -8,19 +8,56 @@ source $WORKSPACE/test/ete/scripts/install_openstack_cli.sh # Delete all existing stacks STACKS=$(openstack stack list -c "Stack Name" -f value) + if [ ! -z "${STACKS}" ]; then echo "Deleting Stacks ${STACKS}" openstack stack delete -y $STACKS + for STACK in ${STACKS}; do + until [ "DELETE_IN_PROGRESS" != "$(openstack stack show -c stack_status -f value $STACK)" ]; do + sleep 30 + done + done else echo "No existing stacks to delete." fi + + + STACK="ete-$(uuidgen | cut -c-8)" echo "New Stack Name: ${STACK}" cp ${ONAP_WORKDIR}/demo/heat/ONAP/onap_openstack.env ${WORKSPACE}/test/ete/labs/windriver/onap-openstack-demo.env envsubst < ${WORKSPACE}/test/ete/labs/windriver/onap-openstack-template.env > ${WORKSPACE}/test/ete/labs/windriver/onap-openstack.env +#diff ${WORKSPACE}/test/ete/labs/windriver/onap-openstack-template.env ${WORKSPACE}/test/ete/labs/windriver/onap-openstack.env openstack stack create -t ${ONAP_WORKDIR}/demo/heat/ONAP/onap_openstack.yaml -e ${WORKSPACE}/test/ete/labs/windriver/onap-openstack.env $STACK +while [ "CREATE_IN_PROGRESS" == "$(openstack stack show -c stack_status -f value $STACK)" ]; do + sleep 15 +done + +STATUS=$(openstack stack show -c stack_status -f value $STACK) +echo $STATUS +if [ "CREATE_COMPLETE" != "$STATUS" ]; then + exit 1 +fi + + +# wait until Robot VM initializes +ROBOT_IP=$($WORKSPACE/test/ete/scripts/get-floating-ip.sh onap-robot) +echo "ROBOT_IP=${ROBOT_IP}" + +if [ "" == "${ROBOT_IP}" ]; then + exit 1 +fi + +ssh-keygen -R ${ROBOT_IP} + +SSH_KEY=~/.ssh/onap_key + +until ssh -o StrictHostKeychecking=no -i ${SSH_KEY} root@${ROBOT_IP} "docker ps | grep -q openecompete_container" +do + sleep 1m +done diff --git a/test/ete/scripts/install_openstack_cli.sh b/test/ete/scripts/install_openstack_cli.sh index ec5ad1f76..a6a0438f9 100755 --- a/test/ete/scripts/install_openstack_cli.sh +++ b/test/ete/scripts/install_openstack_cli.sh @@ -38,7 +38,7 @@ if [ -z "$ONAP_WORKDIR" ]; then fi echo "ONAP_WORKDIR=${ONAP_WORKDIR}" if [ ! -d ${ONAP_WORKDIR}/demo ]; then - git clone http://gerrit.onap.org/r/demo ${ONAP_WORKDIR}/demo + git clone https://gerrit.onap.org/r/demo ${ONAP_WORKDIR}/demo else pushd ${ONAP_WORKDIR}/demo git pull diff --git a/test/ete/scripts/remote/run-robot.sh b/test/ete/scripts/remote/run-robot.sh index ff7223a17..162acbe24 100755 --- a/test/ete/scripts/remote/run-robot.sh +++ b/test/ete/scripts/remote/run-robot.sh @@ -1,18 +1,20 @@ -#!/bin/bash +#!/bin/bash -x cd /opt -if [ ! -x /opt/demo.sh ]; then - echo "Robot VM not initialized" +docker ps | grep -q openecompete_container +if [ ! $? -eq 0 ]; then + echo "Robot not initialized" exit 2 fi if [ ! -d eteshare/logs/demo ]; then - echo "09d8566ea45e43aa974cf447ed591d77" > /opt/config/openstack_tenant_id.txt - echo "gary_wu" > /opt/config/openstack_username.txt - echo $OS_PASSWORD_INPUT > /opt/config/openstack_password.txt + echo $OS_PROJECT_ID > /opt/config/openstack_tenant_id.txt + echo $OS_USERNAME > /opt/config/openstack_username.txt + echo $OS_PASSWORD > /opt/config/openstack_password.txt /bin/bash /opt/eteshare/config/vm_config2robot.sh - echo "test" | /opt/demo.sh init_robot + # set robot VM http server password + echo "admin" | /opt/demo.sh init_robot fi /opt/ete.sh health diff --git a/test/ete/scripts/run-healthcheck.sh b/test/ete/scripts/run-healthcheck.sh index 1555dad85..2f0f014d3 100755 --- a/test/ete/scripts/run-healthcheck.sh +++ b/test/ete/scripts/run-healthcheck.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -x SSH_KEY=~/.ssh/onap_key @@ -13,10 +13,14 @@ cd $WORKSPACE/test/ete/scripts ROBOT_IP=$(./get-floating-ip.sh onap-robot) echo "ROBOT_IP=${ROBOT_IP}" -# allow direct login as root -ssh -o StrictHostKeychecking=no -i ${SSH_KEY} ubuntu@${ROBOT_IP} 'sudo cp /home/ubuntu/.ssh/authorized_keys /root/.ssh/' +if [ "" == "${ROBOT_IP}" ]; then + exit 1 +fi + +ssh-keygen -R ${ROBOT_IP} + +ssh -o StrictHostKeychecking=no -i ${SSH_KEY} root@${ROBOT_IP} "OS_PROJECT_ID=$OS_PROJECT_ID OS_USERNAME=$OS_USERNAME OS_PASSWORD=$OS_PASSWORD bash -s" < ./remote/run-robot.sh -ssh -o StrictHostKeychecking=no -i ${SSH_KEY} root@${ROBOT_IP} "OS_PASSWORD_INPUT=$OS_PASSWORD_INPUT bash -s" < ./remote/run-robot.sh LOG_DIR=$(ssh -o StrictHostKeychecking=no -i ${SSH_KEY} root@${ROBOT_IP} "ls -1t /opt/eteshare/logs | head -1") echo "Browse Robot results at http://${ROBOT_IP}:88/logs/${LOG_DIR}/" rsync -e "ssh -i ${SSH_KEY}" -avPz root@${ROBOT_IP}:/opt/eteshare/logs/${LOG_DIR}/ $WORKSPACE/archives/ |