blob: 1c326a5f1057f623180954cc2e6d2bd5fad08360 [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' \
Brian Freeman86805fe2019-01-16 09:03:42 -050018'robotframework-databaselibrary==0.8.1' 'robotframework-extendedselenium2library==0.9.1' 'robotframework-requests==0.5.0' \
DR695Hccff30b2017-02-17 18:44:24 -050019'robotframework-sshlibrary==2.1.2' \
20'robotframework-sudslibrary==0.8' 'robotframework-ftplibrary==1.3' 'robotframework-rammbock==0.4.0.1' \
marekpl503647c2018-10-24 14:33:25 +020021'deepdiff==2.5.1' 'dnspython==1.15.0' 'robotframework-httplibrary==0.4.2' 'robotframework-archivelibrary==0.3.2' 'PyYAML==3.12' \
22'robotframework-kafkalibrary==0.0.2'
DR695Hccff30b2017-02-17 18:44:24 -050023
24
25# 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 -050026if [ -d $path/testsuite/eteutils ]
DR695Hccff30b2017-02-17 18:44:24 -050027then
jf98600d5b0bf2017-02-24 14:39:40 -050028 # Support LF build location
29 cd $path/testsuite/eteutils
30else
DR695Hccff30b2017-02-17 18:44:24 -050031 cd ~
32 git config --global http.sslVerify false
33 if [ -d ~/python-testing-utils ]
34 then
35 cd python-testing-utils
36 git pull origin master
jf98600d5b0bf2017-02-24 14:39:40 -050037 else
Jerry Flooddb798792017-03-29 11:25:30 -040038 git clone https://gerrit.onap.org/r/testsuite/python-testing-utils.git
DR695Hccff30b2017-02-17 18:44:24 -050039 cd python-testing-utils
40 fi
41fi
Jerry Flooddb798792017-03-29 11:25:30 -040042pip install --no-cache-dir --upgrade --target="$path/robot/library" .
DR695Hccff30b2017-02-17 18:44:24 -050043
44
jf98600d5b0bf2017-02-24 14:39:40 -050045if [ -d $path/testsuite/heatbridge ]
DR695Hccff30b2017-02-17 18:44:24 -050046then
jf98600d5b0bf2017-02-24 14:39:40 -050047 # Support LF build location
48 cd $path/testsuite/heatbridge
49else
DR695Hccff30b2017-02-17 18:44:24 -050050 cd ~
51 git config --global http.sslVerify false
52 if [ -d ~/heatbridge ]
53 then
54 cd heatbridge
55 git pull origin master
jf98600d5b0bf2017-02-24 14:39:40 -050056 else
Jerry Flooddb798792017-03-29 11:25:30 -040057 git clone https://gerrit.onap.org/r/testsuite/heatbridge.git
DR695Hccff30b2017-02-17 18:44:24 -050058 cd heatbridge
59 fi
60fi
DR695H3abcd692017-08-03 12:22:23 -040061pip install --no-cache-dir --upgrade --target="$path/robot/library" ./heatbridge
DR695Hccff30b2017-02-17 18:44:24 -050062
63
64# NOTE: Patch to incude explicit install of paramiko to 2.0.2 to work with sshlibrary 2.1.2
65# This should be removed on new release of paramiko (2.1.2) or sshlibrary
66# https://github.com/robotframework/SSHLibrary/issues/157
Jerry Flooddb798792017-03-29 11:25:30 -040067pip install --no-cache-dir --target="$path/robot/library" -U 'paramiko==2.0.2'
DR695Hccff30b2017-02-17 18:44:24 -050068
Dina Dodinfabd1e82017-08-01 10:53:04 +030069
70# Go back to execution folder
71cd $path
72
73
DR695Hccff30b2017-02-17 18:44:24 -050074#
jf98600d5b0bf2017-02-24 14:39:40 -050075# Get the appropriate chromedriver. Default to linux64
DR695Hccff30b2017-02-17 18:44:24 -050076#
Gary Wubeb8acc2018-10-31 20:18:50 -070077CHROMEDRIVER_URL=http://chromedriver.storage.googleapis.com/2.43
DR695Hccff30b2017-02-17 18:44:24 -050078CHROMEDRIVER_ZIP=chromedriver_linux64.zip
79
jf98600d5b0bf2017-02-24 14:39:40 -050080# Handle mac and windows
DR695Hccff30b2017-02-17 18:44:24 -050081OS=`uname -s`
82case $OS in
jf98600d5b0bf2017-02-24 14:39:40 -050083 MINGW*_NT*)
DR695Hccff30b2017-02-17 18:44:24 -050084 CHROMEDRIVER_ZIP=chromedriver_win32.zip
85 ;;
86 Darwin*)
jf98600d5b0bf2017-02-24 14:39:40 -050087 CHROMEDRIVER_ZIP=chromedriver_mac64.zip
DR695Hccff30b2017-02-17 18:44:24 -050088 ;;
89 *) echo "Defaulting to Linux 64" ;;
90esac
91
92if [ $CHROMEDRIVER_ZIP == 'chromedriver_linux64.zip' ]
93then
jf98600d5b0bf2017-02-24 14:39:40 -050094 wget -O chromedriver.zip $CHROMEDRIVER_URL/$CHROMEDRIVER_ZIP
DR695Hccff30b2017-02-17 18:44:24 -050095 unzip chromedriver.zip -d /usr/local/bin
96else
jf98600d5b0bf2017-02-24 14:39:40 -050097 curl $CHROMEDRIVER_URL/$CHROMEDRIVER_ZIP -o chromedriver.zip
98 unzip chromedriver.zip
DR695Hccff30b2017-02-17 18:44:24 -050099fi
marekpl503647c2018-10-24 14:33:25 +0200100
101
102#
103# Install kafkacat : https://github.com/edenhill/kafkacat
104#
105OS=`uname -s`
106case $OS in
107 Darwin)
108 brew install kafkacat ;;
109 Linux)
110 apt-get -y install kafkacat
111esac
marekpl083c5582018-10-26 10:54:32 +0200112
113
114#
115# Install protobuf
116#
117OS=`uname -s`
118case $OS in
119 Darwin)
120 brew install protobuf ;;
121 Linux)
122 apt-get -y install protobuf-compiler
123esac