system-config/modules/openstack_project/files/slave_scripts/run-tox.sh
K Jonathan Harker 8e7f9e3458 Move openstack-specific config out of ::jenkins
The ::jenkins::slave class contained a lot of openstack-specific
configuration rather than configuration of a generic jenkins slave.

The term "bare slave" is overloaded and confusing: create simple_slave
and thick_slave to differentiate between the two meanings of "bare".
Some portions of ::jenkins::slave will move to simple_slave, some
portions to thick_slave, and some portions to slave_common (all in the
openstack_project module).

Change-Id: I5281a03a7f6da3f98714bcc59ae840ace8435578
2014-05-20 14:39:51 -07:00

63 lines
1.5 KiB
Bash
Executable File

#!/bin/bash -x
# If a bundle file is present, call tox with the jenkins version of
# the test environment so it is used. Otherwise, use the normal
# (non-bundle) test environment. Also, run pip freeze on the
# resulting environment at the end so that we have a record of exactly
# what packages we ended up testing.
#
# Usage: run-tox.sh VENV
#
# Where VENV is the name of the tox environment to run (specified in the
# project's tox.ini file).
venv=$1
org=$2
project=$3
if [[ -z "$venv" || -z "$org" || -z "$project" ]]
then
echo "Usage: $? VENV ORG PROJECT"
echo
echo "VENV: The tox environment to run (eg 'python27')"
echo "ORG: The project organization (eg 'stackforge')"
echo "PROJECT: The project name (eg 'nova')"
exit 1
fi
/usr/local/jenkins/slave_scripts/jenkins-oom-grep.sh pre
sudo /usr/local/jenkins/slave_scripts/jenkins-sudo-grep.sh pre
source /usr/local/jenkins/slave_scripts/select-mirror.sh $org $project
tox -v -e$venv
result=$?
sudo /usr/local/jenkins/slave_scripts/jenkins-sudo-grep.sh post
sudoresult=$?
if [ $sudoresult -ne "0" ]
then
echo
echo "This test has failed because it attempted to execute commands"
echo "with sudo. See above for the exact commands used."
echo
exit 1
fi
/usr/local/jenkins/slave_scripts/jenkins-oom-grep.sh post
oomresult=$?
if [ $oomresult -ne "0" ]
then
echo
echo "This test has failed because it attempted to exceed configured"
echo "memory limits and was killed prior to completion. See above"
echo "for related kernel messages."
echo
exit 1
fi
exit $result