{
echo " *** umount"
umount $SCRATCH_DEV >/dev/null 2>&1
+ rm -f $tmp.*
}
OUT="bench.out"
exit 1
}
+bench_mkfs_xfs()
+{
+ mkfs_xfs -f $extra_mkfs_options $@
+ [ $? -ne 0 ] && _fail "mkfs [$extra_mkfs_options] FAILED"
+}
+
+bench_mount_xfs()
+{
+ mount -t xfs $extra_mount_options $@
+ [ $? -ne 0 ] && _fail "mount [$extra_mount_options] FAILED"
+}
+
_run_benchmark()
{
pass=1
while [ $pass -le $passes -o $passes -lt 0 ]
do
_log " *** clean scratch device [$bench starting, pass $pass]"
- mkfs_xfs -f $SCRATCH_DEV 2>&1 | _fix_malloc >>$FULL \
+ bench_mkfs_xfs $SCRATCH_DEV 2>&1 | _fix_malloc >>$FULL \
|| _fail " !!! mkfs SCRATCH_DEV failed"
_log " *** mounting scratch device"
- mount -t xfs $SCRATCH_DEV $SCRATCH_MNT \
+ bench_mount_xfs $SCRATCH_DEV $SCRATCH_MNT \
|| _fail " !!! failed to mount"
_log " *** mkdir"
_merge_results()
{
- echo Results for $bench benchmark >>$OUT
+ echo Results for $bench benchmark
headers=`$here/run.$bench -h`
- echo "[$headers]" >>$OUT
- echo results.$bench.* | sort -nu | xargs cat >>$OUT
- echo >>$OUT
+ 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.* results.*
+
+if [ ! -z "$SCRATCH_LOGDEV" -a ! -z "$USE_SCRATCH_LOGDEV" ]
+then
+ extra_log_options="-l $SCRATCH_LOGDEV"
+ extra_mkfs_options="-llogdev=$SCRATCH_LOGDEV"
+ extra_mount_options="-ologdev=$SCRATCH_LOGDEV"
+fi
+
+# $OUT is the report which will ultimately be sent, keep it tidy.
+cat >$OUT <<EOF
+bench: MKFS_OPTIONS=$MKFS_OPTIONS $extra_mkfs_options
+bench: MOUNT_OPTIONS=$MOUNT_OPTIONS $extra_mount_options
-echo "MKFS_OPTIONS=$MKFS_OPTIONS" >>$OUT
-echo "MOUNT_OPTIONS=$MOUNT_OPTIONS" >>$OUT
-echo "" >>$OUT
+EOF
-rm -f bench.*
for bench in $benches
do
echo "" >$FULL
_log "*** benchmark started [passes=$passes, benchmark=$bench]"
_log "*** (`date`)"
_log "*** MKFS_OPTIONS=$MKFS_OPTIONS"
- _log "*** MOUNT_OPTIONS=$MOUNT_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