owner=nathans@sgi.com
tmp=/tmp/$$
-here=`pwd`
+here=`pwd`; export here
status=1 # failure is the default!
# get standard environment, filters and checks
rm -f $seq $tmp.out
_log " *** bench [$seq]"
- $here/src/runas -u $uid -g $gid $here/run.$bench > $tmp.out
+ $here/src/runas -u $uid -g $gid $here/run.$bench >$tmp.out 2>>$FULL
[ $? -eq 0 ] || _fail " !!! $bench pass $pass failed"
cd $here
- _fix_malloc < $tmp.out | tee $seq | _logp
+ _fix_malloc < $tmp.out > $seq
_log " *** unmounting scratch device"
umount $SCRATCH_DEV 2>&1 | _logp \
_merge_results()
{
- echo Results for $bench benchmark >>$OUT
- echo results.$bench.* | sort -u | xargs cat >>$OUT
- echo >>$OUT
+ echo Results for $bench benchmark
+ headers=`$here/run.$bench -h`
+ echo "[$headers]"
+ echo results.$bench.* | sort -nu | xargs cat
+ echo
}
# real QA test starts here
passes=$1
user=$2
group=$3
+shift; shift; shift
-benches=`echo run.* | sed -e 's/run\.//g'`
-[ $# -gt 3 ] && benches=$4
+if [ $# -gt 0 ]; then
+ benches="$@"
+else
+ benches=`echo run.* | sed -e 's/run\.//g'`
+fi
[ -z "$benches" -o "$benches" = "*" ] && _fail "no benchmark scripts found"
trap "_cleanup; exit \$status" 0 1 2 3 15
_require_scratch
-
rm -f bench.*
+
+# $OUT is the report which will ultimately be sent, keep it tidy.
+cat >$OUT <<EOF
+bench: MKFS_OPTIONS=$MKFS_OPTIONS
+bench: MOUNT_OPTIONS=$MOUNT_OPTIONS
+
+EOF
+
for bench in $benches
-do
+do
echo "" >$FULL
echo "" >$LOG
_log "*** benchmark started [passes=$passes, benchmark=$bench]"
_log "*** (`date`)"
+ _log "*** MKFS_OPTIONS=$MKFS_OPTIONS"
+ _log "*** MOUNT_OPTIONS=$MOUNT_OPTIONS"
_log " *** unmounting scratch device"
umount $SCRATCH_DEV 2>&1 | _fix_malloc >>$FULL
_run_benchmark | _fix_malloc
- _merge_results
+ _merge_results >>$OUT
_log "*** done $bench"
done