1
0
mirror of https://github.com/ceph/ceph synced 2024-12-26 21:43:10 +00:00
ceph/qa/loopall.sh
Alan Somers 3aae5ca6fd scripts: fix bash path in shebangs
/bin/bash is a Linuxism.  Other operating systems install bash to
different paths.  Use /usr/bin/env in shebangs to find bash.

Signed-off-by: Alan Somers <asomers@gmail.com>
2017-07-27 13:24:26 -06:00

29 lines
689 B
Bash
Executable File

#!/usr/bin/env bash
set -ex
basedir=`echo $0 | sed 's/[^/]*$//g'`.
testdir="$1"
[ -n "$2" ] && logdir=$2 || logdir=$1
[ ${basedir:0:1} == "." ] && basedir=`pwd`/${basedir:1}
PATH="$basedir/src:$PATH"
[ -z "$testdir" ] || [ ! -d "$testdir" ] && echo "specify test dir" && exit 1
cd $testdir
while true
do
for test in `cd $basedir/workunits && find . -executable -type f | $basedir/../src/script/permute`
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