From: Victor Grishchenko Date: Wed, 20 Jan 2010 15:58:50 +0000 (+0100) Subject: rewriting the testing infrastructure X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=commitdiff_plain;h=e5e4b60b7b6b9380e66cf2f8a4e781791f9d32a5;p=swift-upb.git rewriting the testing infrastructure --- diff --git a/mfold/build.default.sh b/mfold/build.default.sh new file mode 100644 index 0000000..a2fb0f9 --- /dev/null +++ b/mfold/build.default.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +if ! which git || ! which g++ || ! which scons || ! which make ; then + sudo apt-get -y install make g++ scons git-core || exit -4 +fi + +if [ ! -e ~/include/gtest/gtest.h ]; then + mkdir tmp + cd tmp || exit -3 + wget -c http://googletest.googlecode.com/files/gtest-1.4.0.tar.bz2 || exit -2 + rm -rf gtest-1.4.0 + tar -xjf gtest-1.4.0.tar.bz2 || exit -1 + cd gtest-1.4.0 || exit 1 + ./configure --prefix=$HOME || exit 2 + make || exit 3 + make install || exit 4 +fi + +if [ ! -e swift ]; then + git clone git://github.com/gritzko/swift.git || exit 6 +fi +cd swift +git pull || exit 5 + +CPPPATH=~/include LIBPATH=~/lib scons -j4 || exit 7 +tests/connecttest || exit 8 + diff --git a/mfold/docmd.sh b/mfold/docmd.sh new file mode 100755 index 0000000..e0a2963 --- /dev/null +++ b/mfold/docmd.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +HOST=$1 +CMD=$2 + +if [ -e $CMD.$HOST.sh ] ; then + SHSC=$CMD.$HOST.sh ; +else + SHSC=$CMD.default.sh ; +fi + +if ( cat $SHSC | ssh $HOST ) > .$HOST.$CMD.out 2> .$HOST.$CMD.err; then + echo $HOST $CMD OK + exit 0 +else + echo $HOST $CMD FAIL + cat .$HOST.$CMD.out .$HOST.$CMD.err + exit 1 +fi diff --git a/mfold/doseq.sh b/mfold/doseq.sh new file mode 100755 index 0000000..30e0461 --- /dev/null +++ b/mfold/doseq.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# This script executes a chain of commands +# on all the member servers, in parallel. +# Commands are defined in .sh files (see +# docmd.sh); all failed executions are +# put to the FAILURES file +rm -f FAILURES +for srv in `cat servers.txt`; do + ( for cmd in $@; do + if ! ./docmd.sh $srv $cmd; then + echo $srv >> FAILURES + echo $src FAILED + break + fi + done ) & +done + +wait +echo DONE