From b8bc40250811cce0869d68d372051733dbe4cb84 Mon Sep 17 00:00:00 2001 From: Luis Pabon Date: Thu, 19 Sep 2013 13:18:17 -0400 Subject: Use tox to satisfy functional test requirements Instead of installing and polluting the host development system with the required packages to run the functional tests, it is now possible to run the functional tests from inside tox. All the required packages are installed in the tox environment and run from there. The only external dependencies are that the functional tests still must use /etc/swift for configuration files on the host and /mnt/gluster-object must be on a XFS or GlusterFS volume. Change-Id: I4a949dbcad778018e22c61d09ae1ba5f21a03aec Signed-off-by: Luis Pabon Reviewed-on: http://review.gluster.org/5976 Reviewed-by: Peter Portante Tested-by: Peter Portante --- tools/functional_tests.sh | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'tools') diff --git a/tools/functional_tests.sh b/tools/functional_tests.sh index af76831..421188b 100755 --- a/tools/functional_tests.sh +++ b/tools/functional_tests.sh @@ -15,13 +15,18 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Globals +# This program expects to be run by tox in a virtual python environment +# so that it does not pollute the host development system + +sudo_env() +{ + sudo bash -c "PATH=$PATH $*" +} cleanup() { sudo service memcached stop - sudo swift-init main stop - sudo pip uninstall -y gluster-swift + sudo_env swift-init main stop sudo rm -rf /etc/swift > /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 @@ -57,21 +62,14 @@ done export SWIFT_TEST_CONFIG_FILE=/etc/swift/test.conf -# Download and cache swift -pip install --no-install --download-cache=$HOME/.pipcache swift==1.9.1 -# 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 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" -( cd /etc/swift ; sudo gluster-swift-gen-builders test test2 ) || fail "Unable to create ring files" +sudo_env gluster-swift-gen-builders test test2 || fail "Unable to create ring files" # Start the services sudo service memcached start || fail "Unable to start memcached" -sudo swift-init main start || fail "Unable to start swift" +sudo_env swift-init main start || fail "Unable to start swift" mkdir functional_tests > /dev/null 2>&1 nosetests -v --exe \ -- cgit