#! /bin/sh set -e -x # $Id$ # $URL$ # # Quick and Dirty test installation on a remote host # # testTestversion [host] runtests # # A python package is build and saved on a temporary location. # The resulting tarball: 'dist/test-$USER.tar.gz' is copied to a targethost:/tmp/ # where 'installTestversion' will install the package in the ~/server directory, # REMOVING any previous installations # targethost=$1 case $targethost in '') echo Usage: testTestversion targethost [runtests] \(to OVERWRITE current bzv installation on that host\) ; exit 1 ;; esac cp -a setup.py setup.py.org sed -e "s/version = .*/version = 'test-$USER',"/ setup.py.org > setup.py2 chmod 755 setup.py2 newver=$(sed -rn "s/.*version = '([^']*)'.*/\1/p" setup.py2) ./setup.py2 sdist mine=bzv-test-$USER file=$mine.tar.gz echo Installing on host: $targethost scp dist/$file $targethost:/tmp/ ssh $targethost "rm -rf ~/server /tmp/$mine; cd /tmp && tar xf $file && cd /tmp/$mine && ./installTestversion" case $2 in runtests) ssh $targethost "cd /tmp/$mine/test && ln -s ../src bzv; LANG=en_US.UTF-8 ./alltests.py; LANG=en_US.UTF-8 ./integrationtest.py; LANG=en_US.UTF-8 ./oai_integrationtest.py" ;; esac