path: root/tools
diff options
authorLuis Pabon <>2013-09-19 13:18:17 -0400
committerPeter Portante <>2013-09-20 12:51:17 -0700
commitb8bc40250811cce0869d68d372051733dbe4cb84 (patch)
tree6376c4013a3f1791a0e598aab9adac901df250ef /tools
parent7d5e6ed57e4b818c5b8b130b53f57d47dc20e327 (diff)
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: Reviewed-by: Peter Portante <> Tested-by: Peter Portante <>
Diffstat (limited to 'tools')
1 files changed, 10 insertions, 12 deletions
diff --git a/tools/ b/tools/
index af76831..421188b 100755
--- a/tools/
+++ b/tools/
@@ -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 bash -c "PATH=$PATH $*"
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 \