blob: 50e344ab15e6c3d4803865a239617a959404ffee [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
Puzikov Dmitry38bcba62019-02-15 16:58:35 +0100104 echo "Skipping desktop steps, building container image..."
105else
106 #
107 # Get the appropriate chromedriver. Default to linux64
108 #
109 CHROMEDRIVER_URL=http://chromedriver.storage.googleapis.com/2.43
110 CHROMEDRIVER_ZIP=chromedriver_linux64.zip
111 CHROMEDRIVER_TARGET=chromedriver.zip
marekpl503647c2018-10-24 14:33:25 +0200112
Puzikov Dmitry38bcba62019-02-15 16:58:35 +0100113 # Handle mac and windows
114 OS=`uname -s`
115 case $OS in
116 MINGW*_NT*)
117 CHROMEDRIVER_ZIP=chromedriver_win32.zip
118 ;;
119 Darwin*)
120 CHROMEDRIVER_ZIP=chromedriver_mac64.zip
121 ;;
122 *) echo "Defaulting to Linux 64" ;;
123 esac
124
125 if [ $CHROMEDRIVER_ZIP == 'chromedriver_linux64.zip' ]
126 then
127 curl $CHROMEDRIVER_URL/$CHROMEDRIVER_ZIP -o $CHROMEDRIVER_TARGET
128 unzip chromedriver.zip -d /usr/local/bin
129 else
130 curl $CHROMEDRIVER_URL/$CHROMEDRIVER_ZIP -o $CHROMEDRIVER_TARGET
131 unzip $CHROMEDRIVER_TARGET
132 fi
133 rm -rf $CHROMEDRIVER_TARGET
134fi
marekpl503647c2018-10-24 14:33:25 +0200135
136#
137# Install kafkacat : https://github.com/edenhill/kafkacat
138#
139OS=`uname -s`
140case $OS in
141 Darwin)
142 brew install kafkacat ;;
143 Linux)
144 apt-get -y install kafkacat
145esac
marekpl083c5582018-10-26 10:54:32 +0200146#
147# Install protobuf
148#
149OS=`uname -s`
150case $OS in
151 Darwin)
152 brew install protobuf ;;
153 Linux)
154 apt-get -y install protobuf-compiler
Puzikov Dmitry38bcba62019-02-15 16:58:35 +0100155esac