Gary Wu | 4aa2aee | 2017-11-09 11:42:15 -0800 | [diff] [blame] | 1 | #!/bin/bash -x |
Gary Wu | 73202cf | 2017-10-23 15:15:52 -0700 | [diff] [blame] | 2 | |
Gary Wu | cd18207 | 2017-10-24 08:06:17 -0700 | [diff] [blame] | 3 | SSH_KEY=~/.ssh/onap_key |
| 4 | |
Gary Wu | 73202cf | 2017-10-23 15:15:52 -0700 | [diff] [blame] | 5 | if [ -z "$WORKSPACE" ]; then |
| 6 | export WORKSPACE=`git rev-parse --show-toplevel` |
| 7 | fi |
| 8 | |
Gary Wu | 17cd9cb | 2017-10-23 15:18:39 -0700 | [diff] [blame] | 9 | source $WORKSPACE/test/ete/scripts/install_openstack_cli.sh |
| 10 | |
Gary Wu | 73202cf | 2017-10-23 15:15:52 -0700 | [diff] [blame] | 11 | cd $WORKSPACE/test/ete/scripts |
| 12 | |
| 13 | ROBOT_IP=$(./get-floating-ip.sh onap-robot) |
| 14 | echo "ROBOT_IP=${ROBOT_IP}" |
| 15 | |
Gary Wu | 4aa2aee | 2017-11-09 11:42:15 -0800 | [diff] [blame] | 16 | if [ "" == "${ROBOT_IP}" ]; then |
| 17 | exit 1 |
| 18 | fi |
| 19 | |
Gary Wu | e8ac9b5 | 2017-11-09 10:08:27 -0800 | [diff] [blame] | 20 | ssh-keygen -R ${ROBOT_IP} |
Gary Wu | 6642b8f | 2017-10-27 11:21:56 -0700 | [diff] [blame] | 21 | |
Gary Wu | e003192 | 2018-05-21 21:53:42 -0700 | [diff] [blame] | 22 | set +x |
Gary Wu | 370132c | 2018-05-09 10:33:57 -0700 | [diff] [blame] | 23 | timeout 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 Wu | 1603880 | 2018-01-19 16:55:15 -0800 | [diff] [blame] | 24 | RESULT=$? |
Gary Wu | e003192 | 2018-05-21 21:53:42 -0700 | [diff] [blame] | 25 | set -x |
Gary Wu | 1030aa0 | 2017-11-09 11:13:32 -0800 | [diff] [blame] | 26 | |
Gary Wu | e003192 | 2018-05-21 21:53:42 -0700 | [diff] [blame] | 27 | LOG_DIR=$(ssh -i ${SSH_KEY} root@${ROBOT_IP} "ls -1t /opt/eteshare/logs | grep health | head -1") |
Gary Wu | 35ed540 | 2017-10-30 14:06:09 -0700 | [diff] [blame] | 28 | echo "Browse Robot results at http://${ROBOT_IP}:88/logs/${LOG_DIR}/" |
Gary Wu | e003192 | 2018-05-21 21:53:42 -0700 | [diff] [blame] | 29 | rsync -e "ssh -i ${SSH_KEY}" -avtz root@${ROBOT_IP}:/opt/eteshare/logs/${LOG_DIR}/ $WORKSPACE/archives/ |
Gary Wu | 1603880 | 2018-01-19 16:55:15 -0800 | [diff] [blame] | 30 | exit $RESULT |