blob: e97ac3ff5b678740a8c3bc147ba22a165406c3ce [file] [log] [blame]
Gary Wu4aa2aee2017-11-09 11:42:15 -08001#!/bin/bash -x
Gary Wu73202cf2017-10-23 15:15:52 -07002
Gary Wucd182072017-10-24 08:06:17 -07003SSH_KEY=~/.ssh/onap_key
4
Gary Wu73202cf2017-10-23 15:15:52 -07005if [ -z "$WORKSPACE" ]; then
6 export WORKSPACE=`git rev-parse --show-toplevel`
7fi
8
Gary Wu17cd9cb2017-10-23 15:18:39 -07009source $WORKSPACE/test/ete/scripts/install_openstack_cli.sh
10
Gary Wu73202cf2017-10-23 15:15:52 -070011cd $WORKSPACE/test/ete/scripts
12
13ROBOT_IP=$(./get-floating-ip.sh onap-robot)
14echo "ROBOT_IP=${ROBOT_IP}"
15
Gary Wu4aa2aee2017-11-09 11:42:15 -080016if [ "" == "${ROBOT_IP}" ]; then
17 exit 1
18fi
19
Gary Wue8ac9b52017-11-09 10:08:27 -080020ssh-keygen -R ${ROBOT_IP}
Gary Wu6642b8f2017-10-27 11:21:56 -070021
Gary Wue0031922018-05-21 21:53:42 -070022set +x
Gary Wu370132c2018-05-09 10:33:57 -070023timeout 15m 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
Gary Wu16038802018-01-19 16:55:15 -080024RESULT=$?
Gary Wue0031922018-05-21 21:53:42 -070025set -x
Gary Wu1030aa02017-11-09 11:13:32 -080026
Gary Wue0031922018-05-21 21:53:42 -070027LOG_DIR=$(ssh -i ${SSH_KEY} root@${ROBOT_IP} "ls -1t /opt/eteshare/logs | grep health | head -1")
Gary Wu35ed5402017-10-30 14:06:09 -070028echo "Browse Robot results at http://${ROBOT_IP}:88/logs/${LOG_DIR}/"
Gary Wue0031922018-05-21 21:53:42 -070029rsync -e "ssh -i ${SSH_KEY}" -avtz root@${ROBOT_IP}:/opt/eteshare/logs/${LOG_DIR}/ $WORKSPACE/archives/
Gary Wu16038802018-01-19 16:55:15 -080030exit $RESULT