]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: add loopall.sh
authorSage Weil <sage@newdream.net>
Wed, 17 Mar 2010 18:13:53 +0000 (11:13 -0700)
committerSage Weil <sage@newdream.net>
Wed, 17 Mar 2010 18:13:53 +0000 (11:13 -0700)
qa/loopall.sh [new file with mode: 0644]

diff --git a/qa/loopall.sh b/qa/loopall.sh
new file mode 100644 (file)
index 0000000..d317f7a
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/bash -x
+
+set -e
+
+basedir=`echo $0 | sed 's/[^/]*$//g'`.
+testdir="$1"
+[ -n "$2" ] && logdir=$2 || logdir=$1
+
+[ ${basedir:0:1} == "." ] && basedir=`pwd`/${basedir:1}
+
+[ -z "$testdir" ] || [ ! -d "$testdir" ] && echo "specify test dir" && exit 1
+cd $testdir
+
+while true
+do
+    for test in `cd $basedir/workunits && ls | grep .sh`
+    do
+       echo "------ running test $test ------"
+       pwd
+       [ -d $test ] && rm -r $test
+       mkdir -p $test
+       mkdir -p `dirname $logdir/$test.log`
+       test -e $logdir/$test.log && rm $logdir/$test.log
+       sh -c "cd $test && $basedir/workunits/$test" 2>&1 | tee $logdir/$test.log
+    done
+done