Merge "Cleanup comments and error message in setup_env"
This commit is contained in:
commit
165026d771
24
setup_env
24
setup_env
@ -9,7 +9,7 @@ function usage {
|
|||||||
echo "Usage: ${SCRIPT_NAME} [OPTION]..."
|
echo "Usage: ${SCRIPT_NAME} [OPTION]..."
|
||||||
echo "Setup RefStack client with test environment"
|
echo "Setup RefStack client with test environment"
|
||||||
echo ""
|
echo ""
|
||||||
echo " -h, Print this usage message"
|
echo " -h Print this usage message"
|
||||||
echo " -c Tempest test runner commit. You can specify SHA or branch here"
|
echo " -c Tempest test runner commit. You can specify SHA or branch here"
|
||||||
echo " -t Tempest test runner tag. You can specify tag here"
|
echo " -t Tempest test runner tag. You can specify tag here"
|
||||||
echo " If no commit or tag is specified, tempest will be install from commit"
|
echo " If no commit or tag is specified, tempest will be install from commit"
|
||||||
@ -17,7 +17,7 @@ function usage {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
#Check that parameter is a valid tag in tempest repository
|
# Check that parameter is a valid tag in tempest repository
|
||||||
function check_tag {
|
function check_tag {
|
||||||
tags="$(git tag)"
|
tags="$(git tag)"
|
||||||
for tag in ${tags}; do
|
for tag in ${tags}; do
|
||||||
@ -26,7 +26,7 @@ function check_tag {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
#By default tempest uses from commit 551e1a9701e7e2b3edf6d49a2eaa62b7ab2435ad
|
# By default tempest uses from commit 551e1a9701e7e2b3edf6d49a2eaa62b7ab2435ad
|
||||||
|
|
||||||
while getopts c:t:h FLAG; do
|
while getopts c:t:h FLAG; do
|
||||||
case ${FLAG} in
|
case ${FLAG} in
|
||||||
@ -45,9 +45,9 @@ while getopts c:t:h FLAG; do
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
shift $((OPTIND-1)) #This tells getopts to move on to the next argument.
|
shift $((OPTIND-1)) # This tells getopts to move on to the next argument.
|
||||||
|
|
||||||
#Install git
|
# Install git
|
||||||
if [ -n "$(command -v apt-get)" ]; then
|
if [ -n "$(command -v apt-get)" ]; then
|
||||||
# For apt-get-based Linux distributions (Ubuntu, Debian)
|
# For apt-get-based Linux distributions (Ubuntu, Debian)
|
||||||
# If we run script in container we need sudo
|
# If we run script in container we need sudo
|
||||||
@ -76,16 +76,16 @@ elif [ -n "$(command) -v zypper" ]; then
|
|||||||
fi
|
fi
|
||||||
sudo zypper --non-interactive install git
|
sudo zypper --non-interactive install git
|
||||||
else
|
else
|
||||||
echo "Neither apt-get nor yum nor zypper found"
|
echo "Neither apt-get, nor yum, nor zypper found"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
WORKDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
WORKDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
#Checkout tempest on specified tag
|
# Checkout tempest on specified tag
|
||||||
if [ -d "${WORKDIR}/.tempest" ]; then
|
if [ -d "${WORKDIR}/.tempest" ]; then
|
||||||
while true; do
|
while true; do
|
||||||
read -p "Installed tempest found.We should remove it. All data from previouse test runs will be deleted. Continue (y/n) ?" yn
|
read -p "Existing tempest installation found. We should remove it. All data from previous test runs will be deleted. Continue (y/n) ?" yn
|
||||||
case ${yn} in
|
case ${yn} in
|
||||||
[Yy]* ) rm -rf ${WORKDIR}/.tempest; break;;
|
[Yy]* ) rm -rf ${WORKDIR}/.tempest; break;;
|
||||||
[Nn]* ) exit 1;;
|
[Nn]* ) exit 1;;
|
||||||
@ -110,11 +110,11 @@ elif [ -n "$(command) -v zypper" ]; then
|
|||||||
# For zypper-based distributions (openSuSe, SELS)
|
# For zypper-based distributions (openSuSe, SELS)
|
||||||
sudo zypper --non-interactive install curl wget tar unzip make python-devel.x86_64 gcc gcc-c++ libffi-devel libxml2-devel zlib-devel libxslt-devel libopenssl-devel python-xml
|
sudo zypper --non-interactive install curl wget tar unzip make python-devel.x86_64 gcc gcc-c++ libffi-devel libxml2-devel zlib-devel libxslt-devel libopenssl-devel python-xml
|
||||||
else
|
else
|
||||||
echo "Neither apt-get nor yum nor zypper found"
|
echo "Neither apt-get, nor yum, nor zypper found."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#Build local python interpreter if needed
|
# Build local python interpreter if needed
|
||||||
if [ ! -n "$(command -v python2.7)" ]; then
|
if [ ! -n "$(command -v python2.7)" ]; then
|
||||||
PY_VERSION="2.7.8"
|
PY_VERSION="2.7.8"
|
||||||
echo "python2.7 not found. Building python ${PY_VERSION}..."
|
echo "python2.7 not found. Building python ${PY_VERSION}..."
|
||||||
@ -135,7 +135,7 @@ echo "python2.7 found!"
|
|||||||
PYPATH="python2.7"
|
PYPATH="python2.7"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#Setup virtual environments for refstack-client and tempest
|
# Setup virtual environments for refstack-client and tempest
|
||||||
VENV_VERSION='1.11.6'
|
VENV_VERSION='1.11.6'
|
||||||
wget https://pypi.python.org/packages/source/v/virtualenv/virtualenv-${VENV_VERSION}.tar.gz
|
wget https://pypi.python.org/packages/source/v/virtualenv/virtualenv-${VENV_VERSION}.tar.gz
|
||||||
tar xvfz virtualenv-${VENV_VERSION}.tar.gz
|
tar xvfz virtualenv-${VENV_VERSION}.tar.gz
|
||||||
@ -151,5 +151,5 @@ rm virtualenv-${VENV_VERSION}.tar.gz
|
|||||||
${WORKDIR}/.venv/bin/pip install -r ${WORKDIR}/requirements.txt
|
${WORKDIR}/.venv/bin/pip install -r ${WORKDIR}/requirements.txt
|
||||||
${WORKDIR}/.tempest/.venv/bin/pip install -r ${WORKDIR}/.tempest/requirements.txt
|
${WORKDIR}/.tempest/.venv/bin/pip install -r ${WORKDIR}/.tempest/requirements.txt
|
||||||
|
|
||||||
# add additional packages to find more tests by tempest
|
# Add additional packages to find more tests by tempest
|
||||||
${WORKDIR}/.tempest/.venv/bin/pip install -r ${WORKDIR}/tempest-additional-requirements.txt
|
${WORKDIR}/.tempest/.venv/bin/pip install -r ${WORKDIR}/tempest-additional-requirements.txt
|
||||||
|
Loading…
x
Reference in New Issue
Block a user