Tests should depend on PIP instead of Yum

Unit tests now use pip to install the desired version of
pip.  Functional tests have been changed to use pip instead
of yum to install the desired version of pip.

Change-Id: I4ccc743385fb4258549c115e575c8834fd4d0561
Signed-off-by: Luis Pabon <lpabon@redhat.com>
Reviewed-on: http://review.gluster.org/5853
Reviewed-by: Peter Portante <pportant@redhat.com>
This commit is contained in:
Luis Pabon 2013-09-09 15:29:34 -04:00
parent e94cf06f87
commit 3609471ada
3 changed files with 12 additions and 11 deletions

View File

@ -16,15 +16,13 @@
# limitations under the License. # limitations under the License.
# Globals # Globals
FUNCTAG=functest.$$
cleanup() cleanup()
{ {
sudo service memcached stop sudo service memcached stop
sudo swift-init main stop sudo swift-init main stop
sudo yum -y remove glusterfs-openstack-swift sudo pip uninstall -y gluster-swift
sudo rm -rf /etc/swift > /dev/null 2>&1 sudo rm -rf /etc/swift > /dev/null 2>&1
rm -f build/glusterfs-openstack-swift-*${FUNCTAG}*rpm > /dev/null 2>&1
sudo rm -rf /mnt/gluster-object/test{,2}/* > /dev/null 2>&1 sudo rm -rf /mnt/gluster-object/test{,2}/* > /dev/null 2>&1
sudo setfattr -x user.swift.metadata /mnt/gluster-object/test{,2} > /dev/null 2>&1 sudo setfattr -x user.swift.metadata /mnt/gluster-object/test{,2} > /dev/null 2>&1
} }
@ -59,12 +57,15 @@ done
export SWIFT_TEST_CONFIG_FILE=/etc/swift/test.conf export SWIFT_TEST_CONFIG_FILE=/etc/swift/test.conf
# Create and install the rpm # Download and cache swift
PKG_RELEASE=${FUNCTAG} bash makerpm.sh pip install --no-install --download-cache=$HOME/.pipcache swift==1.9.1
sudo yum -y install build/glusterfs-openstack-swift-*${FUNCTAG}*.noarch.rpm || fail "Unable to install rpm" # Install swift
sudo pip install --download-cache=$HOME/.pipcache swift==1.9.1
# Install gluster-swift
sudo pip install -e $PWD
# Install the configuration files # Install the configuration files
mkdir /etc/swift > /dev/null 2>&1 sudo mkdir /etc/swift > /dev/null 2>&1
sudo cp -r test/functional/conf/* /etc/swift || fail "Unable to copy configuration files to /etc/swift" sudo cp -r test/functional/conf/* /etc/swift || fail "Unable to copy configuration files to /etc/swift"
( cd /etc/swift ; sudo gluster-swift-gen-builders test test2 ) || fail "Unable to create ring files" ( cd /etc/swift ; sudo gluster-swift-gen-builders test test2 ) || fail "Unable to create ring files"

View File

@ -1,8 +1,8 @@
# Install bounded pep8/pyflakes first, then let flake8 install # Install bounded pep8/pyflakes first, then let flake8 install
swift==1.9.1
pep8==1.4.5 pep8==1.4.5
pyflakes==0.7.2 pyflakes==0.7.2
flake8==2.0 flake8==2.0
coverage coverage
nose nose
nosexcover nosexcover

View File

@ -10,7 +10,7 @@ setenv = VIRTUAL_ENV={envdir}
NOSE_OPENSTACK_SHOW_ELAPSED=1 NOSE_OPENSTACK_SHOW_ELAPSED=1
NOSE_OPENSTACK_STDOUT=1 NOSE_OPENSTACK_STDOUT=1
deps = deps =
https://launchpad.net/swift/havana/1.9.1/+download/swift-1.9.1.tar.gz --download-cache={homedir}/.pipcache
-r{toxinidir}/tools/test-requires -r{toxinidir}/tools/test-requires
changedir = {toxinidir}/test/unit changedir = {toxinidir}/test/unit
commands = nosetests -v --exe --with-xunit --with-coverage --cover-package gluster --cover-erase --cover-xml --cover-html --cover-branches {posargs} commands = nosetests -v --exe --with-xunit --with-coverage --cover-package gluster --cover-erase --cover-xml --cover-html --cover-branches {posargs}
@ -21,7 +21,7 @@ downloadcache = ~/cache/pip
[testenv:pep8] [testenv:pep8]
changedir = {toxinidir} changedir = {toxinidir}
commands = commands =
flake8 gluster test extras flake8 gluster test
[testenv:cover] [testenv:cover]
setenv = NOSE_WITH_COVERAGE=1 setenv = NOSE_WITH_COVERAGE=1
@ -32,5 +32,5 @@ commands = {posargs}
[flake8] [flake8]
ignore = H ignore = H
builtins = _ builtins = _
exclude = .venv,.tox,dist,doc,test,*egg exclude = swiftkerbauth.py,.venv,.tox,dist,doc,test,*egg
show-source = True show-source = True