blob: e91555e4c6c53f30a16ce059c89969f2d6e3d4cc [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)
Puzikov Dmitry38bcba62019-02-15 16:58:35 +010016pip install \
17--no-cache-dir \
18--exists-action s \
19--target="$path/robot/library" \
20'selenium<=3.0.0' \
21'requests==2.11.1' \
22'robotframework-selenium2library==1.8.0' \
23'robotframework-databaselibrary==0.8.1' \
24'robotframework-extendedselenium2library==0.9.1' \
25'robotframework-requests==0.5.0' \
DR695Hccff30b2017-02-17 18:44:24 -050026'robotframework-sshlibrary==2.1.2' \
Puzikov Dmitry38bcba62019-02-15 16:58:35 +010027'robotframework-sudslibrary==0.8' \
28'robotframework-ftplibrary==1.3' \
29'robotframework-rammbock==0.4.0.1' \
30'deepdiff==2.5.1' \
31'dnspython==1.15.0' \
32'robotframework-httplibrary==0.4.2' \
33'robotframework-archivelibrary==0.3.2' \
34'PyYAML==3.12' \
marekpl503647c2018-10-24 14:33:25 +020035'robotframework-kafkalibrary==0.0.2'
DR695Hccff30b2017-02-17 18:44:24 -050036
37
38# 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 -050039if [ -d $path/testsuite/eteutils ]
DR695Hccff30b2017-02-17 18:44:24 -050040then
jf98600d5b0bf2017-02-24 14:39:40 -050041 # Support LF build location
42 cd $path/testsuite/eteutils
43else
DR695Hccff30b2017-02-17 18:44:24 -050044 cd ~
45 git config --global http.sslVerify false
46 if [ -d ~/python-testing-utils ]
47 then
48 cd python-testing-utils
49 git pull origin master
jf98600d5b0bf2017-02-24 14:39:40 -050050 else
Jerry Flooddb798792017-03-29 11:25:30 -040051 git clone https://gerrit.onap.org/r/testsuite/python-testing-utils.git
DR695Hccff30b2017-02-17 18:44:24 -050052 cd python-testing-utils
53 fi
54fi
Puzikov Dmitry38bcba62019-02-15 16:58:35 +010055
56pip install \
57--no-cache-dir \
58--upgrade \
59--exists-action s \
60--target="$path/robot/library" .
DR695Hccff30b2017-02-17 18:44:24 -050061
62
jf98600d5b0bf2017-02-24 14:39:40 -050063if [ -d $path/testsuite/heatbridge ]
DR695Hccff30b2017-02-17 18:44:24 -050064then
jf98600d5b0bf2017-02-24 14:39:40 -050065 # Support LF build location
66 cd $path/testsuite/heatbridge
67else
DR695Hccff30b2017-02-17 18:44:24 -050068 cd ~
69 git config --global http.sslVerify false
70 if [ -d ~/heatbridge ]
71 then
72 cd heatbridge
73 git pull origin master
jf98600d5b0bf2017-02-24 14:39:40 -050074 else
Jerry Flooddb798792017-03-29 11:25:30 -040075 git clone https://gerrit.onap.org/r/testsuite/heatbridge.git
DR695Hccff30b2017-02-17 18:44:24 -050076 cd heatbridge
77 fi
78fi
Puzikov Dmitry38bcba62019-02-15 16:58:35 +010079
80pip install \
81--no-cache-dir \
82--upgrade \
83--exists-action s \
84--target="$path/robot/library" \
85./heatbridge
DR695Hccff30b2017-02-17 18:44:24 -050086
87
88# NOTE: Patch to incude explicit install of paramiko to 2.0.2 to work with sshlibrary 2.1.2
89# This should be removed on new release of paramiko (2.1.2) or sshlibrary
90# https://github.com/robotframework/SSHLibrary/issues/157
Puzikov Dmitry38bcba62019-02-15 16:58:35 +010091pip install \
92--no-cache-dir \
93--target="$path/robot/library" \
94-U 'paramiko==2.0.2'
DR695Hccff30b2017-02-17 18:44:24 -050095
Dina Dodinfabd1e82017-08-01 10:53:04 +030096
97# Go back to execution folder
98cd $path
99
Puzikov Dmitry38bcba62019-02-15 16:58:35 +0100100# if the script is running during the image build skip the rest of it
101# as required software is installed already.
102if $BUILDTIME
DR695Hccff30b2017-02-17 18:44:24 -0500103then
Dmitry Puzikovb0e12b42019-03-04 11:06:16 +0100104 # we need to update PATH with chromium-chromedriver
105 echo "Adding in-container chromedriver to PATH"
106 ln -s /usr/lib/chromium-browser/chromedriver /usr/local/bin/chromedriver
107
Puzikov Dmitry38bcba62019-02-15 16:58:35 +0100108 echo "Skipping desktop steps, building container image..."
109else
110 #
111 # Get the appropriate chromedriver. Default to linux64
112 #
113 CHROMEDRIVER_URL=http://chromedriver.storage.googleapis.com/2.43
114 CHROMEDRIVER_ZIP=chromedriver_linux64.zip
115 CHROMEDRIVER_TARGET=chromedriver.zip
marekpl503647c2018-10-24 14:33:25 +0200116
Puzikov Dmitry38bcba62019-02-15 16:58:35 +0100117 # Handle mac and windows
118 OS=`uname -s`
119 case $OS in
120 MINGW*_NT*)
121 CHROMEDRIVER_ZIP=chromedriver_win32.zip
122 ;;
123 Darwin*)
124 CHROMEDRIVER_ZIP=chromedriver_mac64.zip
125 ;;
126 *) echo "Defaulting to Linux 64" ;;
127 esac
128
129 if [ $CHROMEDRIVER_ZIP == 'chromedriver_linux64.zip' ]
130 then
131 curl $CHROMEDRIVER_URL/$CHROMEDRIVER_ZIP -o $CHROMEDRIVER_TARGET
132 unzip chromedriver.zip -d /usr/local/bin
133 else
134 curl $CHROMEDRIVER_URL/$CHROMEDRIVER_ZIP -o $CHROMEDRIVER_TARGET
135 unzip $CHROMEDRIVER_TARGET
136 fi
137 rm -rf $CHROMEDRIVER_TARGET
138fi
marekpl503647c2018-10-24 14:33:25 +0200139
140#
141# Install kafkacat : https://github.com/edenhill/kafkacat
142#
143OS=`uname -s`
144case $OS in
145 Darwin)
146 brew install kafkacat ;;
147 Linux)
148 apt-get -y install kafkacat
149esac
marekpl083c5582018-10-26 10:54:32 +0200150#
151# Install protobuf
152#
153OS=`uname -s`
154case $OS in
155 Darwin)
156 brew install protobuf ;;
157 Linux)
158 apt-get -y install protobuf-compiler
Puzikov Dmitry38bcba62019-02-15 16:58:35 +0100159esac