Index: /branches/Orange-Branch/test/automated/vfs-tests.d/dbench
===================================================================
--- /branches/Orange-Branch/test/automated/vfs-tests.d/dbench	(revision 8428)
+++ /branches/Orange-Branch/test/automated/vfs-tests.d/dbench	(revision 8439)
@@ -1,12 +1,60 @@
 #!/bin/sh
-cd ${EXTRA_TESTS}/dbench-3.03
+
+#this script assumes that the benchmark tar file is already copied into $EXTRA_TESTS
+if [ ! $BENCHMARK ]
+then
+   #this is the existing name of the tar file
+   BENCHMARK=benchmarks-20060512.tar.gz
+fi
+
+#make directory, if it doesn't exist
+mkdir -p ${EXTRA_TESTS}/dbench-3.03
+
+#capture current working directory
+cwd=`pwd`
+
+#goto benchmark directory and cleanup
+cd ${EXTRA_TESTS}
+sudo /bin/rm -rf dbench-3.03
+
+#go back
+cd ..
+
+#untar the dbench directory
+tar -xzf ${BENCHMARK} benchmarks/dbench-3.03/*
+
+#goto the dbench directory
+cd benchmarks/dbench-3.03
+
+#configure the dbench software
 ./configure -q
+
+#apply patches
 patch -p3 < ${PVFS2_DEST}/pvfs2-${CVS_TAG}/test/automated/vfs-tests.d/dbench.patch
 if [ "${?}" != 0 ]
 then
    echo "Error: failed to apply patches to DBENCH."
+   cd $cwd
    exit 1;
 fi
+
+#compile the system
 make 2>&1
+
+#setup dbench test and execute.
 cp client.txt ${PVFS2_MOUNTPOINT}
+if [ $? != 0 ]
+then
+   echo "failed to copy client.txt to ${PVFS2_MOUNTPOINT}"
+   cd $cwd
+   exit 1
+fi
 cd ${PVFS2_MOUNTPOINT} &&  ${EXTRA_TESTS}/dbench-3.03/dbench -c client.txt 10 -t 300  2>&1
+if [ $? != 0 ]
+then
+   echo "dbench failed"
+   cd $cwd
+   exit 1
+fi
+
+cd $cwd
