Gary Wu | 73202cf | 2017-10-23 15:15:52 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 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 | 6642b8f | 2017-10-27 11:21:56 -0700 | [diff] [blame^] | 16 | # allow direct login as root |
| 17 | ssh -o StrictHostKeychecking=no -i ${SSH_KEY} ubuntu@${ROBOT_IP} 'sudo cp /home/ubuntu/.ssh/authorized_keys /root/.ssh/' |
| 18 | |
Gary Wu | cd18207 | 2017-10-24 08:06:17 -0700 | [diff] [blame] | 19 | ssh -o StrictHostKeychecking=no -i ${SSH_KEY} root@${ROBOT_IP} "OS_PASSWORD_INPUT=$OS_PASSWORD_INPUT bash -s" < ./remote/run-robot.sh |
| 20 | LOG_DIR=$(ssh -o StrictHostKeychecking=no -i ${SSH_KEY} root@${ROBOT_IP} "ls -1t /opt/eteshare/logs | head -1") |
| 21 | rsync -e "ssh -i ${SSH_KEY}" -avPz root@${ROBOT_IP}:/opt/eteshare/logs/${LOG_DIR}/ $WORKSPACE/archives/ |