blob: d89fd02ffbae53299e7c4281e24f8d51bd9809fa [file] [log] [blame]
DR695Hccff30b2017-02-17 18:44:24 -05001#!/bin/bash
2#
3# setup : script to setup required runtime environment. This script can be run again to update anything
4# this should stay in your project directory
Dina Dodinfabd1e82017-08-01 10:53:04 +03005
6
7# save console output in setup_<timestamp>.log file in project directory
8timestamp=$(date +"%m%d%Y_%H%M%S")
9LOG_FILE=setup_$timestamp.log
10exec > >(tee -a ${LOG_FILE} )
11exec 2> >(tee -a ${LOG_FILE} >&2)
12
DR695Hccff30b2017-02-17 18:44:24 -050013
14# get the path
15path=$(pwd)
16
jf9860e7707182017-03-01 12:04:43 -050017pip install --no-cache-dir --target="$path/robot/library" 'selenium<=3.0.0' 'requests==2.11.1' 'robotframework-selenium2library==1.8.0' \
DR695Hccff30b2017-02-17 18:44:24 -050018'robotframework-databaselibrary==0.8.1' 'robotframework-extendedselenium2library==0.9.1' 'robotframework-requests==0.4.5' \
19'robotframework-sshlibrary==2.1.2' \
20'robotframework-sudslibrary==0.8' 'robotframework-ftplibrary==1.3' 'robotframework-rammbock==0.4.0.1' \
21'deepdiff==2.5.1' 'dnspython==1.15.0' 'robotframework-httplibrary==0.4.2' 'robotframework-archivelibrary==0.3.2' 'PyYAML==3.12'
22
23
24# get the git for the eteutils you will need to add a private key to your ssh before this
jf98600d5b0bf2017-02-24 14:39:40 -050025if [ -d $path/testsuite/eteutils ]
DR695Hccff30b2017-02-17 18:44:24 -050026then
jf98600d5b0bf2017-02-24 14:39:40 -050027 # Support LF build location
28 cd $path/testsuite/eteutils
29else
DR695Hccff30b2017-02-17 18:44:24 -050030 cd ~
31 git config --global http.sslVerify false
32 if [ -d ~/python-testing-utils ]
33 then
34 cd python-testing-utils
35 git pull origin master
jf98600d5b0bf2017-02-24 14:39:40 -050036 else
Jerry Flooddb798792017-03-29 11:25:30 -040037 git clone https://gerrit.onap.org/r/testsuite/python-testing-utils.git
DR695Hccff30b2017-02-17 18:44:24 -050038 cd python-testing-utils
39 fi
40fi
Jerry Flooddb798792017-03-29 11:25:30 -040041pip install --no-cache-dir --upgrade --target="$path/robot/library" .
DR695Hccff30b2017-02-17 18:44:24 -050042
43
jf98600d5b0bf2017-02-24 14:39:40 -050044if [ -d $path/testsuite/heatbridge ]
DR695Hccff30b2017-02-17 18:44:24 -050045then
jf98600d5b0bf2017-02-24 14:39:40 -050046 # Support LF build location
47 cd $path/testsuite/heatbridge
48else
DR695Hccff30b2017-02-17 18:44:24 -050049 cd ~
50 git config --global http.sslVerify false
51 if [ -d ~/heatbridge ]
52 then
53 cd heatbridge
54 git pull origin master
jf98600d5b0bf2017-02-24 14:39:40 -050055 else
Jerry Flooddb798792017-03-29 11:25:30 -040056 git clone https://gerrit.onap.org/r/testsuite/heatbridge.git
DR695Hccff30b2017-02-17 18:44:24 -050057 cd heatbridge
58 fi
59fi
DR695H3abcd692017-08-03 12:22:23 -040060pip install --no-cache-dir --upgrade --target="$path/robot/library" ./heatbridge
DR695Hccff30b2017-02-17 18:44:24 -050061
62
63# NOTE: Patch to incude explicit install of paramiko to 2.0.2 to work with sshlibrary 2.1.2
64# This should be removed on new release of paramiko (2.1.2) or sshlibrary
65# https://github.com/robotframework/SSHLibrary/issues/157
Jerry Flooddb798792017-03-29 11:25:30 -040066pip install --no-cache-dir --target="$path/robot/library" -U 'paramiko==2.0.2'
DR695Hccff30b2017-02-17 18:44:24 -050067
Dina Dodinfabd1e82017-08-01 10:53:04 +030068
69# Go back to execution folder
70cd $path
71
72
DR695Hccff30b2017-02-17 18:44:24 -050073#
jf98600d5b0bf2017-02-24 14:39:40 -050074# Get the appropriate chromedriver. Default to linux64
DR695Hccff30b2017-02-17 18:44:24 -050075#
76CHROMEDRIVER_URL=http://chromedriver.storage.googleapis.com/2.27
77CHROMEDRIVER_ZIP=chromedriver_linux64.zip
78
jf98600d5b0bf2017-02-24 14:39:40 -050079# Handle mac and windows
DR695Hccff30b2017-02-17 18:44:24 -050080OS=`uname -s`
81case $OS in
jf98600d5b0bf2017-02-24 14:39:40 -050082 MINGW*_NT*)
DR695Hccff30b2017-02-17 18:44:24 -050083 CHROMEDRIVER_ZIP=chromedriver_win32.zip
84 ;;
85 Darwin*)
jf98600d5b0bf2017-02-24 14:39:40 -050086 CHROMEDRIVER_ZIP=chromedriver_mac64.zip
DR695Hccff30b2017-02-17 18:44:24 -050087 ;;
88 *) echo "Defaulting to Linux 64" ;;
89esac
90
91if [ $CHROMEDRIVER_ZIP == 'chromedriver_linux64.zip' ]
92then
jf98600d5b0bf2017-02-24 14:39:40 -050093 wget -O chromedriver.zip $CHROMEDRIVER_URL/$CHROMEDRIVER_ZIP
DR695Hccff30b2017-02-17 18:44:24 -050094 unzip chromedriver.zip -d /usr/local/bin
95else
jf98600d5b0bf2017-02-24 14:39:40 -050096 curl $CHROMEDRIVER_URL/$CHROMEDRIVER_ZIP -o chromedriver.zip
97 unzip chromedriver.zip
DR695Hccff30b2017-02-17 18:44:24 -050098fi