blob: 66f0f02f17d102da084dd283437fa376eb150379 [file] [log] [blame]
mpriyank220711e2022-03-11 17:22:24 +05301#!/bin/bash -x
2#
emaclee75d07ea2024-01-18 12:44:58 +00003# Copyright (C) 2022-2024 Nordix Foundation.
mpriyank220711e2022-03-11 17:22:24 +05304#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16# ============LICENSE_END=========================================================
17#
18# This script installs common libraries required by CSIT tests
19#
20# Branched from ccsdk/distribution to this repository Feb 23, 2021
21#
emaclee75d07ea2024-01-18 12:44:58 +000022echo "---> prepare-csit.sh"
mpriyank220711e2022-03-11 17:22:24 +053023
24if [ -z "$WORKSPACE" ]; then
25 export WORKSPACE=`git rev-parse --show-toplevel`
26fi
27
28TESTPLANDIR=${WORKSPACE}/${TESTPLAN}
29
emaclee75d07ea2024-01-18 12:44:58 +000030# Version should match those used to setup robot-framework in other jobs/stages
31# Use pyenv for selecting the python version
32if [[ -d "/opt/pyenv" ]]; then
33 echo "Setup pyenv:"
34 export PYENV_ROOT="/opt/pyenv"
35 export PATH="$PYENV_ROOT/bin:$PATH"
36 pyenv versions
37 if command -v pyenv 1>/dev/null 2>&1; then
38 eval "$(pyenv init - --no-rehash)"
39 # Choose the latest numeric Python version from installed list
40 version=$(pyenv versions --bare | sed '/^[^0-9]/d' | sort -V | tail -n 1)
41 pyenv local "${version}"
42 fi
43fi
44
45# Assume that if ROBOT3_VENV is set and virtualenv with system site packages can be activated,
mpriyank220711e2022-03-11 17:22:24 +053046# ci-management/jjb/integration/include-raw-integration-install-robotframework.sh has already
47# been executed
48
49if [ -f ${WORKSPACE}/env.properties ]; then
50 source ${WORKSPACE}/env.properties
51fi
emaclee75d07ea2024-01-18 12:44:58 +000052if [ -f ${ROBOT3_VENV}/bin/activate ]; then
53 source ${ROBOT3_VENV}/bin/activate
54else
mpriyank220711e2022-03-11 17:22:24 +053055 rm -rf /tmp/ci-management
56 rm -f ${WORKSPACE}/env.properties
57 cd /tmp
emaclee75d07ea2024-01-18 12:44:58 +000058 git clone "https://gerrit.onap.org/r/ci-management"
mpriyank220711e2022-03-11 17:22:24 +053059 source ${WORKSPACE}/install-robotframework.sh
emaclee75d07ea2024-01-18 12:44:58 +000060fi
mpriyank220711e2022-03-11 17:22:24 +053061
62# install eteutils
emaclee75d07ea2024-01-18 12:44:58 +000063mkdir -p ${ROBOT3_VENV}/src/onap
64rm -rf ${ROBOT3_VENV}/src/onap/testsuite
mpriyank220711e2022-03-11 17:22:24 +053065
emaclee75d07ea2024-01-18 12:44:58 +000066python3 -m pip install --upgrade --extra-index-url="https://nexus3.onap.org/repository/PyPi.staging/simple" 'robotframework-onap==11.0.0.dev17' --pre
67
68echo "Versioning information:"
69python3 --version
mpriyank220711e2022-03-11 17:22:24 +053070pip freeze
71
emaclee75d07ea2024-01-18 12:44:58 +000072python3 -m robot.run --version || :