From 4a68eb4d1498d8697381f78963a9be4d6797d9cb Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 25 Feb 2010 10:53:15 -0800 Subject: [PATCH] qa: specify logdir on command line (or assume rundir) Don't just put logs with the qa source. Among other things that means we can't run runallonce.sh twice. --- qa/runallonce.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/qa/runallonce.sh b/qa/runallonce.sh index 5dfdb244d905f..01cd8d972d665 100755 --- a/qa/runallonce.sh +++ b/qa/runallonce.sh @@ -4,6 +4,7 @@ set -e basedir=`echo $0 | sed 's/[^/]*$//g'`. testdir="$1" +[ -n "$2" ] && logdir=$2 || logdir=$1 [ ${basedir:0:1} == "." ] && basedir=`pwd`/${basedir:1} @@ -13,11 +14,9 @@ cd $testdir for test in `cd $basedir/workunits && ls | grep .sh` do echo "------ running test $test ------" + pwd mkdir -p $test - test -d ${basedir}/logs || mkdir -p ${basedir}/logs - test -e ${basedir}/logs/${test}.log && rm ${basedir}/logs/${test}.log - pushd . - cd $test - ${basedir}/workunits/${test} 2>&1 | tee ${basedir}/logs/${test}.log - popd + 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 -- 2.39.5