Skip to contentSkip to conversation

xfstests: stop special casing nfs and udf

PATCH In review Christoph Hellwig 7 participants 17 messages Nov 7, 2013 – Dec 6, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfstests: stop special casing nfs and udf

For historical reasons beyond my knowledge xfstests tries to abuse the scratch device as test device for nfs and udf. Because not all test have inherited the right usage of the _setup_testdir and _cleanup_testdir helpers this leads to lots of unessecary test failures.

Remove the special casing, which gets nfs down to a minimal number of failures.

common/rc +1 -99
index ea3af12..c64933a 100644
@@ -975,11 +975,7 @@ _require_scratch()
 {
     case "$FSTYP" in
 	nfs*)
-		 echo $SCRATCH_DEV | grep -q ":" > /dev/null 2>&1
-		 if [ -z "$SCRATCH_DEV" -o "$?" != "0" ]
-		 then
-		     _notrun "this test requires a valid \$SCRATCH_DEV"
-		 fi
+                 _notrun "requires a scratch device"
 		 ;;
 	*)
 		 if [ -z "$SCRATCH_DEV" -o "`_is_block_dev $SCRATCH_DEV`" = "" ]
@@ -1773,100 +1769,6 @@ _full_platform_details()
      echo "$os/$platform $host $kernel"
 }
 
-_setup_udf_scratchdir()
-{
-    [ "$FSTYP" != "udf" ] \
-	&& _fail "setup_udf_testdir: \$FSTYP is not udf"
-    [ -z "$SCRATCH_DEV" -o ! -b "$SCRATCH_DEV" ] \
-	&& _notrun "this test requires a valid \$SCRATCH_DEV"
-    [ -z "$SCRATCH_MNT" ] \
-	&& _notrun "this test requires a valid \$SCRATCH_MNT"
-
-    # mounted?
-    if _mount | grep -q $SCRATCH_DEV
-    then
-        # if it's mounted, make sure its on $TEST_RW_DIR
-        if ! _mount | grep $SCRATCH_DEV | grep -q $SCRATCH_MNT
-        then
-            _fail "\$SCRATCH_DEV is mounted but not on \$SCRATCH_MNT - aborting"
-        fi
-    	$UMOUNT_PROG $SCRATCH_DEV
-    fi
-
-    _scratch_mkfs
-    _scratch_mount
-
-    testdir=$SCRATCH_MNT
-}
-
-_setup_nfs_scratchdir()
-{
-    [ "$FSTYP" != "nfs" ] \
-	&& _fail "setup_nfs_testdir: \$FSTYP is not nfs"
-    [ -z "$SCRATCH_DEV" ] \
-	&& _notrun "this test requires a valid host fs for \$SCRATCH_DEV"
-    [ -z "$SCRATCH_MNT" ] \
-	&& _notrun "this test requires a valid \$SCRATCH_MNT"
-
-    # mounted?
-    if _mount | grep -q $SCRATCH_DEV
-    then
-        # if it's mounted, make sure its on $SCRATCH_MNT
-        if ! _mount | grep $SCRATCH_DEV | grep -q $SCRATCH_MNT
-        then
-            _fail "\$SCRATCH_DEV is mounted but not on \$SCRATCH_MNT - aborting"
-        fi
-    	$UMOUNT_PROG $SCRATCH_DEV
-    fi
-
-    _scratch_mkfs
-    _scratch_mount
-
-    testdir=$SCRATCH_MNT
-}
-
-#
-# Warning for UDF and NFS:
-# this function calls _setup_udf_scratchdir and _setup_udf_scratchdir
-# which actually uses the scratch dir for the test dir.
-#
-# This was done because testdir was intended to be a persistent
-# XFS only partition.  This should eventually change, and treat
-# at least local filesystems all the same.
-#
-_setup_testdir()
-{
-    case $FSTYP in
-    udf)
-	_setup_udf_scratchdir
-	;;
-    nfs*)
-	_setup_nfs_scratchdir
-	;;
-    *)
-	testdir=$TEST_DIR
-	;;
-    esac
-}
-
-_cleanup_testdir()
-{
-    case $FSTYP in
-    udf)
-	# umount testdir as it is $SCRATCH_MNT which could be used by xfs next
-	[ -n "$testdir" ] && $UMOUNT_PROG $testdir
-	;;
-    nfs*)
-	# umount testdir as it is $SCRATCH_MNT which could be used by xfs next
-	[ -n "$testdir" ] && $UMOUNT_PROG $testdir
-	;;
-    *)
-	# do nothing, testdir is $TEST_DIR
-	:
-	;;
-    esac
-}
-
 _link_out_file()
 {
 	if [ -z "$1" -o -z "$2" ]; then
tests/btrfs/005 +0 -1
index 81badf6..c364e11 100755
@@ -135,7 +135,6 @@ _rundefrag()
 _supported_fs btrfs
 _supported_os Linux
 
-_setup_testdir
 ## We require scratch so that we'll have free contiguous space
 _require_scratch
 _scratch_mkfs >/dev/null 2>&1
tests/btrfs/014 +0 -1
index a49cf06..aa3edbb 100755
@@ -54,7 +54,6 @@ _balance()
 _supported_fs btrfs
 _supported_os Linux
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs >/dev/null 2>&1
 _scratch_mount
tests/generic/001 +4 -6
index aa82441..6e5f3dd 100755
@@ -118,14 +118,14 @@ udf_fsize=20240		# number of sectors for UDF
 
 _setup()
 {
-    if mkdir -p $testdir/$$
+    if mkdir -p $TEST_DIR/$$
     then
 	:
     else
-	echo "Error: cannot mkdir \"$testdir/$$\""
+	echo "Error: cannot mkdir \"$TEST_DIR/$$\""
 	exit 1
     fi
-    cd $testdir/$$
+    cd $TEST_DIR/$$
 
     $verbose && echo -n "setup "
     sed -e '/^#/d' $tmp.config \
@@ -286,8 +286,7 @@ _cleanup()
     then
 	$verbose && echo "cleanup"
 	cd /
-	rm -rf $testdir/$$
-	_cleanup_testdir
+	rm -rf $TEST_DIR/$$
 	done_cleanup=true
     fi
 }
@@ -298,7 +297,6 @@ _cleanup
 status=1
 done_cleanup=false
 
-_setup_testdir
 _setup
 
 # do the test
tests/generic/002 +8 -11
index 2aeebb1..656d29f 100755
@@ -38,43 +38,40 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
     rm -f $tmp.*
-    _cleanup_testdir
 }
 
 # real QA test starts here
 _supported_fs generic
 _supported_os IRIX Linux
 
-_setup_testdir
-
 echo "Silence is goodness ..."
 
 # ensure target directory exists
-mkdir `dirname $testdir/$tmp` 2>/dev/null
+mkdir `dirname $TEST_DIR/$tmp` 2>/dev/null
 
-touch $testdir/$tmp.1
+touch $TEST_DIR/$tmp.1
 for l in 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
 do
-    ln $testdir/$tmp.1 $testdir/$tmp.$l
-    x=`src/lstat64 $testdir/$tmp.1 | sed -n -e '/ Links: /s/.*Links: *//p'`
+    ln $TEST_DIR/$tmp.1 $TEST_DIR/$tmp.$l
+    x=`src/lstat64 $TEST_DIR/$tmp.1 | sed -n -e '/ Links: /s/.*Links: *//p'`
     if [ "$l" -ne $x ]
     then
 	echo "Arrgh, created link #$l and lstat64 looks like ..."
-	src/lstat64 $testdir/$tmp.1
+	src/lstat64 $TEST_DIR/$tmp.1
 	status=1
     fi
 done
 
 for l in 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
 do
-    x=`src/lstat64 $testdir/$tmp.1 | sed -n -e '/ Links: /s/.*Links: *//p'`
+    x=`src/lstat64 $TEST_DIR/$tmp.1 | sed -n -e '/ Links: /s/.*Links: *//p'`
     if [ "$l" -ne $x ]
     then
 	echo "Arrgh, about to remove link #$l and lstat64 looks like ..."
-	src/lstat64 $testdir/$tmp.1
+	src/lstat64 $TEST_DIR/$tmp.1
 	status=1
     fi
-    rm -f $testdir/$tmp.$l
+    rm -f $TEST_DIR/$tmp.$l
 done
 
 # success, all done
tests/generic/005 +2 -5
index de68b0d..544af14 100755
@@ -43,10 +43,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 
 _cleanup()
 {
-    cd $testdir
+    cd $TEST_DIR
     rm -f symlink_{0,1,2,3,4}{0,1,2,3,4,5,6,7,8,9} symlink_self empty_file
     cd /
-    _cleanup_testdir
 }
 
 _touch()
@@ -75,9 +74,7 @@ else
     _supported_os Linux IRIX
 fi
 
-_setup_testdir
-
-cd $testdir
+cd $TEST_DIR
 
 o=empty_file
 touch $o
tests/generic/006 +6 -9
index 62cc0c8..481e1f1 100755
@@ -35,8 +35,7 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    rm -rf $testdir/permname.$$
-    _cleanup_testdir
+    rm -rf $TEST_DIR/permname.$$
 }
 
 _count()
@@ -56,23 +55,21 @@ _count()
 _supported_fs generic
 _supported_os IRIX Linux
 
-_setup_testdir
-
-mkdir $testdir/permname.$$
+mkdir $TEST_DIR/permname.$$
 
 echo ""
 echo "single thread permname"
 echo "----------------------"
-mkdir $testdir/permname.$$/a
-cd $testdir/permname.$$/a
+mkdir $TEST_DIR/permname.$$/a
+cd $TEST_DIR/permname.$$/a
 $here/src/permname -c 4 -l 6 -p 1 || echo "permname returned $?"
 find . | _count
 
 echo ""
 echo "multi thread permname"
 echo "----------------------"
-mkdir $testdir/permname.$$/b
-cd $testdir/permname.$$/b
+mkdir $TEST_DIR/permname.$$/b
+cd $TEST_DIR/permname.$$/b
 $here/src/permname -c 4 -l 6 -p 4 || echo "permname returned $?"
 find . | _count
 
tests/generic/007 +3 -6
index 4947da6..abbee74 100755
@@ -38,8 +38,7 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    rm -rf $testdir/$seq
-    _cleanup_testdir
+    rm -rf $TEST_DIR/$seq
 }
 
 # get standard environment, filters and checks
@@ -50,8 +49,6 @@ _cleanup()
 _supported_fs generic
 _supported_os IRIX Linux
 
-_setup_testdir
-
 status=1 # default failure 
 sourcefile=$tmp.nametest
 seed=1
@@ -66,8 +63,8 @@ while [ $i -le $num_filenames ]; do
   let i=$i+1
 done
 
-mkdir $testdir/$seq
-cd $testdir/$seq
+mkdir $TEST_DIR/$seq
+cd $TEST_DIR/$seq
 $here/src/nametest -l $sourcefile -s $seed -i $iterations -z
 
 # success, all done
tests/generic/010 +2 -5
index 0bdfdd5..9d2e76a 100755
@@ -35,8 +35,7 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    rm -f $testdir/DBtest*.{pag,dir}
-    _cleanup_testdir
+    rm -f $TEST_DIR/DBtest*.{pag,dir}
 }
 
 # filter random number output from dbtest
@@ -58,11 +57,9 @@ _filter_dbtest()
 _supported_fs generic
 _supported_os IRIX Linux
 
-_setup_testdir
-
 rm -f $seqres.full
 
-cd $testdir
+cd $TEST_DIR
 
 $here/src/dbtest -l 5 -n 1000 2>&1 | tee -a $seqres.full | _filter_dbtest
 
tests/generic/011 +1 -4
index cad09ed..bed23aa 100755
@@ -37,7 +37,6 @@ _cleanup()
     cd /
     rm -f $tmp.*
     [ -n "$out" ] && rm -rf $out
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -48,9 +47,7 @@ _cleanup()
 _supported_fs generic
 _supported_os IRIX Linux
 
-_setup_testdir
-
-out=$testdir/dirstress.$$
+out=$TEST_DIR/dirstress.$$
 
 rm -f $seqres.full
 
tests/generic/013 +2 -5
index f66cade..8e76d3d 100755
@@ -41,8 +41,7 @@ _cleanup()
     # such that what it has is greater the 1024 chars and will
     # stop and complain - so get rid of complaint
     # Ref. pv#935754
-    rm -rf $testdir/fsstress.$$.* 2>&1 | grep -v 'Path too long'
-    _cleanup_testdir
+    rm -rf $TEST_DIR/fsstress.$$.* 2>&1 | grep -v 'Path too long'
 }
 
 _filesize()
@@ -60,7 +59,7 @@ _do_test()
     _param="$2"
     _count="$3"
 
-    out=$testdir/fsstress.$$.$_n
+    out=$TEST_DIR/fsstress.$$.$_n
     rm -rf $out
     if ! mkdir $out
     then
@@ -93,8 +92,6 @@ _do_test()
 _supported_fs generic
 _supported_os IRIX Linux
 
-_setup_testdir
-
 rm -f $seqres.full
 echo "brevity is wit..."
 
tests/generic/014 +2 -4
index d7da9ab..a9c2638 100755
@@ -35,8 +35,7 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    rm -rf $testdir/truncfile.$$.*
-    _cleanup_testdir
+    rm -rf $TEST_DIR/truncfile.$$.*
 }
 
 # get standard environment, filters and checks
@@ -47,7 +46,6 @@ _supported_fs generic
 _supported_os IRIX Linux
 
 _require_sparse_files
-_setup_testdir
 
 # ensure EOF preallocation doesn't massively extend the runtime of this test
 # by limiting the amount of preallocation and therefore the amount of blocks
@@ -62,7 +60,7 @@ echo "brevity is wit..."
 echo "------"
 echo "test 1"
 echo "------"
-if ! src/truncfile -c 10000 $testdir/truncfile.$$.0 >$tmp.out 2>&1
+if ! src/truncfile -c 10000 $TEST_DIR/truncfile.$$.0 >$tmp.out 2>&1
 then
     out=`cat $tmp.out`
     echo "truncfile returned $? : \"$out\""
tests/generic/020 +3 -10
index f004be5..a9bd17a 100755
@@ -29,21 +29,16 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=0	# success is the default!
-trap "_cleanup; rm -f $tmp.* $testfile; exit \$status" 0 1 2 3 15
+trap "rm -f $tmp.* $testfile; exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
 . ./common/filter
 . ./common/attr
 
-_cleanup()
-{
-    _cleanup_testdir
-}
-
 _filter()
 {
-    sed "s#$testdir[^ :]*#<TESTFILE>#g; 
+    sed "s#$TEST_DIR[^ :]*#<TESTFILE>#g; 
             s#$tmp[^ :]*#<TMPFILE>#g" $1
 }
 
@@ -83,11 +78,9 @@ _supported_os Linux
 
 _require_attrs
 
-_setup_testdir
-
 rm -f $seqres.full
 
-testfile=$testdir/attribute_$$
+testfile=$TEST_DIR/attribute_$$
 
 echo "*** list non-existant file"
 _attr_list $testfile
tests/generic/068 +0 -1
index b160766..a764019 100755
@@ -36,7 +36,6 @@ ITERATIONS=10
 _cleanup()
 {
     cd /
-    _cleanup_testdir
 
     trap 0 1 2 3 15
     exit $status
tests/generic/070 +1 -4
index ad9031e..3c88df0 100755
@@ -35,7 +35,6 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -49,10 +48,8 @@ _supported_os IRIX Linux
 
 _require_attrs
 
-_setup_testdir
-
 FSSTRESS_ARGS=`_scale_fsstress_args \
-	-d $testdir/fsstress \
+	-d $TEST_DIR/fsstress \
 	-f allocsp=0 \
 	-f freesp=0 \
 	-f bulkstat=0 \
tests/generic/074 +2 -5
index 55f72c2..668132e 100755
@@ -34,8 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
     cd /
-    rm -rf $testdir/fstest.$$.* $tmp.*
-    _cleanup_testdir
+    rm -rf $TEST_DIR/fstest.$$.* $tmp.*
 }
 
 # get standard environment, filters and checks
@@ -47,7 +46,7 @@ _do_test()
     _n="$1"
     _param="$2"
 
-    out=$testdir/fstest.$$.$_n
+    out=$TEST_DIR/fstest.$$.$_n
     rm -rf $out
     if ! mkdir $out
     then
@@ -156,8 +155,6 @@ _process_args "$@"
 echo "Params are for $param_type" >>$seqres.full
 echo "Params: n = $numchildren l = $numloops f = $numfiles" >>$seqres.full
 
-_setup_testdir
-
 _check_test_fs
 
 # Options:
tests/generic/075 +2 -5
index e806dea..8b4ab39 100755
@@ -34,8 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
     cd /
-    rm -rf $testdir/fsx.* $tmp.*
-    _cleanup_testdir
+    rm -rf $TEST_DIR/fsx.* $tmp.*
 }
 
 # get standard environment, filters and checks
@@ -47,7 +46,7 @@ _do_test()
     _n="$1"
     _param="$2"
 
-    out=$testdir/fsx
+    out=$TEST_DIR/fsx
     rm -rf $out
     if ! mkdir $out
     then
@@ -136,8 +135,6 @@ _process_args "$@"
 echo "Params are for $param_type" >>$seqres.full
 echo "Params: n = $numops1 N = $numops2 l = $filelen" >>$seqres.full
 
-_setup_testdir
-
 rm -f $seqres.full
 echo "brevity is wit..."
 
tests/generic/093 +4 -6
index a8ef52e..fe20f38 100755
@@ -41,13 +41,12 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 
 _cleanup()
 {
-    [ -n "$testdir" ] && rm -f $file
-    _cleanup_testdir
+    [ -n "$TEST_DIR" ] && rm -f $file
 }
 
 _testfilter()
 {
-    sed -e "s#$testdir#TESTDIR#g"
+    sed -e "s#$TEST_DIR#TESTDIR#g"
 }
 
 _filefilter()
@@ -65,12 +64,11 @@ _require_attrs
 
 rm -f $seqres.full
 
-_setup_testdir
 _need_to_be_root
 
 echo "QA output created by $seq"
 echo ""
-file=$testdir/$seq.file
+file=$TEST_DIR/$seq.file
 
 user=`grep ':all=:all=' /etc/capability | tail -1 | $AWK_PROG -F: '{print $1}'`
 uid=`_cat_passwd | grep $user | $AWK_PROG -F: '{print $3}'`
@@ -149,7 +147,7 @@ echo "list EA on file"
 ${ATTR_PROG} -R -l $file | _filefilter
 
 chown $uid $file
-chmod ugo+w $testdir
+chmod ugo+w $TEST_DIR
 echo "as non-root call writemod"
 $runas -u $uid src/writemod $file 2>&1 | _filefilter
 
tests/generic/097 +0 -3
index d7f6ec1..c120422 100755
@@ -78,8 +78,6 @@ _supported_os IRIX
 _require_scratch
 _require_attrs
 
-_setup_testdir 
-
 TARGET_DIR=$SCRATCH_MNT
 [ "$FSTYP" == "xfs" ] && TARGET_DIR=$TEST_DIR
 cd $TARGET_DIR
@@ -245,7 +243,6 @@ echo "list root EAs: none"
 ${ATTR_PROG} -R -l foo
 
 cd /
-_cleanup_testdir
 
 # Check the filesystem
 _check_scratch_fs
tests/generic/099 +0 -1
index 03fdded..7351966 100755
@@ -88,7 +88,6 @@ _require_acls
 # get dir
 #export FILE_SYS=xfs
 _require_scratch
-_setup_testdir
 
 cd $TARGET_DIR
 rm -rf $seq.dir1 # in case file is left over from previous runs.
tests/generic/100 +3 -5
index dfb5252..05d766f 100755
@@ -69,19 +69,17 @@ tar -cvf $TEMP_DIR/$TAR_FILE $POPULATED_DIR >>$seqres.full 2>&1
 
 # create f/s
 _require_scratch
-_setup_testdir
 
 # untar on f/s
-cd $testdir
+cd $TEST_DIR
 tar -xRvf $TEMP_DIR/$TAR_FILE >>$seqres.full 2>&1
 cd $here
 
 # use diff -qr to compare
-ls -R -l ${testdir}${POPULATED_DIR} >>$seqres.full 2>&1
-diff -qr $POPULATED_DIR ${testdir}${POPULATED_DIR}
+ls -R -l ${TEST_DIR}${POPULATED_DIR} >>$seqres.full 2>&1
+diff -qr $POPULATED_DIR ${TEST_DIR}${POPULATED_DIR}
 
 cd /
-_cleanup_testdir
 _check_scratch_fs
 
 status=0
tests/generic/112 +2 -5
index 65b3484..4918f75 100755
@@ -34,8 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
     cd /
-    rm -rf $testdir/fsx.* $tmp.*
-    _cleanup_testdir
+    rm -rf $TEST_DIR/fsx.* $tmp.*
 }
 
 # get standard environment, filters and checks
@@ -47,7 +46,7 @@ _do_test()
     _n="$1"
     _param="$2"
 
-    out=$testdir/fsx
+    out=$TEST_DIR/fsx
     rm -rf $out
     if ! mkdir $out
     then
@@ -137,8 +136,6 @@ _process_args "$@"
 echo "Params are for $param_type" >>$seqres.full
 echo "Params: n = $numops1 N = $numops2 l = $filelen" >>$seqres.full
 
-_setup_testdir
-
 rm -f $seqres.full
 echo "brevity is wit..."
 
tests/generic/113 +3 -6
index 5e9f5fe..56672f0 100755
@@ -34,8 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
     cd /
-    rm -f $testdir/aio-stress.$$.*
-    _cleanup_testdir
+    rm -f $TEST_DIR/aio-stress.$$.*
 }
 
 # get standard environment, filters and checks
@@ -49,11 +48,11 @@ _do_test()
     _count="$3"
     _nproc="$4"
 
-    _files="$testdir/aiostress.$$.$_n"
+    _files="$TEST_DIR/aiostress.$$.$_n"
     __proc=$_nproc
     [ $__proc -gt 1 ] && _param="-t $__proc $_param"
     while [ $__proc -gt 1 ]; do
-        _files="$_files $testdir/aiostress.$$.$_n.$__proc"
+        _files="$_files $TEST_DIR/aiostress.$$.$_n.$__proc"
 	let __proc=$__proc-1
     done
     rm -f $_files
@@ -80,8 +79,6 @@ _supported_os Linux
 
 [ -x $here/ltp/aio-stress ] || _notrun "aio-stress not built for this platform"
 
-_setup_testdir
-
 echo "brevity is wit..."
 
 count=1000
tests/generic/117 +0 -2
index 87e6987..f81265b 100755
@@ -67,7 +67,6 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -79,7 +78,6 @@ _cleanup()
 _supported_fs generic
 _supported_os IRIX Linux
 
-_setup_testdir
 _require_scratch
 _require_attrs
 
tests/generic/123 +2 -4
index 41b9d3b..911e9d2 100755
@@ -35,10 +35,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 
 _cleanup()
 {
-    cd $testdir
+    cd $TEST_DIR
     rm -rf $my_test_subdir
     cd /
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -51,8 +50,7 @@ _supported_os Linux IRIX
 
 _require_user
 
-_setup_testdir
-my_test_subdir=$testdir/123subdir
+my_test_subdir=$TEST_DIR/123subdir
 
 # create subdir with required permissions
 mkdir -m 755 $my_test_subdir
tests/generic/124 +1 -3
index 92e7619..93ec4a1 100755
@@ -38,7 +38,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
     cd /
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -49,13 +48,12 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs >/dev/null 2>&1
 _scratch_mount
 
 # Run preallo_rw_pattern on both test and scratch partitions
-for TESTFILE in $testdir/rw_pattern.tmp $SCRATCH_MNT/rw_pattern.tmp
+for TESTFILE in $TEST_DIR/rw_pattern.tmp $SCRATCH_MNT/rw_pattern.tmp
   do
   count=1
   while (( count < 101 ))
tests/generic/125 +2 -9
index 18f5cb1..f4ffea5 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1	# failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -46,9 +41,7 @@ _supported_os Linux
 
 _require_user
 
-_setup_testdir
-
-TESTDIR=$testdir/ftrunc
+TESTDIR=$TEST_DIR/ftrunc
 TESTFILE=$TESTDIR/ftrunc.tmp
 
 [ -d $TESTDIR ] && rm -r $TESTDIR
tests/generic/126 +1 -4
index 7fe5bc6..1796527 100755
@@ -34,7 +34,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
     cd /
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -45,11 +44,9 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 
-_setup_testdir
-
 QA_FS_PERMS=$here/src/fs_perms
 
-cd $testdir
+cd $TEST_DIR
 cp $here/src/testx ./testx.file
 
 # file_perm owner_uid owner_gid tester_uid tester_gid perm_to_test expected_result pass=1
tests/generic/127 +7 -10
index 373bf20..58ca91e 100755
@@ -38,7 +38,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
     rm -f $tmp.output
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -51,10 +50,10 @@ FSX_ARGS="-q -l $FSX_FILE_SIZE -o 65536 -S 191110531 -N 100000"
 _fsx_lite_nommap()
 {
     echo "=== FSX Light Mode, No Memory Mapping ==="
-    dd if=/dev/zero of=$testdir/fsx_lite_nommap bs=${FSX_FILE_SIZE} count=1 > /dev/null 2>&1
-    if ! ltp/fsx $FSX_ARGS -L -R -W $testdir/fsx_lite_nommap > $tmp.output 2>&1
+    dd if=/dev/zero of=$TEST_DIR/fsx_lite_nommap bs=${FSX_FILE_SIZE} count=1 > /dev/null 2>&1
+    if ! ltp/fsx $FSX_ARGS -L -R -W $TEST_DIR/fsx_lite_nommap > $tmp.output 2>&1
     then
-        echo "ltp/fsx $FSX_ARGS -L -R -W $testdir/fsx_lite_nommap"
+        echo "ltp/fsx $FSX_ARGS -L -R -W $TEST_DIR/fsx_lite_nommap"
         cat $tmp.output
         return 1
     fi
@@ -65,8 +64,8 @@ _fsx_lite_nommap()
 _fsx_lite_mmap()
 {
     echo "=== FSX Light Mode, Memory Mapping ==="
-    dd if=/dev/zero of=$testdir/fsx_lite_mmap bs=${FSX_FILE_SIZE} count=1 > /dev/null 2>&1
-    if ! ltp/fsx $FSX_ARGS -L $testdir/fsx_lite_mmap > $tmp.output 2>&1
+    dd if=/dev/zero of=$TEST_DIR/fsx_lite_mmap bs=${FSX_FILE_SIZE} count=1 > /dev/null 2>&1
+    if ! ltp/fsx $FSX_ARGS -L $TEST_DIR/fsx_lite_mmap > $tmp.output 2>&1
     then
     	echo "ltp/fsx $FSX_ARGS -L fsx_lite_mmap"
 	cat $tmp.output
@@ -79,7 +78,7 @@ _fsx_lite_mmap()
 _fsx_std_nommap()
 {
     echo "=== FSX Standard Mode, No Memory Mapping ==="
-    if ! ltp/fsx $FSX_ARGS -R -W $testdir/fsx_std_nommap > $tmp.output 2>&1
+    if ! ltp/fsx $FSX_ARGS -R -W $TEST_DIR/fsx_std_nommap > $tmp.output 2>&1
     then
         echo "ltp/fsx $FSX_ARGS -R -W fsx_std_nommap"
         cat $tmp.output
@@ -92,7 +91,7 @@ _fsx_std_nommap()
 _fsx_std_mmap()
 {
     echo "=== FSX Standard Mode, Memory Mapping ==="
-    if ! ltp/fsx $FSX_ARGS $testdir/fsx_std_mmap > $tmp.output 2>&1
+    if ! ltp/fsx $FSX_ARGS $TEST_DIR/fsx_std_mmap > $tmp.output 2>&1
     then
     	echo "ltp/fsx $FSX_ARGS fsx_std_mmap"
 	cat $tmp.output
@@ -106,8 +105,6 @@ _fsx_std_mmap()
 _supported_fs generic
 _supported_os Linux
 
-_setup_testdir
-
 _fsx_lite_nommap
 _fsx_lite_mmap
 
tests/generic/128 +1 -8
index c9c809f..22e4f71 100755
@@ -29,13 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1	# failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    cd /
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -45,7 +39,6 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 
-_setup_testdir
 _require_scratch
 _require_user
 
tests/generic/129 +1 -9
index fe763df..9a10d76 100755
@@ -29,13 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1	# failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    cd /
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -54,8 +48,6 @@ _supported_os Linux
 _require_scratch
 _require_sparse_files
 
-_setup_testdir
-
 _scratch_mkfs >/dev/null 2>&1
 _scratch_mount "-o nosuid"
 
tests/generic/130 +1 -9
index cfc2c32..8367dc7 100755
@@ -38,13 +38,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    cd /
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -57,8 +51,6 @@ _supported_os Linux IRIX
 _require_scratch
 _require_sparse_files
 
-_setup_testdir
-
 _scratch_mkfs >/dev/null 2>&1
 _scratch_mount
 
tests/generic/131 +4 -7
index 6c3131c..ce3e490 100755
@@ -35,7 +35,6 @@ _cleanup()
 {
     kill $locktest_pid2 > /dev/null 2>&1
     kill $locktest_pid1 > /dev/null 2>&1
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -46,9 +45,7 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 
-_setup_testdir
-
-TESTFILE=$testdir/lock_file
+TESTFILE=$TEST_DIR/lock_file
 
 # Grab a port which is hopefully unused
 if [ $$ -gt 1024 -a $$ -lt 32000 ]; then
@@ -60,13 +57,13 @@ elif [ $$ -gt 32000 ]; then
 fi
 
 # Start the server
-src/locktest -p $PORT $TESTFILE 2>&1 > $testdir/server.out &
+src/locktest -p $PORT $TESTFILE 2>&1 > $TEST_DIR/server.out &
 locktest_pid1=$!
 
 sleep 1
 
 # Start the client
-src/locktest -p $PORT -h localhost $TESTFILE 2>&1 > $testdir/client.out
+src/locktest -p $PORT -h localhost $TESTFILE 2>&1 > $TEST_DIR/client.out
 locktest_pid2=$!
 result=$?
 if [ $result -eq 0 ]; then
@@ -74,7 +71,7 @@ if [ $result -eq 0 ]; then
 	status=0
 else
 	echo "Client reported failure ($result)"
-	cat $testdir/*.out
+	cat $TEST_DIR/*.out
 fi
 
 exit
tests/generic/132 +1 -8
index 42ab909..aa52c7d 100755
@@ -30,13 +30,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    cd /
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -46,7 +40,6 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux IRIX
 
-_setup_testdir
 _require_scratch
 
 _scratch_mkfs >/dev/null 2>&1
tests/generic/133 +17 -24

64 lines not on this page · raw message

tests/generic/135 +1 -8
index 783a106..e3b827a 100755
@@ -29,13 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    cd /
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -45,7 +39,6 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux IRIX
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs >/dev/null 2>&1
 
tests/generic/141 +1 -7
index 83b5486..fa08484 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -44,7 +39,6 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs >/dev/null 2>&1
 _scratch_mount
tests/generic/184 +4 -7
index 5d74fa3..dcc8b4e 100755
@@ -35,7 +35,6 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -46,12 +45,10 @@ _cleanup()
 _supported_fs generic
 _supported_os IRIX Linux
 
-_setup_testdir
-
-rm -f $testdir/null
-mknod $testdir/null c 1 3
-chmod 666 $testdir/null
-echo fred > $testdir/null
+rm -f $TEST_DIR/null
+mknod $TEST_DIR/null c 1 3
+chmod 666 $TEST_DIR/null
+echo fred > $TEST_DIR/null
 
 status=$?
 exit
tests/generic/225 +0 -1
index faa542a..73b125a 100755
@@ -34,7 +34,6 @@ _cleanup()
 {
 	cd /
 	rm -f $tmp.*
-	_cleanup_testdir
 }
 
 # get standard environment, filters and checks
tests/generic/237 +2 -5
index e5c5a79..6a61ec8 100755
@@ -42,8 +42,7 @@ _cleanup()
 {
 	cd /
 	rm -f $tmp.*
-	[ -n "$testdir" ] && rm -rf $testdir/$seq.dir1
-	_cleanup_testdir
+	[ -n "$TEST_DIR" ] && rm -rf $TEST_DIR/$seq.dir1
 }
 
 # real QA test starts here
@@ -55,14 +54,12 @@ _supported_os Linux
 
 rm -f $seqres.full
 
-_setup_testdir
-
 _need_to_be_root
 _acl_setup_ids
 _require_acls
 
 # get dir
-cd $testdir
+cd $TEST_DIR
 rm -rf $seq.dir1
 mkdir $seq.dir1
 cd $seq.dir1
tests/generic/249 +0 -2
index 1f25edb..306e820 100755
@@ -35,7 +35,6 @@ _cleanup()
 	cd /
 	rm -f $tmp.*
 	rm -f $SRC $DST
-	_cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -45,7 +44,6 @@ _cleanup()
 # real QA test starts here
 _supported_fs generic
 _supported_os Linux
-_setup_testdir
 
 echo "Feel the serenity."
 
tests/shared/051 +2 -5
index 07399cc..e957f86 100755
@@ -40,8 +40,7 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    [ -n "$testdir" ] && rm -rf $testdir/$seq.dir1
-    _cleanup_testdir
+    [ -n "$TEST_DIR" ] && rm -rf $TEST_DIR/$seq.dir1
 }
 
 # -----
@@ -76,14 +75,12 @@ _supported_os Linux
 
 rm -f $seqres.full
 
-_setup_testdir
-
 _need_to_be_root
 _acl_setup_ids
 _require_acls
 
 # get dir
-cd $testdir
+cd $TEST_DIR
 rm -rf $seq.dir1
 mkdir $seq.dir1
 cd $seq.dir1
tests/shared/218 +0 -2
index f21b8b2..cd2076e 100755
@@ -34,7 +34,6 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -46,7 +45,6 @@ _cleanup()
 _supported_fs xfs ext4 btrfs
 _supported_os Linux
 
-_setup_testdir
 # We require scratch so that we'll have free contiguous space
 _require_scratch
 _scratch_mkfs >/dev/null 2>&1
tests/udf/098 +0 -2
index 91e8a22..3a5db39 100755
@@ -81,8 +81,6 @@ _supported_os IRIX
 _require_scratch
 _require_attrs
 
-_setup_testdir
-
 cd $SCRATCH_MNT
 
 echo "create file foo"
tests/udf/102 +0 -1
index e27c086..8fd4697 100755
@@ -36,7 +36,6 @@ _cleanup()
 {
     rm -f $tmp.*
     cd /
-    _cleanup_testdir
 }
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/008 +2 -5
index e7a1768..56be923 100755
@@ -35,8 +35,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
     rm -f $tmp.*
-    rm -rf $testdir/randholes.$$.*
-    _cleanup_testdir
+    rm -rf $TEST_DIR/randholes.$$.*
 }
 
 _filter()
@@ -55,7 +54,7 @@ _do_test()
     _holes="$2"
     _param="$3"
 
-    out=$testdir/randholes.$$.$_n
+    out=$TEST_DIR/randholes.$$.$_n
     echo ""
     echo "randholes.$_n : $_param" | _filter
     echo "------------------------------------------"
@@ -89,8 +88,6 @@ _do_test()
 _supported_fs xfs
 _supported_os IRIX Linux
 
-_setup_testdir
-
 rm -f $seqres.full
 
 # Note on special numbers here.
tests/xfs/012 +2 -5
index cd9c485..4127222 100755
@@ -35,8 +35,7 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    rm -rf $testdir/holes.$$.*
-    _cleanup_testdir
+    rm -rf $TEST_DIR/holes.$$.*
 }
 
 _filesize()
@@ -56,7 +55,7 @@ _do_test()
     
     failed=0
     
-    out=$testdir/holes.$$.$_n
+    out=$TEST_DIR/holes.$$.$_n
     echo ""
     echo "holes.$_n : $_param"
     echo "-----------------------------------------------"
@@ -106,8 +105,6 @@ _do_test()
 _supported_fs xfs
 _supported_os IRIX Linux
 
-_setup_testdir
-
 rm -f $seqres.full
 
 # small & fairly dense
tests/xfs/048 +1 -4
index 40667e0..f9fb16f 100755
@@ -39,16 +39,13 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    _cleanup_testdir
 }
 
 # real QA test starts here
 _supported_fs xfs
 _supported_os IRIX Linux
 
-_setup_testdir
-
-src/fault $testdir || exit
+src/fault $TEST_DIR || exit
 
 # success, all done
 status=0
tests/xfs/066 +2 -5
index 6d4e1c2..d521ada 100755
@@ -40,22 +40,19 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    _cleanup_testdir
 }
 
 # real QA test starts here
 _supported_fs xfs
 _supported_os IRIX Linux
 
-_setup_testdir
-
 _my_stat_filter()
 {
     grep "[sS]ize" | sed "s/.*[sS]ize[: ]*\([[:digit:]]*\).*/\1 largefile/g"
 }
 
-rm -f $testdir/testfile
-if src/feature -t $testdir/testfile; then
+rm -f $TEST_DIR/testfile
+if src/feature -t $TEST_DIR/testfile; then
 	:
 else
 	_notrun "Installed libc doesn't correctly handle setrlimit/ftruncate64"
tests/xfs/078 +0 -1
index f2b674a..e04c6cc 100755
@@ -38,7 +38,6 @@ _cleanup()
     rm -f $tmp.*
     umount -d $LOOP_MNT 2>/dev/null
     rmdir $LOOP_MNT
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
tests/xfs/080 +1 -4
index b1cd0cb..59c6104 100755
@@ -39,7 +39,6 @@ _cleanup()
 { 
     cd /
     rm -f $tmp.*
-   _cleanup_testdir
 }
 
 _supported_fs xfs
@@ -48,13 +47,11 @@ _supported_fs xfs
 # but not at the moment.
 _supported_os Linux
 
-_setup_testdir
-
 quiet=-q
 clean=-c
 
 export here
-cd $testdir
+cd $TEST_DIR
 echo
 
 # real QA test starts here
tests/xfs/137 +1 -7
index 90dc1f5..79b3b89 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -44,7 +39,6 @@ _cleanup()
 _supported_fs xfs
 _supported_os Linux IRIX
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
tests/xfs/138 +1 -7
index d3c1009..1b11cf6 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -44,7 +39,6 @@ _cleanup()
 _supported_fs xfs
 _supported_os Linux IRIX
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
tests/xfs/139 +1 -7
index 1fbde58..e5296f7 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -44,7 +39,6 @@ _cleanup()
 _supported_fs xfs
 _supported_os Linux IRIX
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
tests/xfs/140 +1 -7
index ce52272..cccf262 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -44,7 +39,6 @@ _cleanup()
 _supported_fs xfs
 _supported_os Linux IRIX
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
tests/xfs/142 +1 -6
index 5a2ef9e..a1efcc2 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/143 +1 -6
index c86cc0a..c389a2b 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/144 +1 -6
index 0b5b21d..41041c4 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/145 +1 -6
index c8444f0..44b3e4e 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/146 +1 -6
index 1e13d95..c6343f8 100755
@@ -30,12 +30,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 _report_filter () {
     $PERL_PROG -ne "s/Report: \"0x[0-f]+\" was written and \"0x[0-f]+\" was read at/Report: \"HEX\" was written and \"HEX\" was read at/g ;
tests/xfs/147 +1 -6
index c22f24a..73ff7f9 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/150 +1 -6
index 3bf1c8b..f9e690a 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 _filter_fs_handle()
 {
tests/xfs/151 +1 -6
index d2e21f3..bba7094 100755
@@ -31,12 +31,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 _dm_create_session()
 {
tests/xfs/152 +1 -6
index 310f0dc..72bdabf 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 _filter_handles()
 {
tests/xfs/153 +1 -6
index 7b9a316..cac7722 100755
@@ -30,12 +30,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/154 +1 -6
index c281b37..810a6ac 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/155 +1 -6
index 23316f2..1a1631e 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/156 +1 -6
index 88b8cbf..d6e22b6 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/157 +1 -6
index a1243dc..bf65590 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/158 +1 -6
index 5c4dfcd..596f4c2 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/159 +1 -6
index 8d15162..fc5193f 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/160 +1 -6
index 44e9f2f..9a2e2d0 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/161 +1 -6
index 74d6dbe..11e53de 100755
@@ -30,12 +30,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 _filter_get_allocinfo()
 {
tests/xfs/162 +1 -6
index 64d001c..4edb68f 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/163 +1 -6
index 3a2d3b9..e283545 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 _filter_paths()
 {
tests/xfs/166 +1 -7
index 02b3237..2a96f8a 100755
@@ -29,14 +29,9 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+trap "exit \$status" 0 1 2 3 15
 rm -f $seqres.full
 
-_cleanup()
-{
-    _cleanup_testdir
-}
-
 # get standard environment, filters and checks
 . ./common/rc
 . ./common/filter
@@ -80,7 +75,6 @@ _filter_blocks()
 _supported_fs xfs
 _supported_os Linux
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
tests/xfs/167 +0 -2
index d75de23..ab0156f 100755
@@ -36,7 +36,6 @@ _cleanup()
 {
 	$KILLALL_PROG -r -q -TERM fsstress 2> /dev/null
 	sync	# ensures all fsstress processes died
-	_cleanup_testdir
 }
 
 workout()
@@ -59,7 +58,6 @@ _supported_os Linux
 
 [ -n "$KILLALL_PROG" ] || _notrun "killall executable not found"
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
tests/xfs/168 +1 -6
index 901125a..6fc4540 100755
@@ -31,12 +31,7 @@ here=`pwd`
 tmp=/tmp/$$
 rm -f $seqres.full
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 _filter_dmapi_print_event() {
     $PERL_PROG -ne '
tests/xfs/179 +1 -7
index 6402eda..ce50d99 100755
@@ -30,12 +30,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -45,7 +40,6 @@ _cleanup()
 _supported_fs xfs
 _supported_os Linux IRIX
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
tests/xfs/180 +1 -7
index 404f352..a0fb69a 100755
@@ -30,12 +30,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -45,7 +40,6 @@ _cleanup()
 _supported_fs xfs
 _supported_os Linux IRIX
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
tests/xfs/182 +1 -7
index f55e018..b75e4fc 100755
@@ -30,12 +30,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -45,7 +40,6 @@ _cleanup()
 _supported_fs xfs
 _supported_os Linux IRIX
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
tests/xfs/185 +1 -6
index 6de0ca9..17334de 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/216 +0 -2
index a21df9d..8513479 100755
@@ -34,7 +34,6 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -45,7 +44,6 @@ _cleanup()
 _supported_fs xfs
 _supported_os Linux
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
tests/xfs/217 +0 -2
index 25a6c01..6c439c0 100755
@@ -34,7 +34,6 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -45,7 +44,6 @@ _cleanup()
 _supported_fs xfs
 _supported_os Linux
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
tests/xfs/250 +0 -1
index b9953f7..3b67c3f 100755
@@ -36,7 +36,6 @@ _cleanup()
 	umount -d $LOOP_MNT 2>/dev/null
 	rm -f $LOOP_DEV
 	rmdir $LOOP_MNT
-	_cleanup_testdir
 }
 
 # get standard environment, filters and checks

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#1 lore raw

ping?

Quoted 2,249 lines · Christoph Hellwig

For historical reasons beyond my knowledge xfstests tries to abuse the scratch device as test device for nfs and udf. Because not all test have inherited the right usage of the _setup_testdir and _cleanup_testdir helpers this leads to lots of unessecary test failures.

Remove the special casing, which gets nfs down to a minimal number of failures.

common/rc +1 -99
index ea3af12..c64933a 100644
@@ -975,11 +975,7 @@ _require_scratch()
 {
     case "$FSTYP" in
 	nfs*)
-		 echo $SCRATCH_DEV | grep -q ":" > /dev/null 2>&1
-		 if [ -z "$SCRATCH_DEV" -o "$?" != "0" ]
-		 then
-		     _notrun "this test requires a valid \$SCRATCH_DEV"
-		 fi
+                 _notrun "requires a scratch device"
 		 ;;
 	*)
 		 if [ -z "$SCRATCH_DEV" -o "`_is_block_dev $SCRATCH_DEV`" = "" ]
@@ -1773,100 +1769,6 @@ _full_platform_details()
      echo "$os/$platform $host $kernel"
 }
 
-_setup_udf_scratchdir()
-{
-    [ "$FSTYP" != "udf" ] \
-	&& _fail "setup_udf_testdir: \$FSTYP is not udf"
-    [ -z "$SCRATCH_DEV" -o ! -b "$SCRATCH_DEV" ] \
-	&& _notrun "this test requires a valid \$SCRATCH_DEV"
-    [ -z "$SCRATCH_MNT" ] \
-	&& _notrun "this test requires a valid \$SCRATCH_MNT"
-
-    # mounted?
-    if _mount | grep -q $SCRATCH_DEV
-    then
-        # if it's mounted, make sure its on $TEST_RW_DIR
-        if ! _mount | grep $SCRATCH_DEV | grep -q $SCRATCH_MNT
-        then
-            _fail "\$SCRATCH_DEV is mounted but not on \$SCRATCH_MNT - aborting"
-        fi
-    	$UMOUNT_PROG $SCRATCH_DEV
-    fi
-
-    _scratch_mkfs
-    _scratch_mount
-
-    testdir=$SCRATCH_MNT
-}
-
-_setup_nfs_scratchdir()
-{
-    [ "$FSTYP" != "nfs" ] \
-	&& _fail "setup_nfs_testdir: \$FSTYP is not nfs"
-    [ -z "$SCRATCH_DEV" ] \
-	&& _notrun "this test requires a valid host fs for \$SCRATCH_DEV"
-    [ -z "$SCRATCH_MNT" ] \
-	&& _notrun "this test requires a valid \$SCRATCH_MNT"
-
-    # mounted?
-    if _mount | grep -q $SCRATCH_DEV
-    then
-        # if it's mounted, make sure its on $SCRATCH_MNT
-        if ! _mount | grep $SCRATCH_DEV | grep -q $SCRATCH_MNT
-        then
-            _fail "\$SCRATCH_DEV is mounted but not on \$SCRATCH_MNT - aborting"
-        fi
-    	$UMOUNT_PROG $SCRATCH_DEV
-    fi
-
-    _scratch_mkfs
-    _scratch_mount
-
-    testdir=$SCRATCH_MNT
-}
-
-#
-# Warning for UDF and NFS:
-# this function calls _setup_udf_scratchdir and _setup_udf_scratchdir
-# which actually uses the scratch dir for the test dir.
-#
-# This was done because testdir was intended to be a persistent
-# XFS only partition.  This should eventually change, and treat
-# at least local filesystems all the same.
-#
-_setup_testdir()
-{
-    case $FSTYP in
-    udf)
-	_setup_udf_scratchdir
-	;;
-    nfs*)
-	_setup_nfs_scratchdir
-	;;
-    *)
-	testdir=$TEST_DIR
-	;;
-    esac
-}
-
-_cleanup_testdir()
-{
-    case $FSTYP in
-    udf)
-	# umount testdir as it is $SCRATCH_MNT which could be used by xfs next
-	[ -n "$testdir" ] && $UMOUNT_PROG $testdir
-	;;
-    nfs*)
-	# umount testdir as it is $SCRATCH_MNT which could be used by xfs next
-	[ -n "$testdir" ] && $UMOUNT_PROG $testdir
-	;;
-    *)
-	# do nothing, testdir is $TEST_DIR
-	:
-	;;
-    esac
-}
-
 _link_out_file()
 {
 	if [ -z "$1" -o -z "$2" ]; then
tests/btrfs/005 +0 -1
index 81badf6..c364e11 100755
@@ -135,7 +135,6 @@ _rundefrag()
 _supported_fs btrfs
 _supported_os Linux
 
-_setup_testdir
 ## We require scratch so that we'll have free contiguous space
 _require_scratch
 _scratch_mkfs >/dev/null 2>&1
tests/btrfs/014 +0 -1
index a49cf06..aa3edbb 100755
@@ -54,7 +54,6 @@ _balance()
 _supported_fs btrfs
 _supported_os Linux
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs >/dev/null 2>&1
 _scratch_mount
tests/generic/001 +4 -6
index aa82441..6e5f3dd 100755
@@ -118,14 +118,14 @@ udf_fsize=20240		# number of sectors for UDF
 
 _setup()
 {
-    if mkdir -p $testdir/$$
+    if mkdir -p $TEST_DIR/$$
     then
 	:
     else
-	echo "Error: cannot mkdir \"$testdir/$$\""
+	echo "Error: cannot mkdir \"$TEST_DIR/$$\""
 	exit 1
     fi
-    cd $testdir/$$
+    cd $TEST_DIR/$$
 
     $verbose && echo -n "setup "
     sed -e '/^#/d' $tmp.config \
@@ -286,8 +286,7 @@ _cleanup()
     then
 	$verbose && echo "cleanup"
 	cd /
-	rm -rf $testdir/$$
-	_cleanup_testdir
+	rm -rf $TEST_DIR/$$
 	done_cleanup=true
     fi
 }
@@ -298,7 +297,6 @@ _cleanup
 status=1
 done_cleanup=false
 
-_setup_testdir
 _setup
 
 # do the test
tests/generic/002 +8 -11
index 2aeebb1..656d29f 100755
@@ -38,43 +38,40 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
     rm -f $tmp.*
-    _cleanup_testdir
 }
 
 # real QA test starts here
 _supported_fs generic
 _supported_os IRIX Linux
 
-_setup_testdir
-
 echo "Silence is goodness ..."
 
 # ensure target directory exists
-mkdir `dirname $testdir/$tmp` 2>/dev/null
+mkdir `dirname $TEST_DIR/$tmp` 2>/dev/null
 
-touch $testdir/$tmp.1
+touch $TEST_DIR/$tmp.1
 for l in 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
 do
-    ln $testdir/$tmp.1 $testdir/$tmp.$l
-    x=`src/lstat64 $testdir/$tmp.1 | sed -n -e '/ Links: /s/.*Links: *//p'`
+    ln $TEST_DIR/$tmp.1 $TEST_DIR/$tmp.$l
+    x=`src/lstat64 $TEST_DIR/$tmp.1 | sed -n -e '/ Links: /s/.*Links: *//p'`
     if [ "$l" -ne $x ]
     then
 	echo "Arrgh, created link #$l and lstat64 looks like ..."
-	src/lstat64 $testdir/$tmp.1
+	src/lstat64 $TEST_DIR/$tmp.1
 	status=1
     fi
 done
 
 for l in 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
 do
-    x=`src/lstat64 $testdir/$tmp.1 | sed -n -e '/ Links: /s/.*Links: *//p'`
+    x=`src/lstat64 $TEST_DIR/$tmp.1 | sed -n -e '/ Links: /s/.*Links: *//p'`
     if [ "$l" -ne $x ]
     then
 	echo "Arrgh, about to remove link #$l and lstat64 looks like ..."
-	src/lstat64 $testdir/$tmp.1
+	src/lstat64 $TEST_DIR/$tmp.1
 	status=1
     fi
-    rm -f $testdir/$tmp.$l
+    rm -f $TEST_DIR/$tmp.$l
 done
 
 # success, all done
tests/generic/005 +2 -5
index de68b0d..544af14 100755
@@ -43,10 +43,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 
 _cleanup()
 {
-    cd $testdir
+    cd $TEST_DIR
     rm -f symlink_{0,1,2,3,4}{0,1,2,3,4,5,6,7,8,9} symlink_self empty_file
     cd /
-    _cleanup_testdir
 }
 
 _touch()
@@ -75,9 +74,7 @@ else
     _supported_os Linux IRIX
 fi
 
-_setup_testdir
-
-cd $testdir
+cd $TEST_DIR
 
 o=empty_file
 touch $o
tests/generic/006 +6 -9
index 62cc0c8..481e1f1 100755
@@ -35,8 +35,7 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    rm -rf $testdir/permname.$$
-    _cleanup_testdir
+    rm -rf $TEST_DIR/permname.$$
 }
 
 _count()
@@ -56,23 +55,21 @@ _count()
 _supported_fs generic
 _supported_os IRIX Linux
 
-_setup_testdir
-
-mkdir $testdir/permname.$$
+mkdir $TEST_DIR/permname.$$
 
 echo ""
 echo "single thread permname"
 echo "----------------------"
-mkdir $testdir/permname.$$/a
-cd $testdir/permname.$$/a
+mkdir $TEST_DIR/permname.$$/a
+cd $TEST_DIR/permname.$$/a
 $here/src/permname -c 4 -l 6 -p 1 || echo "permname returned $?"
 find . | _count
 
 echo ""
 echo "multi thread permname"
 echo "----------------------"
-mkdir $testdir/permname.$$/b
-cd $testdir/permname.$$/b
+mkdir $TEST_DIR/permname.$$/b
+cd $TEST_DIR/permname.$$/b
 $here/src/permname -c 4 -l 6 -p 4 || echo "permname returned $?"
 find . | _count
 
tests/generic/007 +3 -6
index 4947da6..abbee74 100755
@@ -38,8 +38,7 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    rm -rf $testdir/$seq
-    _cleanup_testdir
+    rm -rf $TEST_DIR/$seq
 }
 
 # get standard environment, filters and checks
@@ -50,8 +49,6 @@ _cleanup()
 _supported_fs generic
 _supported_os IRIX Linux
 
-_setup_testdir
-
 status=1 # default failure 
 sourcefile=$tmp.nametest
 seed=1
@@ -66,8 +63,8 @@ while [ $i -le $num_filenames ]; do
   let i=$i+1
 done
 
-mkdir $testdir/$seq
-cd $testdir/$seq
+mkdir $TEST_DIR/$seq
+cd $TEST_DIR/$seq
 $here/src/nametest -l $sourcefile -s $seed -i $iterations -z
 
 # success, all done
tests/generic/010 +2 -5
index 0bdfdd5..9d2e76a 100755
@@ -35,8 +35,7 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    rm -f $testdir/DBtest*.{pag,dir}
-    _cleanup_testdir
+    rm -f $TEST_DIR/DBtest*.{pag,dir}
 }
 
 # filter random number output from dbtest
@@ -58,11 +57,9 @@ _filter_dbtest()
 _supported_fs generic
 _supported_os IRIX Linux
 
-_setup_testdir
-
 rm -f $seqres.full
 
-cd $testdir
+cd $TEST_DIR
 
 $here/src/dbtest -l 5 -n 1000 2>&1 | tee -a $seqres.full | _filter_dbtest
 
tests/generic/011 +1 -4
index cad09ed..bed23aa 100755
@@ -37,7 +37,6 @@ _cleanup()
     cd /
     rm -f $tmp.*
     [ -n "$out" ] && rm -rf $out
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -48,9 +47,7 @@ _cleanup()
 _supported_fs generic
 _supported_os IRIX Linux
 
-_setup_testdir
-
-out=$testdir/dirstress.$$
+out=$TEST_DIR/dirstress.$$
 
 rm -f $seqres.full
 
tests/generic/013 +2 -5
index f66cade..8e76d3d 100755
@@ -41,8 +41,7 @@ _cleanup()
     # such that what it has is greater the 1024 chars and will
     # stop and complain - so get rid of complaint
     # Ref. pv#935754
-    rm -rf $testdir/fsstress.$$.* 2>&1 | grep -v 'Path too long'
-    _cleanup_testdir
+    rm -rf $TEST_DIR/fsstress.$$.* 2>&1 | grep -v 'Path too long'
 }
 
 _filesize()
@@ -60,7 +59,7 @@ _do_test()
     _param="$2"
     _count="$3"
 
-    out=$testdir/fsstress.$$.$_n
+    out=$TEST_DIR/fsstress.$$.$_n
     rm -rf $out
     if ! mkdir $out
     then
@@ -93,8 +92,6 @@ _do_test()
 _supported_fs generic
 _supported_os IRIX Linux
 
-_setup_testdir
-
 rm -f $seqres.full
 echo "brevity is wit..."
 
tests/generic/014 +2 -4
index d7da9ab..a9c2638 100755
@@ -35,8 +35,7 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    rm -rf $testdir/truncfile.$$.*
-    _cleanup_testdir
+    rm -rf $TEST_DIR/truncfile.$$.*
 }
 
 # get standard environment, filters and checks
@@ -47,7 +46,6 @@ _supported_fs generic
 _supported_os IRIX Linux
 
 _require_sparse_files
-_setup_testdir
 
 # ensure EOF preallocation doesn't massively extend the runtime of this test
 # by limiting the amount of preallocation and therefore the amount of blocks
@@ -62,7 +60,7 @@ echo "brevity is wit..."
 echo "------"
 echo "test 1"
 echo "------"
-if ! src/truncfile -c 10000 $testdir/truncfile.$$.0 >$tmp.out 2>&1
+if ! src/truncfile -c 10000 $TEST_DIR/truncfile.$$.0 >$tmp.out 2>&1
 then
     out=`cat $tmp.out`
     echo "truncfile returned $? : \"$out\""
tests/generic/020 +3 -10
index f004be5..a9bd17a 100755
@@ -29,21 +29,16 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=0	# success is the default!
-trap "_cleanup; rm -f $tmp.* $testfile; exit \$status" 0 1 2 3 15
+trap "rm -f $tmp.* $testfile; exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
 . ./common/filter
 . ./common/attr
 
-_cleanup()
-{
-    _cleanup_testdir
-}
-
 _filter()
 {
-    sed "s#$testdir[^ :]*#<TESTFILE>#g; 
+    sed "s#$TEST_DIR[^ :]*#<TESTFILE>#g; 
             s#$tmp[^ :]*#<TMPFILE>#g" $1
 }
 
@@ -83,11 +78,9 @@ _supported_os Linux
 
 _require_attrs
 
-_setup_testdir
-
 rm -f $seqres.full
 
-testfile=$testdir/attribute_$$
+testfile=$TEST_DIR/attribute_$$
 
 echo "*** list non-existant file"
 _attr_list $testfile
tests/generic/068 +0 -1
index b160766..a764019 100755
@@ -36,7 +36,6 @@ ITERATIONS=10
 _cleanup()
 {
     cd /
-    _cleanup_testdir
 
     trap 0 1 2 3 15
     exit $status
tests/generic/070 +1 -4
index ad9031e..3c88df0 100755
@@ -35,7 +35,6 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -49,10 +48,8 @@ _supported_os IRIX Linux
 
 _require_attrs
 
-_setup_testdir
-
 FSSTRESS_ARGS=`_scale_fsstress_args \
-	-d $testdir/fsstress \
+	-d $TEST_DIR/fsstress \
 	-f allocsp=0 \
 	-f freesp=0 \
 	-f bulkstat=0 \
tests/generic/074 +2 -5
index 55f72c2..668132e 100755
@@ -34,8 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
     cd /
-    rm -rf $testdir/fstest.$$.* $tmp.*
-    _cleanup_testdir
+    rm -rf $TEST_DIR/fstest.$$.* $tmp.*
 }
 
 # get standard environment, filters and checks
@@ -47,7 +46,7 @@ _do_test()
     _n="$1"
     _param="$2"
 
-    out=$testdir/fstest.$$.$_n
+    out=$TEST_DIR/fstest.$$.$_n
     rm -rf $out
     if ! mkdir $out
     then
@@ -156,8 +155,6 @@ _process_args "$@"
 echo "Params are for $param_type" >>$seqres.full
 echo "Params: n = $numchildren l = $numloops f = $numfiles" >>$seqres.full
 
-_setup_testdir
-
 _check_test_fs
 
 # Options:
tests/generic/075 +2 -5
index e806dea..8b4ab39 100755
@@ -34,8 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
     cd /
-    rm -rf $testdir/fsx.* $tmp.*
-    _cleanup_testdir
+    rm -rf $TEST_DIR/fsx.* $tmp.*
 }
 
 # get standard environment, filters and checks
@@ -47,7 +46,7 @@ _do_test()
     _n="$1"
     _param="$2"
 
-    out=$testdir/fsx
+    out=$TEST_DIR/fsx
     rm -rf $out
     if ! mkdir $out
     then
@@ -136,8 +135,6 @@ _process_args "$@"
 echo "Params are for $param_type" >>$seqres.full
 echo "Params: n = $numops1 N = $numops2 l = $filelen" >>$seqres.full
 
-_setup_testdir
-
 rm -f $seqres.full
 echo "brevity is wit..."
 
tests/generic/093 +4 -6
index a8ef52e..fe20f38 100755
@@ -41,13 +41,12 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 
 _cleanup()
 {
-    [ -n "$testdir" ] && rm -f $file
-    _cleanup_testdir
+    [ -n "$TEST_DIR" ] && rm -f $file
 }
 
 _testfilter()
 {
-    sed -e "s#$testdir#TESTDIR#g"
+    sed -e "s#$TEST_DIR#TESTDIR#g"
 }
 
 _filefilter()
@@ -65,12 +64,11 @@ _require_attrs
 
 rm -f $seqres.full
 
-_setup_testdir
 _need_to_be_root
 
 echo "QA output created by $seq"
 echo ""
-file=$testdir/$seq.file
+file=$TEST_DIR/$seq.file
 
 user=`grep ':all=:all=' /etc/capability | tail -1 | $AWK_PROG -F: '{print $1}'`
 uid=`_cat_passwd | grep $user | $AWK_PROG -F: '{print $3}'`
@@ -149,7 +147,7 @@ echo "list EA on file"
 ${ATTR_PROG} -R -l $file | _filefilter
 
 chown $uid $file
-chmod ugo+w $testdir
+chmod ugo+w $TEST_DIR
 echo "as non-root call writemod"
 $runas -u $uid src/writemod $file 2>&1 | _filefilter
 
tests/generic/097 +0 -3
index d7f6ec1..c120422 100755
@@ -78,8 +78,6 @@ _supported_os IRIX
 _require_scratch
 _require_attrs
 
-_setup_testdir 
-
 TARGET_DIR=$SCRATCH_MNT
 [ "$FSTYP" == "xfs" ] && TARGET_DIR=$TEST_DIR
 cd $TARGET_DIR
@@ -245,7 +243,6 @@ echo "list root EAs: none"
 ${ATTR_PROG} -R -l foo
 
 cd /
-_cleanup_testdir
 
 # Check the filesystem
 _check_scratch_fs
tests/generic/099 +0 -1
index 03fdded..7351966 100755
@@ -88,7 +88,6 @@ _require_acls
 # get dir
 #export FILE_SYS=xfs
 _require_scratch
-_setup_testdir
 
 cd $TARGET_DIR
 rm -rf $seq.dir1 # in case file is left over from previous runs.
tests/generic/100 +3 -5
index dfb5252..05d766f 100755
@@ -69,19 +69,17 @@ tar -cvf $TEMP_DIR/$TAR_FILE $POPULATED_DIR >>$seqres.full 2>&1
 
 # create f/s
 _require_scratch
-_setup_testdir
 
 # untar on f/s
-cd $testdir
+cd $TEST_DIR
 tar -xRvf $TEMP_DIR/$TAR_FILE >>$seqres.full 2>&1
 cd $here
 
 # use diff -qr to compare
-ls -R -l ${testdir}${POPULATED_DIR} >>$seqres.full 2>&1
-diff -qr $POPULATED_DIR ${testdir}${POPULATED_DIR}
+ls -R -l ${TEST_DIR}${POPULATED_DIR} >>$seqres.full 2>&1
+diff -qr $POPULATED_DIR ${TEST_DIR}${POPULATED_DIR}
 
 cd /
-_cleanup_testdir
 _check_scratch_fs
 
 status=0
tests/generic/112 +2 -5
index 65b3484..4918f75 100755
@@ -34,8 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
     cd /
-    rm -rf $testdir/fsx.* $tmp.*
-    _cleanup_testdir
+    rm -rf $TEST_DIR/fsx.* $tmp.*
 }
 
 # get standard environment, filters and checks
@@ -47,7 +46,7 @@ _do_test()
     _n="$1"
     _param="$2"
 
-    out=$testdir/fsx
+    out=$TEST_DIR/fsx
     rm -rf $out
     if ! mkdir $out
     then
@@ -137,8 +136,6 @@ _process_args "$@"
 echo "Params are for $param_type" >>$seqres.full
 echo "Params: n = $numops1 N = $numops2 l = $filelen" >>$seqres.full
 
-_setup_testdir
-
 rm -f $seqres.full
 echo "brevity is wit..."
 
tests/generic/113 +3 -6
index 5e9f5fe..56672f0 100755
@@ -34,8 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
     cd /
-    rm -f $testdir/aio-stress.$$.*
-    _cleanup_testdir
+    rm -f $TEST_DIR/aio-stress.$$.*
 }
 
 # get standard environment, filters and checks
@@ -49,11 +48,11 @@ _do_test()
     _count="$3"
     _nproc="$4"
 
-    _files="$testdir/aiostress.$$.$_n"
+    _files="$TEST_DIR/aiostress.$$.$_n"
     __proc=$_nproc
     [ $__proc -gt 1 ] && _param="-t $__proc $_param"
     while [ $__proc -gt 1 ]; do
-        _files="$_files $testdir/aiostress.$$.$_n.$__proc"
+        _files="$_files $TEST_DIR/aiostress.$$.$_n.$__proc"
 	let __proc=$__proc-1
     done
     rm -f $_files
@@ -80,8 +79,6 @@ _supported_os Linux
 
 [ -x $here/ltp/aio-stress ] || _notrun "aio-stress not built for this platform"
 
-_setup_testdir
-
 echo "brevity is wit..."
 
 count=1000
tests/generic/117 +0 -2
index 87e6987..f81265b 100755
@@ -67,7 +67,6 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -79,7 +78,6 @@ _cleanup()
 _supported_fs generic
 _supported_os IRIX Linux
 
-_setup_testdir
 _require_scratch
 _require_attrs
 
tests/generic/123 +2 -4
index 41b9d3b..911e9d2 100755
@@ -35,10 +35,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 
 _cleanup()
 {
-    cd $testdir
+    cd $TEST_DIR
     rm -rf $my_test_subdir
     cd /
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -51,8 +50,7 @@ _supported_os Linux IRIX
 
 _require_user
 
-_setup_testdir
-my_test_subdir=$testdir/123subdir
+my_test_subdir=$TEST_DIR/123subdir
 
 # create subdir with required permissions
 mkdir -m 755 $my_test_subdir
tests/generic/124 +1 -3
index 92e7619..93ec4a1 100755
@@ -38,7 +38,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
     cd /
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -49,13 +48,12 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs >/dev/null 2>&1
 _scratch_mount
 
 # Run preallo_rw_pattern on both test and scratch partitions
-for TESTFILE in $testdir/rw_pattern.tmp $SCRATCH_MNT/rw_pattern.tmp
+for TESTFILE in $TEST_DIR/rw_pattern.tmp $SCRATCH_MNT/rw_pattern.tmp
   do
   count=1
   while (( count < 101 ))
tests/generic/125 +2 -9
index 18f5cb1..f4ffea5 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1	# failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -46,9 +41,7 @@ _supported_os Linux
 
 _require_user
 
-_setup_testdir
-
-TESTDIR=$testdir/ftrunc
+TESTDIR=$TEST_DIR/ftrunc
 TESTFILE=$TESTDIR/ftrunc.tmp
 
 [ -d $TESTDIR ] && rm -r $TESTDIR
tests/generic/126 +1 -4
index 7fe5bc6..1796527 100755
@@ -34,7 +34,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
     cd /
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -45,11 +44,9 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 
-_setup_testdir
-
 QA_FS_PERMS=$here/src/fs_perms
 
-cd $testdir
+cd $TEST_DIR
 cp $here/src/testx ./testx.file
 
 # file_perm owner_uid owner_gid tester_uid tester_gid perm_to_test expected_result pass=1
tests/generic/127 +7 -10
index 373bf20..58ca91e 100755
@@ -38,7 +38,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
     rm -f $tmp.output
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -51,10 +50,10 @@ FSX_ARGS="-q -l $FSX_FILE_SIZE -o 65536 -S 191110531 -N 100000"
 _fsx_lite_nommap()
 {
     echo "=== FSX Light Mode, No Memory Mapping ==="
-    dd if=/dev/zero of=$testdir/fsx_lite_nommap bs=${FSX_FILE_SIZE} count=1 > /dev/null 2>&1
-    if ! ltp/fsx $FSX_ARGS -L -R -W $testdir/fsx_lite_nommap > $tmp.output 2>&1
+    dd if=/dev/zero of=$TEST_DIR/fsx_lite_nommap bs=${FSX_FILE_SIZE} count=1 > /dev/null 2>&1
+    if ! ltp/fsx $FSX_ARGS -L -R -W $TEST_DIR/fsx_lite_nommap > $tmp.output 2>&1
     then
-        echo "ltp/fsx $FSX_ARGS -L -R -W $testdir/fsx_lite_nommap"
+        echo "ltp/fsx $FSX_ARGS -L -R -W $TEST_DIR/fsx_lite_nommap"
         cat $tmp.output
         return 1
     fi
@@ -65,8 +64,8 @@ _fsx_lite_nommap()
 _fsx_lite_mmap()
 {
     echo "=== FSX Light Mode, Memory Mapping ==="
-    dd if=/dev/zero of=$testdir/fsx_lite_mmap bs=${FSX_FILE_SIZE} count=1 > /dev/null 2>&1
-    if ! ltp/fsx $FSX_ARGS -L $testdir/fsx_lite_mmap > $tmp.output 2>&1
+    dd if=/dev/zero of=$TEST_DIR/fsx_lite_mmap bs=${FSX_FILE_SIZE} count=1 > /dev/null 2>&1
+    if ! ltp/fsx $FSX_ARGS -L $TEST_DIR/fsx_lite_mmap > $tmp.output 2>&1
     then
     	echo "ltp/fsx $FSX_ARGS -L fsx_lite_mmap"
 	cat $tmp.output
@@ -79,7 +78,7 @@ _fsx_lite_mmap()
 _fsx_std_nommap()
 {
     echo "=== FSX Standard Mode, No Memory Mapping ==="
-    if ! ltp/fsx $FSX_ARGS -R -W $testdir/fsx_std_nommap > $tmp.output 2>&1
+    if ! ltp/fsx $FSX_ARGS -R -W $TEST_DIR/fsx_std_nommap > $tmp.output 2>&1
     then
         echo "ltp/fsx $FSX_ARGS -R -W fsx_std_nommap"
         cat $tmp.output
@@ -92,7 +91,7 @@ _fsx_std_nommap()
 _fsx_std_mmap()
 {
     echo "=== FSX Standard Mode, Memory Mapping ==="
-    if ! ltp/fsx $FSX_ARGS $testdir/fsx_std_mmap > $tmp.output 2>&1
+    if ! ltp/fsx $FSX_ARGS $TEST_DIR/fsx_std_mmap > $tmp.output 2>&1
     then
     	echo "ltp/fsx $FSX_ARGS fsx_std_mmap"
 	cat $tmp.output
@@ -106,8 +105,6 @@ _fsx_std_mmap()
 _supported_fs generic
 _supported_os Linux
 
-_setup_testdir
-
 _fsx_lite_nommap
 _fsx_lite_mmap
 
tests/generic/128 +1 -8
index c9c809f..22e4f71 100755
@@ -29,13 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1	# failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    cd /
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -45,7 +39,6 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 
-_setup_testdir
 _require_scratch
 _require_user
 
tests/generic/129 +1 -9
index fe763df..9a10d76 100755
@@ -29,13 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1	# failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    cd /
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -54,8 +48,6 @@ _supported_os Linux
 _require_scratch
 _require_sparse_files
 
-_setup_testdir
-
 _scratch_mkfs >/dev/null 2>&1
 _scratch_mount "-o nosuid"
 
tests/generic/130 +1 -9
index cfc2c32..8367dc7 100755
@@ -38,13 +38,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    cd /
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -57,8 +51,6 @@ _supported_os Linux IRIX
 _require_scratch
 _require_sparse_files
 
-_setup_testdir
-
 _scratch_mkfs >/dev/null 2>&1
 _scratch_mount
 
tests/generic/131 +4 -7
index 6c3131c..ce3e490 100755
@@ -35,7 +35,6 @@ _cleanup()
 {
     kill $locktest_pid2 > /dev/null 2>&1
     kill $locktest_pid1 > /dev/null 2>&1
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -46,9 +45,7 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 
-_setup_testdir
-
-TESTFILE=$testdir/lock_file
+TESTFILE=$TEST_DIR/lock_file
 
 # Grab a port which is hopefully unused
 if [ $$ -gt 1024 -a $$ -lt 32000 ]; then
@@ -60,13 +57,13 @@ elif [ $$ -gt 32000 ]; then
 fi
 
 # Start the server
-src/locktest -p $PORT $TESTFILE 2>&1 > $testdir/server.out &
+src/locktest -p $PORT $TESTFILE 2>&1 > $TEST_DIR/server.out &
 locktest_pid1=$!
 
 sleep 1
 
 # Start the client
-src/locktest -p $PORT -h localhost $TESTFILE 2>&1 > $testdir/client.out
+src/locktest -p $PORT -h localhost $TESTFILE 2>&1 > $TEST_DIR/client.out
 locktest_pid2=$!
 result=$?
 if [ $result -eq 0 ]; then
@@ -74,7 +71,7 @@ if [ $result -eq 0 ]; then
 	status=0
 else
 	echo "Client reported failure ($result)"
-	cat $testdir/*.out
+	cat $TEST_DIR/*.out
 fi
 
 exit
tests/generic/132 +1 -8
index 42ab909..aa52c7d 100755
@@ -30,13 +30,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    cd /
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -46,7 +40,6 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux IRIX
 
-_setup_testdir
 _require_scratch
 
 _scratch_mkfs >/dev/null 2>&1
tests/generic/133 +17 -24
index 65ab822..7fb1695 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -44,35 +39,33 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux IRIX
 
-_setup_testdir
-
 echo "Buffered writer, buffered reader"
-$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $testdir/io_test > /dev/null
-$XFS_IO_PROG -f -c 'pwrite -b 64k 0 512m' $testdir/io_test >/dev/null &
-$XFS_IO_PROG -c 'pread -b 64k 0 512m' $testdir/io_test > /dev/null
+$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $TEST_DIR/io_test > /dev/null
+$XFS_IO_PROG -f -c 'pwrite -b 64k 0 512m' $TEST_DIR/io_test >/dev/null &
+$XFS_IO_PROG -c 'pread -b 64k 0 512m' $TEST_DIR/io_test > /dev/null
 wait
-rm $testdir/io_test
+rm $TEST_DIR/io_test
 
 echo "Direct writer, buffered reader"
-$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $testdir/io_test > /dev/null
-$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $testdir/io_test >/dev/null &
-$XFS_IO_PROG -c 'pread -b 64k 0 512m' $testdir/io_test > /dev/null
+$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $TEST_DIR/io_test > /dev/null
+$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $TEST_DIR/io_test >/dev/null &
+$XFS_IO_PROG -c 'pread -b 64k 0 512m' $TEST_DIR/io_test > /dev/null
 wait
-rm $testdir/io_test
+rm $TEST_DIR/io_test
 
 echo "Buffered writer, direct reader"
-$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $testdir/io_test > /dev/null
-$XFS_IO_PROG -f -c 'pwrite -b 64k 0 512m' $testdir/io_test >/dev/null &
-$XFS_IO_PROG -d -c 'pread -b 64k 0 512m' $testdir/io_test > /dev/null
+$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $TEST_DIR/io_test > /dev/null
+$XFS_IO_PROG -f -c 'pwrite -b 64k 0 512m' $TEST_DIR/io_test >/dev/null &
+$XFS_IO_PROG -d -c 'pread -b 64k 0 512m' $TEST_DIR/io_test > /dev/null
 wait
-rm $testdir/io_test
+rm $TEST_DIR/io_test
 
 echo "Direct writer, direct reader"
-$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $testdir/io_test > /dev/null
-$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $testdir/io_test >/dev/null &
-$XFS_IO_PROG -d -c 'pread -b 64k 0 512m' $testdir/io_test > /dev/null
+$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $TEST_DIR/io_test > /dev/null
+$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $TEST_DIR/io_test >/dev/null &
+$XFS_IO_PROG -d -c 'pread -b 64k 0 512m' $TEST_DIR/io_test > /dev/null
 wait
-rm $testdir/io_test
+rm $TEST_DIR/io_test
 
 status=0
 exit 
tests/generic/135 +1 -8
index 783a106..e3b827a 100755
@@ -29,13 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    cd /
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -45,7 +39,6 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux IRIX
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs >/dev/null 2>&1
 
tests/generic/141 +1 -7
index 83b5486..fa08484 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -44,7 +39,6 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs >/dev/null 2>&1
 _scratch_mount
tests/generic/184 +4 -7
index 5d74fa3..dcc8b4e 100755
@@ -35,7 +35,6 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -46,12 +45,10 @@ _cleanup()
 _supported_fs generic
 _supported_os IRIX Linux
 
-_setup_testdir
-
-rm -f $testdir/null
-mknod $testdir/null c 1 3
-chmod 666 $testdir/null
-echo fred > $testdir/null
+rm -f $TEST_DIR/null
+mknod $TEST_DIR/null c 1 3
+chmod 666 $TEST_DIR/null
+echo fred > $TEST_DIR/null
 
 status=$?
 exit
tests/generic/225 +0 -1
index faa542a..73b125a 100755
@@ -34,7 +34,6 @@ _cleanup()
 {
 	cd /
 	rm -f $tmp.*
-	_cleanup_testdir
 }
 
 # get standard environment, filters and checks
tests/generic/237 +2 -5
index e5c5a79..6a61ec8 100755
@@ -42,8 +42,7 @@ _cleanup()
 {
 	cd /
 	rm -f $tmp.*
-	[ -n "$testdir" ] && rm -rf $testdir/$seq.dir1
-	_cleanup_testdir
+	[ -n "$TEST_DIR" ] && rm -rf $TEST_DIR/$seq.dir1
 }
 
 # real QA test starts here
@@ -55,14 +54,12 @@ _supported_os Linux
 
 rm -f $seqres.full
 
-_setup_testdir
-
 _need_to_be_root
 _acl_setup_ids
 _require_acls
 
 # get dir
-cd $testdir
+cd $TEST_DIR
 rm -rf $seq.dir1
 mkdir $seq.dir1
 cd $seq.dir1
tests/generic/249 +0 -2
index 1f25edb..306e820 100755
@@ -35,7 +35,6 @@ _cleanup()
 	cd /
 	rm -f $tmp.*
 	rm -f $SRC $DST
-	_cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -45,7 +44,6 @@ _cleanup()
 # real QA test starts here
 _supported_fs generic
 _supported_os Linux
-_setup_testdir
 
 echo "Feel the serenity."
 
tests/shared/051 +2 -5
index 07399cc..e957f86 100755
@@ -40,8 +40,7 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    [ -n "$testdir" ] && rm -rf $testdir/$seq.dir1
-    _cleanup_testdir
+    [ -n "$TEST_DIR" ] && rm -rf $TEST_DIR/$seq.dir1
 }
 
 # -----
@@ -76,14 +75,12 @@ _supported_os Linux
 
 rm -f $seqres.full
 
-_setup_testdir
-
 _need_to_be_root
 _acl_setup_ids
 _require_acls
 
 # get dir
-cd $testdir
+cd $TEST_DIR
 rm -rf $seq.dir1
 mkdir $seq.dir1
 cd $seq.dir1
tests/shared/218 +0 -2
index f21b8b2..cd2076e 100755
@@ -34,7 +34,6 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -46,7 +45,6 @@ _cleanup()
 _supported_fs xfs ext4 btrfs
 _supported_os Linux
 
-_setup_testdir
 # We require scratch so that we'll have free contiguous space
 _require_scratch
 _scratch_mkfs >/dev/null 2>&1
tests/udf/098 +0 -2
index 91e8a22..3a5db39 100755
@@ -81,8 +81,6 @@ _supported_os IRIX
 _require_scratch
 _require_attrs
 
-_setup_testdir
-
 cd $SCRATCH_MNT
 
 echo "create file foo"
tests/udf/102 +0 -1
index e27c086..8fd4697 100755
@@ -36,7 +36,6 @@ _cleanup()
 {
     rm -f $tmp.*
     cd /
-    _cleanup_testdir
 }
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/008 +2 -5
index e7a1768..56be923 100755
@@ -35,8 +35,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
     rm -f $tmp.*
-    rm -rf $testdir/randholes.$$.*
-    _cleanup_testdir
+    rm -rf $TEST_DIR/randholes.$$.*
 }
 
 _filter()
@@ -55,7 +54,7 @@ _do_test()
     _holes="$2"
     _param="$3"
 
-    out=$testdir/randholes.$$.$_n
+    out=$TEST_DIR/randholes.$$.$_n
     echo ""
     echo "randholes.$_n : $_param" | _filter
     echo "------------------------------------------"
@@ -89,8 +88,6 @@ _do_test()
 _supported_fs xfs
 _supported_os IRIX Linux
 
-_setup_testdir
-
 rm -f $seqres.full
 
 # Note on special numbers here.
tests/xfs/012 +2 -5
index cd9c485..4127222 100755
@@ -35,8 +35,7 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    rm -rf $testdir/holes.$$.*
-    _cleanup_testdir
+    rm -rf $TEST_DIR/holes.$$.*
 }
 
 _filesize()
@@ -56,7 +55,7 @@ _do_test()
 
     failed=0
 
-    out=$testdir/holes.$$.$_n
+    out=$TEST_DIR/holes.$$.$_n
     echo ""
     echo "holes.$_n : $_param"
     echo "-----------------------------------------------"
@@ -106,8 +105,6 @@ _do_test()
 _supported_fs xfs
 _supported_os IRIX Linux
 
-_setup_testdir
-
 rm -f $seqres.full
 
 # small & fairly dense
tests/xfs/048 +1 -4
index 40667e0..f9fb16f 100755
@@ -39,16 +39,13 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    _cleanup_testdir
 }
 
 # real QA test starts here
 _supported_fs xfs
 _supported_os IRIX Linux
 
-_setup_testdir
-
-src/fault $testdir || exit
+src/fault $TEST_DIR || exit
 
 # success, all done
 status=0
tests/xfs/066 +2 -5
index 6d4e1c2..d521ada 100755
@@ -40,22 +40,19 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    _cleanup_testdir
 }
 
 # real QA test starts here
 _supported_fs xfs
 _supported_os IRIX Linux
 
-_setup_testdir
-
 _my_stat_filter()
 {
     grep "[sS]ize" | sed "s/.*[sS]ize[: ]*\([[:digit:]]*\).*/\1 largefile/g"
 }
 
-rm -f $testdir/testfile
-if src/feature -t $testdir/testfile; then
+rm -f $TEST_DIR/testfile
+if src/feature -t $TEST_DIR/testfile; then
 	:
 else
 	_notrun "Installed libc doesn't correctly handle setrlimit/ftruncate64"
tests/xfs/078 +0 -1
index f2b674a..e04c6cc 100755
@@ -38,7 +38,6 @@ _cleanup()
     rm -f $tmp.*
     umount -d $LOOP_MNT 2>/dev/null
     rmdir $LOOP_MNT
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
tests/xfs/080 +1 -4
index b1cd0cb..59c6104 100755
@@ -39,7 +39,6 @@ _cleanup()
 { 
     cd /
     rm -f $tmp.*
-   _cleanup_testdir
 }
 
 _supported_fs xfs
@@ -48,13 +47,11 @@ _supported_fs xfs
 # but not at the moment.
 _supported_os Linux
 
-_setup_testdir
-
 quiet=-q
 clean=-c
 
 export here
-cd $testdir
+cd $TEST_DIR
 echo
 
 # real QA test starts here
tests/xfs/137 +1 -7
index 90dc1f5..79b3b89 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -44,7 +39,6 @@ _cleanup()
 _supported_fs xfs
 _supported_os Linux IRIX
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
tests/xfs/138 +1 -7
index d3c1009..1b11cf6 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -44,7 +39,6 @@ _cleanup()
 _supported_fs xfs
 _supported_os Linux IRIX
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
tests/xfs/139 +1 -7
index 1fbde58..e5296f7 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -44,7 +39,6 @@ _cleanup()
 _supported_fs xfs
 _supported_os Linux IRIX
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
tests/xfs/140 +1 -7
index ce52272..cccf262 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -44,7 +39,6 @@ _cleanup()
 _supported_fs xfs
 _supported_os Linux IRIX
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
tests/xfs/142 +1 -6
index 5a2ef9e..a1efcc2 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/143 +1 -6
index c86cc0a..c389a2b 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/144 +1 -6
index 0b5b21d..41041c4 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/145 +1 -6
index c8444f0..44b3e4e 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/146 +1 -6
index 1e13d95..c6343f8 100755
@@ -30,12 +30,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 _report_filter () {
     $PERL_PROG -ne "s/Report: \"0x[0-f]+\" was written and \"0x[0-f]+\" was read at/Report: \"HEX\" was written and \"HEX\" was read at/g ;
tests/xfs/147 +1 -6
index c22f24a..73ff7f9 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/150 +1 -6
index 3bf1c8b..f9e690a 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 _filter_fs_handle()
 {
tests/xfs/151 +1 -6
index d2e21f3..bba7094 100755
@@ -31,12 +31,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 _dm_create_session()
 {
tests/xfs/152 +1 -6
index 310f0dc..72bdabf 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 _filter_handles()
 {
tests/xfs/153 +1 -6
index 7b9a316..cac7722 100755
@@ -30,12 +30,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/154 +1 -6
index c281b37..810a6ac 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/155 +1 -6
index 23316f2..1a1631e 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/156 +1 -6
index 88b8cbf..d6e22b6 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/157 +1 -6
index a1243dc..bf65590 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/158 +1 -6
index 5c4dfcd..596f4c2 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/159 +1 -6
index 8d15162..fc5193f 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/160 +1 -6
index 44e9f2f..9a2e2d0 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/161 +1 -6
index 74d6dbe..11e53de 100755
@@ -30,12 +30,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 _filter_get_allocinfo()
 {
tests/xfs/162 +1 -6
index 64d001c..4edb68f 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/163 +1 -6
index 3a2d3b9..e283545 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 _filter_paths()
 {
tests/xfs/166 +1 -7
index 02b3237..2a96f8a 100755
@@ -29,14 +29,9 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+trap "exit \$status" 0 1 2 3 15
 rm -f $seqres.full
 
-_cleanup()
-{
-    _cleanup_testdir
-}
-
 # get standard environment, filters and checks
 . ./common/rc
 . ./common/filter
@@ -80,7 +75,6 @@ _filter_blocks()
 _supported_fs xfs
 _supported_os Linux
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
tests/xfs/167 +0 -2
index d75de23..ab0156f 100755
@@ -36,7 +36,6 @@ _cleanup()
 {
 	$KILLALL_PROG -r -q -TERM fsstress 2> /dev/null
 	sync	# ensures all fsstress processes died
-	_cleanup_testdir
 }
 
 workout()
@@ -59,7 +58,6 @@ _supported_os Linux
 
 [ -n "$KILLALL_PROG" ] || _notrun "killall executable not found"
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
tests/xfs/168 +1 -6
index 901125a..6fc4540 100755
@@ -31,12 +31,7 @@ here=`pwd`
 tmp=/tmp/$$
 rm -f $seqres.full
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 _filter_dmapi_print_event() {
     $PERL_PROG -ne '
tests/xfs/179 +1 -7
index 6402eda..ce50d99 100755
@@ -30,12 +30,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -45,7 +40,6 @@ _cleanup()
 _supported_fs xfs
 _supported_os Linux IRIX
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
tests/xfs/180 +1 -7
index 404f352..a0fb69a 100755
@@ -30,12 +30,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -45,7 +40,6 @@ _cleanup()
 _supported_fs xfs
 _supported_os Linux IRIX
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
tests/xfs/182 +1 -7
index f55e018..b75e4fc 100755
@@ -30,12 +30,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -45,7 +40,6 @@ _cleanup()
 _supported_fs xfs
 _supported_os Linux IRIX
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
tests/xfs/185 +1 -6
index 6de0ca9..17334de 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/216 +0 -2
index a21df9d..8513479 100755
@@ -34,7 +34,6 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -45,7 +44,6 @@ _cleanup()
 _supported_fs xfs
 _supported_os Linux
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
tests/xfs/217 +0 -2
index 25a6c01..6c439c0 100755
@@ -34,7 +34,6 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -45,7 +44,6 @@ _cleanup()
 _supported_fs xfs
 _supported_os Linux
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
tests/xfs/250 +0 -1
index b9953f7..3b67c3f 100755
@@ -36,7 +36,6 @@ _cleanup()
 	umount -d $LOOP_MNT 2>/dev/null
 	rm -f $LOOP_DEV
 	rmdir $LOOP_MNT
-	_cleanup_testdir
 }
 
 # get standard environment, filters and checks
Quoted 4 lines

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

---end quoted text---

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#2 lore raw
In reply to Christoph Hellwig
Quoted 9 lines · Christoph Hellwig

For historical reasons beyond my knowledge xfstests tries to abuse the scratch device as test device for nfs and udf. Because not all test have inherited the right usage of the _setup_testdir and _cleanup_testdir helpers this leads to lots of unessecary test failures.

Remove the special casing, which gets nfs down to a minimal number of failures.

Oof, that was a lot of cruft. Were you able to run UDF tests with these changes? I wonder if Jan is using this for UDF?

(I don't have the UDF verifier that many(/all?) of the UDF tests require).

-Eric

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#3 lore raw
Quoted 9 lines · Eric Sandeen
Quoted 8 lines · Christoph Hellwig

For historical reasons beyond my knowledge xfstests tries to abuse the scratch device as test device for nfs and udf. Because not all test have inherited the right usage of the _setup_testdir and _cleanup_testdir helpers this leads to lots of unessecary test failures.

Remove the special casing, which gets nfs down to a minimal number of failures.

Quoted 8 lines
Quoted 1 line

Oof, that was a lot of cruft. Were you able to run UDF tests with these changes? I wonder if Jan is using this for UDF?

(I don't have the UDF verifier that many(/all?) of the UDF tests require).

(Should have cc'd Jan, done now)

Quoted 1 line

-Eric

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#4 lore raw
Quoted 10 lines · Eric Sandeen
Quoted 9 lines · Eric Sandeen
Quoted 8 lines · Christoph Hellwig

For historical reasons beyond my knowledge xfstests tries to abuse the scratch device as test device for nfs and udf. Because not all test have inherited the right usage of the _setup_testdir and _cleanup_testdir helpers this leads to lots of unessecary test failures.

Remove the special casing, which gets nfs down to a minimal number of failures.

Quoted 8 lines
Quoted 8 lines
Quoted 1 line

Oof, that was a lot of cruft. Were you able to run UDF tests with these changes? I wonder if Jan is using this for UDF?

(I don't have the UDF verifier that many(/all?) of the UDF tests require).

No, I don't run xfstests for udf since there are only minimal changes
to udf these days and the problems tend to be more in compatibility with various udf formats (since udf has about four ways how to do each thing and you can decide which way your implementation does it which gets hairy when you have to read all these combinations). But it's an interesting idea to try running xfstests on UDF. I actually have the verifier so I should be able to make it run...

Honza

Signature · 7 lines
Jan Kara <[email protected]>
SUSE Labs, CR

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#5 lore raw

I verified that xfstests still works fine on UDF. There's a couple failures that don't seem to be related to this patch:

076,100,124
- complain about the missing UDF validator

225
- udf does not support fiemap, and we don't seem to guard against it

258,309
- timestamp update issues

277
- udf does not seem to support the IOC_GET/SET_FLAGS ioctls

285:
- udf misses proper SEEK_DATA/HOLE support

But we also hit a lockdep splat early on:

generic/005 1s ...[ 175.706958]

[  175.707546] =============================================
[  175.708790] [ INFO: possible recursive locking detected ]
[  175.709911] 3.12.0+ #16 Not tainted
[  175.710001] ---------------------------------------------
[  175.710001] ln/7386 is trying to acquire lock:
[  175.710001]  (&ei->i_data_sem){+.+...}, at: [<ffffffff8142f06d>] udf_get_block+0x8d/0x130
[  175.710001] 
[  175.710001] but task is already holding lock:
[  175.710001]  (&ei->i_data_sem){+.+...}, at: [<ffffffff81431a8d>] udf_symlink+0x8d/0x690
[  175.710001] 
[  175.710001] other info that might help us debug this:
[  175.710001]  Possible unsafe locking scenario:
[  175.710001] 
[  175.710001]        CPU0
[  175.710001]        ----
[  175.710001]   lock(&ei->i_data_sem);
[  175.710001]   lock(&ei->i_data_sem);
[  175.710001] 
[  175.710001]  *** DEADLOCK ***
[  175.710001] 
[  175.710001]  May be due to missing lock nesting notation
[  175.710001] 
[  175.710001] 3 locks held by ln/7386:
[  175.710001]  #0:  (sb_writers#9){.+.+.+}, at: [<ffffffff811a471f>] mnt_want_write+0x1f/0x50
[  175.710001]  #1:  (&type->i_mutex_dir_key#3/1){+.+.+.}, at:
[<ffffffff81192552>] kern_path_create+0x82/0x160
[  175.710001]  #2:  (&ei->i_data_sem){+.+...}, at: [<ffffffff81431a8d>] udf_symlink+0x8d/0x690
[  175.710001] 
[  175.710001] stack backtrace:
[  175.710001] CPU: 1 PID: 7386 Comm: ln Not tainted 3.12.0+ #16
[  175.710001] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
[  175.710001]  ffffffff82917cd0 ffff88007add9a78 ffffffff81c1f00d ffff88007b66c080
[  175.710001]  ffffffff82917cd0 ffff88007add9b68 ffffffff810f91b2 ffff88007add9b78
[  175.710001]  ffffffff810f8bb3 ffff88007add9b18 ffff88000000031b 0000000000000003
[  175.710001] Call Trace:
[  175.710001]  [<ffffffff81c1f00d>] dump_stack+0x46/0x58
[  175.710001]  [<ffffffff810f91b2>] __lock_acquire+0x8f2/0x1fa0
[  175.710001]  [<ffffffff810f8bb3>] ? __lock_acquire+0x2f3/0x1fa0
[  175.710001]  [<ffffffff810fae28>] lock_acquire+0x98/0x120
[  175.710001]  [<ffffffff8142f06d>] ? udf_get_block+0x8d/0x130
[  175.710001]  [<ffffffff810fb73a>] ? mark_held_locks+0x8a/0x120
[  175.710001]  [<ffffffff811b745f>] ? __find_get_block+0xaf/0x250
[  175.710001]  [<ffffffff81c2533c>] down_write+0x2c/0x50
[  175.710001]  [<ffffffff8142f06d>] ? udf_get_block+0x8d/0x130
[  175.710001]  [<ffffffff8142f06d>] udf_get_block+0x8d/0x130
[  175.710001]  [<ffffffff8142f13c>] udf_getblk+0x2c/0xc0
[  175.710001]  [<ffffffff811b9c60>] ? __getblk+0x20/0x2e0
[  175.710001]  [<ffffffff81c28306>] ? _raw_spin_unlock+0x26/0x30
[  175.710001]  [<ffffffff8142f1ec>] udf_bread+0x1c/0x90
[  175.710001]  [<ffffffff814305ca>] udf_add_entry+0x37a/0xbe0
[  175.710001]  [<ffffffff81431de2>] udf_symlink+0x3e2/0x690
[  175.710001]  [<ffffffff81190c10>] vfs_symlink+0x70/0xb0
[  175.710001]  [<ffffffff81195721>] SyS_symlinkat+0x61/0xc0
[  175.710001]  [<ffffffff81195791>] SyS_symlink+0x11/0x20
[  175.710001]  [<ffffffff81c30739>] system_call_fastpath+0x16/0x1b

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#6 lore raw
In reply to Eric Sandeen
Quoted 6 lines · Eric Sandeen
Quoted 5 lines · Christoph Hellwig

For historical reasons beyond my knowledge xfstests tries to abuse the scratch device as test device for nfs and udf. Because not all test have inherited the right usage of the _setup_testdir and _cleanup_testdir helpers this leads to lots of unessecary test failures.

Quoted 8 lines
Quoted 4 lines

Remove the special casing, which gets nfs down to a minimal number of failures.

Oof, that was a lot of cruft. Were you able to run UDF tests with these changes? I wonder if Jan is using this for UDF?

I didn't bother testing udf, but it's just another block based filesystem, so unlike NFS I didn't expect breakage. Let me give it a spin..

Quoted 2 lines

(I don't have the UDF verifier that many(/all?) of the UDF tests require).

Last time I did run xfstests on UDF it wasn't required, just an additional tool to verify the fs consistency.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Reviewed-by on v1 1/1
#7 lore raw
In reply to Christoph Hellwig
Quoted 9 lines · Christoph Hellwig

For historical reasons beyond my knowledge xfstests tries to abuse the scratch device as test device for nfs and udf. Because not all test have inherited the right usage of the _setup_testdir and _cleanup_testdir helpers this leads to lots of unessecary test failures.

Remove the special casing, which gets nfs down to a minimal number of failures.

Thanks for double checking UDF.

Quoted 2,240 lines
common/rc +1 -99
index ea3af12..c64933a 100644
@@ -975,11 +975,7 @@ _require_scratch()
 {
     case "$FSTYP" in
 	nfs*)
-		 echo $SCRATCH_DEV | grep -q ":" > /dev/null 2>&1
-		 if [ -z "$SCRATCH_DEV" -o "$?" != "0" ]
-		 then
-		     _notrun "this test requires a valid \$SCRATCH_DEV"
-		 fi
+                 _notrun "requires a scratch device"
 		 ;;
 	*)
 		 if [ -z "$SCRATCH_DEV" -o "`_is_block_dev $SCRATCH_DEV`" = "" ]
@@ -1773,100 +1769,6 @@ _full_platform_details()
      echo "$os/$platform $host $kernel"
 }
 
-_setup_udf_scratchdir()
-{
-    [ "$FSTYP" != "udf" ] \
-	&& _fail "setup_udf_testdir: \$FSTYP is not udf"
-    [ -z "$SCRATCH_DEV" -o ! -b "$SCRATCH_DEV" ] \
-	&& _notrun "this test requires a valid \$SCRATCH_DEV"
-    [ -z "$SCRATCH_MNT" ] \
-	&& _notrun "this test requires a valid \$SCRATCH_MNT"
-
-    # mounted?
-    if _mount | grep -q $SCRATCH_DEV
-    then
-        # if it's mounted, make sure its on $TEST_RW_DIR
-        if ! _mount | grep $SCRATCH_DEV | grep -q $SCRATCH_MNT
-        then
-            _fail "\$SCRATCH_DEV is mounted but not on \$SCRATCH_MNT - aborting"
-        fi
-    	$UMOUNT_PROG $SCRATCH_DEV
-    fi
-
-    _scratch_mkfs
-    _scratch_mount
-
-    testdir=$SCRATCH_MNT
-}
-
-_setup_nfs_scratchdir()
-{
-    [ "$FSTYP" != "nfs" ] \
-	&& _fail "setup_nfs_testdir: \$FSTYP is not nfs"
-    [ -z "$SCRATCH_DEV" ] \
-	&& _notrun "this test requires a valid host fs for \$SCRATCH_DEV"
-    [ -z "$SCRATCH_MNT" ] \
-	&& _notrun "this test requires a valid \$SCRATCH_MNT"
-
-    # mounted?
-    if _mount | grep -q $SCRATCH_DEV
-    then
-        # if it's mounted, make sure its on $SCRATCH_MNT
-        if ! _mount | grep $SCRATCH_DEV | grep -q $SCRATCH_MNT
-        then
-            _fail "\$SCRATCH_DEV is mounted but not on \$SCRATCH_MNT - aborting"
-        fi
-    	$UMOUNT_PROG $SCRATCH_DEV
-    fi
-
-    _scratch_mkfs
-    _scratch_mount
-
-    testdir=$SCRATCH_MNT
-}
-
-#
-# Warning for UDF and NFS:
-# this function calls _setup_udf_scratchdir and _setup_udf_scratchdir
-# which actually uses the scratch dir for the test dir.
-#
-# This was done because testdir was intended to be a persistent
-# XFS only partition.  This should eventually change, and treat
-# at least local filesystems all the same.
-#
-_setup_testdir()
-{
-    case $FSTYP in
-    udf)
-	_setup_udf_scratchdir
-	;;
-    nfs*)
-	_setup_nfs_scratchdir
-	;;
-    *)
-	testdir=$TEST_DIR
-	;;
-    esac
-}
-
-_cleanup_testdir()
-{
-    case $FSTYP in
-    udf)
-	# umount testdir as it is $SCRATCH_MNT which could be used by xfs next
-	[ -n "$testdir" ] && $UMOUNT_PROG $testdir
-	;;
-    nfs*)
-	# umount testdir as it is $SCRATCH_MNT which could be used by xfs next
-	[ -n "$testdir" ] && $UMOUNT_PROG $testdir
-	;;
-    *)
-	# do nothing, testdir is $TEST_DIR
-	:
-	;;
-    esac
-}
-
 _link_out_file()
 {
 	if [ -z "$1" -o -z "$2" ]; then
tests/btrfs/005 +0 -1
index 81badf6..c364e11 100755
@@ -135,7 +135,6 @@ _rundefrag()
 _supported_fs btrfs
 _supported_os Linux
 
-_setup_testdir
 ## We require scratch so that we'll have free contiguous space
 _require_scratch
 _scratch_mkfs >/dev/null 2>&1
tests/btrfs/014 +0 -1
index a49cf06..aa3edbb 100755
@@ -54,7 +54,6 @@ _balance()
 _supported_fs btrfs
 _supported_os Linux
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs >/dev/null 2>&1
 _scratch_mount
tests/generic/001 +4 -6
index aa82441..6e5f3dd 100755
@@ -118,14 +118,14 @@ udf_fsize=20240		# number of sectors for UDF
 
 _setup()
 {
-    if mkdir -p $testdir/$$
+    if mkdir -p $TEST_DIR/$$
     then
 	:
     else
-	echo "Error: cannot mkdir \"$testdir/$$\""
+	echo "Error: cannot mkdir \"$TEST_DIR/$$\""
 	exit 1
     fi
-    cd $testdir/$$
+    cd $TEST_DIR/$$
 
     $verbose && echo -n "setup "
     sed -e '/^#/d' $tmp.config \
@@ -286,8 +286,7 @@ _cleanup()
     then
 	$verbose && echo "cleanup"
 	cd /
-	rm -rf $testdir/$$
-	_cleanup_testdir
+	rm -rf $TEST_DIR/$$
 	done_cleanup=true
     fi
 }
@@ -298,7 +297,6 @@ _cleanup
 status=1
 done_cleanup=false
 
-_setup_testdir
 _setup
 
 # do the test
tests/generic/002 +8 -11
index 2aeebb1..656d29f 100755
@@ -38,43 +38,40 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
     rm -f $tmp.*
-    _cleanup_testdir
 }
 
 # real QA test starts here
 _supported_fs generic
 _supported_os IRIX Linux
 
-_setup_testdir
-
 echo "Silence is goodness ..."
 
 # ensure target directory exists
-mkdir `dirname $testdir/$tmp` 2>/dev/null
+mkdir `dirname $TEST_DIR/$tmp` 2>/dev/null
 
-touch $testdir/$tmp.1
+touch $TEST_DIR/$tmp.1
 for l in 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
 do
-    ln $testdir/$tmp.1 $testdir/$tmp.$l
-    x=`src/lstat64 $testdir/$tmp.1 | sed -n -e '/ Links: /s/.*Links: *//p'`
+    ln $TEST_DIR/$tmp.1 $TEST_DIR/$tmp.$l
+    x=`src/lstat64 $TEST_DIR/$tmp.1 | sed -n -e '/ Links: /s/.*Links: *//p'`
     if [ "$l" -ne $x ]
     then
 	echo "Arrgh, created link #$l and lstat64 looks like ..."
-	src/lstat64 $testdir/$tmp.1
+	src/lstat64 $TEST_DIR/$tmp.1
 	status=1
     fi
 done
 
 for l in 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
 do
-    x=`src/lstat64 $testdir/$tmp.1 | sed -n -e '/ Links: /s/.*Links: *//p'`
+    x=`src/lstat64 $TEST_DIR/$tmp.1 | sed -n -e '/ Links: /s/.*Links: *//p'`
     if [ "$l" -ne $x ]
     then
 	echo "Arrgh, about to remove link #$l and lstat64 looks like ..."
-	src/lstat64 $testdir/$tmp.1
+	src/lstat64 $TEST_DIR/$tmp.1
 	status=1
     fi
-    rm -f $testdir/$tmp.$l
+    rm -f $TEST_DIR/$tmp.$l
 done
 
 # success, all done
tests/generic/005 +2 -5
index de68b0d..544af14 100755
@@ -43,10 +43,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 
 _cleanup()
 {
-    cd $testdir
+    cd $TEST_DIR
     rm -f symlink_{0,1,2,3,4}{0,1,2,3,4,5,6,7,8,9} symlink_self empty_file
     cd /
-    _cleanup_testdir
 }
 
 _touch()
@@ -75,9 +74,7 @@ else
     _supported_os Linux IRIX
 fi
 
-_setup_testdir
-
-cd $testdir
+cd $TEST_DIR
 
 o=empty_file
 touch $o
tests/generic/006 +6 -9
index 62cc0c8..481e1f1 100755
@@ -35,8 +35,7 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    rm -rf $testdir/permname.$$
-    _cleanup_testdir
+    rm -rf $TEST_DIR/permname.$$
 }
 
 _count()
@@ -56,23 +55,21 @@ _count()
 _supported_fs generic
 _supported_os IRIX Linux
 
-_setup_testdir
-
-mkdir $testdir/permname.$$
+mkdir $TEST_DIR/permname.$$
 
 echo ""
 echo "single thread permname"
 echo "----------------------"
-mkdir $testdir/permname.$$/a
-cd $testdir/permname.$$/a
+mkdir $TEST_DIR/permname.$$/a
+cd $TEST_DIR/permname.$$/a
 $here/src/permname -c 4 -l 6 -p 1 || echo "permname returned $?"
 find . | _count
 
 echo ""
 echo "multi thread permname"
 echo "----------------------"
-mkdir $testdir/permname.$$/b
-cd $testdir/permname.$$/b
+mkdir $TEST_DIR/permname.$$/b
+cd $TEST_DIR/permname.$$/b
 $here/src/permname -c 4 -l 6 -p 4 || echo "permname returned $?"
 find . | _count
 
tests/generic/007 +3 -6
index 4947da6..abbee74 100755
@@ -38,8 +38,7 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    rm -rf $testdir/$seq
-    _cleanup_testdir
+    rm -rf $TEST_DIR/$seq
 }
 
 # get standard environment, filters and checks
@@ -50,8 +49,6 @@ _cleanup()
 _supported_fs generic
 _supported_os IRIX Linux
 
-_setup_testdir
-
 status=1 # default failure 
 sourcefile=$tmp.nametest
 seed=1
@@ -66,8 +63,8 @@ while [ $i -le $num_filenames ]; do
   let i=$i+1
 done
 
-mkdir $testdir/$seq
-cd $testdir/$seq
+mkdir $TEST_DIR/$seq
+cd $TEST_DIR/$seq
 $here/src/nametest -l $sourcefile -s $seed -i $iterations -z
 
 # success, all done
tests/generic/010 +2 -5
index 0bdfdd5..9d2e76a 100755
@@ -35,8 +35,7 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    rm -f $testdir/DBtest*.{pag,dir}
-    _cleanup_testdir
+    rm -f $TEST_DIR/DBtest*.{pag,dir}
 }
 
 # filter random number output from dbtest
@@ -58,11 +57,9 @@ _filter_dbtest()
 _supported_fs generic
 _supported_os IRIX Linux
 
-_setup_testdir
-
 rm -f $seqres.full
 
-cd $testdir
+cd $TEST_DIR
 
 $here/src/dbtest -l 5 -n 1000 2>&1 | tee -a $seqres.full | _filter_dbtest
 
tests/generic/011 +1 -4
index cad09ed..bed23aa 100755
@@ -37,7 +37,6 @@ _cleanup()
     cd /
     rm -f $tmp.*
     [ -n "$out" ] && rm -rf $out
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -48,9 +47,7 @@ _cleanup()
 _supported_fs generic
 _supported_os IRIX Linux
 
-_setup_testdir
-
-out=$testdir/dirstress.$$
+out=$TEST_DIR/dirstress.$$
 
 rm -f $seqres.full
 
tests/generic/013 +2 -5
index f66cade..8e76d3d 100755
@@ -41,8 +41,7 @@ _cleanup()
     # such that what it has is greater the 1024 chars and will
     # stop and complain - so get rid of complaint
     # Ref. pv#935754
-    rm -rf $testdir/fsstress.$$.* 2>&1 | grep -v 'Path too long'
-    _cleanup_testdir
+    rm -rf $TEST_DIR/fsstress.$$.* 2>&1 | grep -v 'Path too long'
 }
 
 _filesize()
@@ -60,7 +59,7 @@ _do_test()
     _param="$2"
     _count="$3"
 
-    out=$testdir/fsstress.$$.$_n
+    out=$TEST_DIR/fsstress.$$.$_n
     rm -rf $out
     if ! mkdir $out
     then
@@ -93,8 +92,6 @@ _do_test()
 _supported_fs generic
 _supported_os IRIX Linux
 
-_setup_testdir
-
 rm -f $seqres.full
 echo "brevity is wit..."
 
tests/generic/014 +2 -4
index d7da9ab..a9c2638 100755
@@ -35,8 +35,7 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    rm -rf $testdir/truncfile.$$.*
-    _cleanup_testdir
+    rm -rf $TEST_DIR/truncfile.$$.*
 }
 
 # get standard environment, filters and checks
@@ -47,7 +46,6 @@ _supported_fs generic
 _supported_os IRIX Linux
 
 _require_sparse_files
-_setup_testdir
 
 # ensure EOF preallocation doesn't massively extend the runtime of this test
 # by limiting the amount of preallocation and therefore the amount of blocks
@@ -62,7 +60,7 @@ echo "brevity is wit..."
 echo "------"
 echo "test 1"
 echo "------"
-if ! src/truncfile -c 10000 $testdir/truncfile.$$.0 >$tmp.out 2>&1
+if ! src/truncfile -c 10000 $TEST_DIR/truncfile.$$.0 >$tmp.out 2>&1
 then
     out=`cat $tmp.out`
     echo "truncfile returned $? : \"$out\""
tests/generic/020 +3 -10
index f004be5..a9bd17a 100755
@@ -29,21 +29,16 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=0	# success is the default!
-trap "_cleanup; rm -f $tmp.* $testfile; exit \$status" 0 1 2 3 15
+trap "rm -f $tmp.* $testfile; exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
 . ./common/filter
 . ./common/attr
 
-_cleanup()
-{
-    _cleanup_testdir
-}
-
 _filter()
 {
-    sed "s#$testdir[^ :]*#<TESTFILE>#g; 
+    sed "s#$TEST_DIR[^ :]*#<TESTFILE>#g; 
             s#$tmp[^ :]*#<TMPFILE>#g" $1
 }
 
@@ -83,11 +78,9 @@ _supported_os Linux
 
 _require_attrs
 
-_setup_testdir
-
 rm -f $seqres.full
 
-testfile=$testdir/attribute_$$
+testfile=$TEST_DIR/attribute_$$
 
 echo "*** list non-existant file"
 _attr_list $testfile
tests/generic/068 +0 -1
index b160766..a764019 100755
@@ -36,7 +36,6 @@ ITERATIONS=10
 _cleanup()
 {
     cd /
-    _cleanup_testdir
 
     trap 0 1 2 3 15
     exit $status
tests/generic/070 +1 -4
index ad9031e..3c88df0 100755
@@ -35,7 +35,6 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -49,10 +48,8 @@ _supported_os IRIX Linux
 
 _require_attrs
 
-_setup_testdir
-
 FSSTRESS_ARGS=`_scale_fsstress_args \
-	-d $testdir/fsstress \
+	-d $TEST_DIR/fsstress \
 	-f allocsp=0 \
 	-f freesp=0 \
 	-f bulkstat=0 \
tests/generic/074 +2 -5
index 55f72c2..668132e 100755
@@ -34,8 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
     cd /
-    rm -rf $testdir/fstest.$$.* $tmp.*
-    _cleanup_testdir
+    rm -rf $TEST_DIR/fstest.$$.* $tmp.*
 }
 
 # get standard environment, filters and checks
@@ -47,7 +46,7 @@ _do_test()
     _n="$1"
     _param="$2"
 
-    out=$testdir/fstest.$$.$_n
+    out=$TEST_DIR/fstest.$$.$_n
     rm -rf $out
     if ! mkdir $out
     then
@@ -156,8 +155,6 @@ _process_args "$@"
 echo "Params are for $param_type" >>$seqres.full
 echo "Params: n = $numchildren l = $numloops f = $numfiles" >>$seqres.full
 
-_setup_testdir
-
 _check_test_fs
 
 # Options:
tests/generic/075 +2 -5
index e806dea..8b4ab39 100755
@@ -34,8 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
     cd /
-    rm -rf $testdir/fsx.* $tmp.*
-    _cleanup_testdir
+    rm -rf $TEST_DIR/fsx.* $tmp.*
 }
 
 # get standard environment, filters and checks
@@ -47,7 +46,7 @@ _do_test()
     _n="$1"
     _param="$2"
 
-    out=$testdir/fsx
+    out=$TEST_DIR/fsx
     rm -rf $out
     if ! mkdir $out
     then
@@ -136,8 +135,6 @@ _process_args "$@"
 echo "Params are for $param_type" >>$seqres.full
 echo "Params: n = $numops1 N = $numops2 l = $filelen" >>$seqres.full
 
-_setup_testdir
-
 rm -f $seqres.full
 echo "brevity is wit..."
 
tests/generic/093 +4 -6
index a8ef52e..fe20f38 100755
@@ -41,13 +41,12 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 
 _cleanup()
 {
-    [ -n "$testdir" ] && rm -f $file
-    _cleanup_testdir
+    [ -n "$TEST_DIR" ] && rm -f $file
 }
 
 _testfilter()
 {
-    sed -e "s#$testdir#TESTDIR#g"
+    sed -e "s#$TEST_DIR#TESTDIR#g"
 }
 
 _filefilter()
@@ -65,12 +64,11 @@ _require_attrs
 
 rm -f $seqres.full
 
-_setup_testdir
 _need_to_be_root
 
 echo "QA output created by $seq"
 echo ""
-file=$testdir/$seq.file
+file=$TEST_DIR/$seq.file
 
 user=`grep ':all=:all=' /etc/capability | tail -1 | $AWK_PROG -F: '{print $1}'`
 uid=`_cat_passwd | grep $user | $AWK_PROG -F: '{print $3}'`
@@ -149,7 +147,7 @@ echo "list EA on file"
 ${ATTR_PROG} -R -l $file | _filefilter
 
 chown $uid $file
-chmod ugo+w $testdir
+chmod ugo+w $TEST_DIR
 echo "as non-root call writemod"
 $runas -u $uid src/writemod $file 2>&1 | _filefilter
 
tests/generic/097 +0 -3
index d7f6ec1..c120422 100755
@@ -78,8 +78,6 @@ _supported_os IRIX
 _require_scratch
 _require_attrs
 
-_setup_testdir 
-
 TARGET_DIR=$SCRATCH_MNT
 [ "$FSTYP" == "xfs" ] && TARGET_DIR=$TEST_DIR
 cd $TARGET_DIR
@@ -245,7 +243,6 @@ echo "list root EAs: none"
 ${ATTR_PROG} -R -l foo
 
 cd /
-_cleanup_testdir
 
 # Check the filesystem
 _check_scratch_fs
tests/generic/099 +0 -1
index 03fdded..7351966 100755
@@ -88,7 +88,6 @@ _require_acls
 # get dir
 #export FILE_SYS=xfs
 _require_scratch
-_setup_testdir
 
 cd $TARGET_DIR
 rm -rf $seq.dir1 # in case file is left over from previous runs.
tests/generic/100 +3 -5
index dfb5252..05d766f 100755
@@ -69,19 +69,17 @@ tar -cvf $TEMP_DIR/$TAR_FILE $POPULATED_DIR >>$seqres.full 2>&1
 
 # create f/s
 _require_scratch
-_setup_testdir
 
 # untar on f/s
-cd $testdir
+cd $TEST_DIR
 tar -xRvf $TEMP_DIR/$TAR_FILE >>$seqres.full 2>&1
 cd $here
 
 # use diff -qr to compare
-ls -R -l ${testdir}${POPULATED_DIR} >>$seqres.full 2>&1
-diff -qr $POPULATED_DIR ${testdir}${POPULATED_DIR}
+ls -R -l ${TEST_DIR}${POPULATED_DIR} >>$seqres.full 2>&1
+diff -qr $POPULATED_DIR ${TEST_DIR}${POPULATED_DIR}
 
 cd /
-_cleanup_testdir
 _check_scratch_fs
 
 status=0
tests/generic/112 +2 -5
index 65b3484..4918f75 100755
@@ -34,8 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
     cd /
-    rm -rf $testdir/fsx.* $tmp.*
-    _cleanup_testdir
+    rm -rf $TEST_DIR/fsx.* $tmp.*
 }
 
 # get standard environment, filters and checks
@@ -47,7 +46,7 @@ _do_test()
     _n="$1"
     _param="$2"
 
-    out=$testdir/fsx
+    out=$TEST_DIR/fsx
     rm -rf $out
     if ! mkdir $out
     then
@@ -137,8 +136,6 @@ _process_args "$@"
 echo "Params are for $param_type" >>$seqres.full
 echo "Params: n = $numops1 N = $numops2 l = $filelen" >>$seqres.full
 
-_setup_testdir
-
 rm -f $seqres.full
 echo "brevity is wit..."
 
tests/generic/113 +3 -6
index 5e9f5fe..56672f0 100755
@@ -34,8 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
     cd /
-    rm -f $testdir/aio-stress.$$.*
-    _cleanup_testdir
+    rm -f $TEST_DIR/aio-stress.$$.*
 }
 
 # get standard environment, filters and checks
@@ -49,11 +48,11 @@ _do_test()
     _count="$3"
     _nproc="$4"
 
-    _files="$testdir/aiostress.$$.$_n"
+    _files="$TEST_DIR/aiostress.$$.$_n"
     __proc=$_nproc
     [ $__proc -gt 1 ] && _param="-t $__proc $_param"
     while [ $__proc -gt 1 ]; do
-        _files="$_files $testdir/aiostress.$$.$_n.$__proc"
+        _files="$_files $TEST_DIR/aiostress.$$.$_n.$__proc"
 	let __proc=$__proc-1
     done
     rm -f $_files
@@ -80,8 +79,6 @@ _supported_os Linux
 
 [ -x $here/ltp/aio-stress ] || _notrun "aio-stress not built for this platform"
 
-_setup_testdir
-
 echo "brevity is wit..."
 
 count=1000
tests/generic/117 +0 -2
index 87e6987..f81265b 100755
@@ -67,7 +67,6 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -79,7 +78,6 @@ _cleanup()
 _supported_fs generic
 _supported_os IRIX Linux
 
-_setup_testdir
 _require_scratch
 _require_attrs
 
tests/generic/123 +2 -4
index 41b9d3b..911e9d2 100755
@@ -35,10 +35,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 
 _cleanup()
 {
-    cd $testdir
+    cd $TEST_DIR
     rm -rf $my_test_subdir
     cd /
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -51,8 +50,7 @@ _supported_os Linux IRIX
 
 _require_user
 
-_setup_testdir
-my_test_subdir=$testdir/123subdir
+my_test_subdir=$TEST_DIR/123subdir
 
 # create subdir with required permissions
 mkdir -m 755 $my_test_subdir
tests/generic/124 +1 -3
index 92e7619..93ec4a1 100755
@@ -38,7 +38,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
     cd /
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -49,13 +48,12 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs >/dev/null 2>&1
 _scratch_mount
 
 # Run preallo_rw_pattern on both test and scratch partitions
-for TESTFILE in $testdir/rw_pattern.tmp $SCRATCH_MNT/rw_pattern.tmp
+for TESTFILE in $TEST_DIR/rw_pattern.tmp $SCRATCH_MNT/rw_pattern.tmp
   do
   count=1
   while (( count < 101 ))
tests/generic/125 +2 -9
index 18f5cb1..f4ffea5 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1	# failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -46,9 +41,7 @@ _supported_os Linux
 
 _require_user
 
-_setup_testdir
-
-TESTDIR=$testdir/ftrunc
+TESTDIR=$TEST_DIR/ftrunc
 TESTFILE=$TESTDIR/ftrunc.tmp
 
 [ -d $TESTDIR ] && rm -r $TESTDIR
tests/generic/126 +1 -4
index 7fe5bc6..1796527 100755
@@ -34,7 +34,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
     cd /
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -45,11 +44,9 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 
-_setup_testdir
-
 QA_FS_PERMS=$here/src/fs_perms
 
-cd $testdir
+cd $TEST_DIR
 cp $here/src/testx ./testx.file
 
 # file_perm owner_uid owner_gid tester_uid tester_gid perm_to_test expected_result pass=1
tests/generic/127 +7 -10
index 373bf20..58ca91e 100755
@@ -38,7 +38,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
     rm -f $tmp.output
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -51,10 +50,10 @@ FSX_ARGS="-q -l $FSX_FILE_SIZE -o 65536 -S 191110531 -N 100000"
 _fsx_lite_nommap()
 {
     echo "=== FSX Light Mode, No Memory Mapping ==="
-    dd if=/dev/zero of=$testdir/fsx_lite_nommap bs=${FSX_FILE_SIZE} count=1 > /dev/null 2>&1
-    if ! ltp/fsx $FSX_ARGS -L -R -W $testdir/fsx_lite_nommap > $tmp.output 2>&1
+    dd if=/dev/zero of=$TEST_DIR/fsx_lite_nommap bs=${FSX_FILE_SIZE} count=1 > /dev/null 2>&1
+    if ! ltp/fsx $FSX_ARGS -L -R -W $TEST_DIR/fsx_lite_nommap > $tmp.output 2>&1
     then
-        echo "ltp/fsx $FSX_ARGS -L -R -W $testdir/fsx_lite_nommap"
+        echo "ltp/fsx $FSX_ARGS -L -R -W $TEST_DIR/fsx_lite_nommap"
         cat $tmp.output
         return 1
     fi
@@ -65,8 +64,8 @@ _fsx_lite_nommap()
 _fsx_lite_mmap()
 {
     echo "=== FSX Light Mode, Memory Mapping ==="
-    dd if=/dev/zero of=$testdir/fsx_lite_mmap bs=${FSX_FILE_SIZE} count=1 > /dev/null 2>&1
-    if ! ltp/fsx $FSX_ARGS -L $testdir/fsx_lite_mmap > $tmp.output 2>&1
+    dd if=/dev/zero of=$TEST_DIR/fsx_lite_mmap bs=${FSX_FILE_SIZE} count=1 > /dev/null 2>&1
+    if ! ltp/fsx $FSX_ARGS -L $TEST_DIR/fsx_lite_mmap > $tmp.output 2>&1
     then
     	echo "ltp/fsx $FSX_ARGS -L fsx_lite_mmap"
 	cat $tmp.output
@@ -79,7 +78,7 @@ _fsx_lite_mmap()
 _fsx_std_nommap()
 {
     echo "=== FSX Standard Mode, No Memory Mapping ==="
-    if ! ltp/fsx $FSX_ARGS -R -W $testdir/fsx_std_nommap > $tmp.output 2>&1
+    if ! ltp/fsx $FSX_ARGS -R -W $TEST_DIR/fsx_std_nommap > $tmp.output 2>&1
     then
         echo "ltp/fsx $FSX_ARGS -R -W fsx_std_nommap"
         cat $tmp.output
@@ -92,7 +91,7 @@ _fsx_std_nommap()
 _fsx_std_mmap()
 {
     echo "=== FSX Standard Mode, Memory Mapping ==="
-    if ! ltp/fsx $FSX_ARGS $testdir/fsx_std_mmap > $tmp.output 2>&1
+    if ! ltp/fsx $FSX_ARGS $TEST_DIR/fsx_std_mmap > $tmp.output 2>&1
     then
     	echo "ltp/fsx $FSX_ARGS fsx_std_mmap"
 	cat $tmp.output
@@ -106,8 +105,6 @@ _fsx_std_mmap()
 _supported_fs generic
 _supported_os Linux
 
-_setup_testdir
-
 _fsx_lite_nommap
 _fsx_lite_mmap
 
tests/generic/128 +1 -8
index c9c809f..22e4f71 100755
@@ -29,13 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1	# failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    cd /
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -45,7 +39,6 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 
-_setup_testdir
 _require_scratch
 _require_user
 
tests/generic/129 +1 -9
index fe763df..9a10d76 100755
@@ -29,13 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1	# failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    cd /
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -54,8 +48,6 @@ _supported_os Linux
 _require_scratch
 _require_sparse_files
 
-_setup_testdir
-
 _scratch_mkfs >/dev/null 2>&1
 _scratch_mount "-o nosuid"
 
tests/generic/130 +1 -9
index cfc2c32..8367dc7 100755
@@ -38,13 +38,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    cd /
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -57,8 +51,6 @@ _supported_os Linux IRIX
 _require_scratch
 _require_sparse_files
 
-_setup_testdir
-
 _scratch_mkfs >/dev/null 2>&1
 _scratch_mount
 
tests/generic/131 +4 -7
index 6c3131c..ce3e490 100755
@@ -35,7 +35,6 @@ _cleanup()
 {
     kill $locktest_pid2 > /dev/null 2>&1
     kill $locktest_pid1 > /dev/null 2>&1
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -46,9 +45,7 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 
-_setup_testdir
-
-TESTFILE=$testdir/lock_file
+TESTFILE=$TEST_DIR/lock_file
 
 # Grab a port which is hopefully unused
 if [ $$ -gt 1024 -a $$ -lt 32000 ]; then
@@ -60,13 +57,13 @@ elif [ $$ -gt 32000 ]; then
 fi
 
 # Start the server
-src/locktest -p $PORT $TESTFILE 2>&1 > $testdir/server.out &
+src/locktest -p $PORT $TESTFILE 2>&1 > $TEST_DIR/server.out &
 locktest_pid1=$!
 
 sleep 1
 
 # Start the client
-src/locktest -p $PORT -h localhost $TESTFILE 2>&1 > $testdir/client.out
+src/locktest -p $PORT -h localhost $TESTFILE 2>&1 > $TEST_DIR/client.out
 locktest_pid2=$!
 result=$?
 if [ $result -eq 0 ]; then
@@ -74,7 +71,7 @@ if [ $result -eq 0 ]; then
 	status=0
 else
 	echo "Client reported failure ($result)"
-	cat $testdir/*.out
+	cat $TEST_DIR/*.out
 fi
 
 exit
tests/generic/132 +1 -8
index 42ab909..aa52c7d 100755
@@ -30,13 +30,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    cd /
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -46,7 +40,6 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux IRIX
 
-_setup_testdir
 _require_scratch
 
 _scratch_mkfs >/dev/null 2>&1
tests/generic/133 +17 -24
index 65ab822..7fb1695 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -44,35 +39,33 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux IRIX
 
-_setup_testdir
-
 echo "Buffered writer, buffered reader"
-$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $testdir/io_test > /dev/null
-$XFS_IO_PROG -f -c 'pwrite -b 64k 0 512m' $testdir/io_test >/dev/null &
-$XFS_IO_PROG -c 'pread -b 64k 0 512m' $testdir/io_test > /dev/null
+$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $TEST_DIR/io_test > /dev/null
+$XFS_IO_PROG -f -c 'pwrite -b 64k 0 512m' $TEST_DIR/io_test >/dev/null &
+$XFS_IO_PROG -c 'pread -b 64k 0 512m' $TEST_DIR/io_test > /dev/null
 wait
-rm $testdir/io_test
+rm $TEST_DIR/io_test
 
 echo "Direct writer, buffered reader"
-$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $testdir/io_test > /dev/null
-$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $testdir/io_test >/dev/null &
-$XFS_IO_PROG -c 'pread -b 64k 0 512m' $testdir/io_test > /dev/null
+$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $TEST_DIR/io_test > /dev/null
+$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $TEST_DIR/io_test >/dev/null &
+$XFS_IO_PROG -c 'pread -b 64k 0 512m' $TEST_DIR/io_test > /dev/null
 wait
-rm $testdir/io_test
+rm $TEST_DIR/io_test
 
 echo "Buffered writer, direct reader"
-$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $testdir/io_test > /dev/null
-$XFS_IO_PROG -f -c 'pwrite -b 64k 0 512m' $testdir/io_test >/dev/null &
-$XFS_IO_PROG -d -c 'pread -b 64k 0 512m' $testdir/io_test > /dev/null
+$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $TEST_DIR/io_test > /dev/null
+$XFS_IO_PROG -f -c 'pwrite -b 64k 0 512m' $TEST_DIR/io_test >/dev/null &
+$XFS_IO_PROG -d -c 'pread -b 64k 0 512m' $TEST_DIR/io_test > /dev/null
 wait
-rm $testdir/io_test
+rm $TEST_DIR/io_test
 
 echo "Direct writer, direct reader"
-$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $testdir/io_test > /dev/null
-$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $testdir/io_test >/dev/null &
-$XFS_IO_PROG -d -c 'pread -b 64k 0 512m' $testdir/io_test > /dev/null
+$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $TEST_DIR/io_test > /dev/null
+$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $TEST_DIR/io_test >/dev/null &
+$XFS_IO_PROG -d -c 'pread -b 64k 0 512m' $TEST_DIR/io_test > /dev/null
 wait
-rm $testdir/io_test
+rm $TEST_DIR/io_test
 
 status=0
 exit 
tests/generic/135 +1 -8
index 783a106..e3b827a 100755
@@ -29,13 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    cd /
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -45,7 +39,6 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux IRIX
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs >/dev/null 2>&1
 
tests/generic/141 +1 -7
index 83b5486..fa08484 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -44,7 +39,6 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs >/dev/null 2>&1
 _scratch_mount
tests/generic/184 +4 -7
index 5d74fa3..dcc8b4e 100755
@@ -35,7 +35,6 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -46,12 +45,10 @@ _cleanup()
 _supported_fs generic
 _supported_os IRIX Linux
 
-_setup_testdir
-
-rm -f $testdir/null
-mknod $testdir/null c 1 3
-chmod 666 $testdir/null
-echo fred > $testdir/null
+rm -f $TEST_DIR/null
+mknod $TEST_DIR/null c 1 3
+chmod 666 $TEST_DIR/null
+echo fred > $TEST_DIR/null
 
 status=$?
 exit
tests/generic/225 +0 -1
index faa542a..73b125a 100755
@@ -34,7 +34,6 @@ _cleanup()
 {
 	cd /
 	rm -f $tmp.*
-	_cleanup_testdir
 }
 
 # get standard environment, filters and checks
tests/generic/237 +2 -5
index e5c5a79..6a61ec8 100755
@@ -42,8 +42,7 @@ _cleanup()
 {
 	cd /
 	rm -f $tmp.*
-	[ -n "$testdir" ] && rm -rf $testdir/$seq.dir1
-	_cleanup_testdir
+	[ -n "$TEST_DIR" ] && rm -rf $TEST_DIR/$seq.dir1
 }
 
 # real QA test starts here
@@ -55,14 +54,12 @@ _supported_os Linux
 
 rm -f $seqres.full
 
-_setup_testdir
-
 _need_to_be_root
 _acl_setup_ids
 _require_acls
 
 # get dir
-cd $testdir
+cd $TEST_DIR
 rm -rf $seq.dir1
 mkdir $seq.dir1
 cd $seq.dir1
tests/generic/249 +0 -2
index 1f25edb..306e820 100755
@@ -35,7 +35,6 @@ _cleanup()
 	cd /
 	rm -f $tmp.*
 	rm -f $SRC $DST
-	_cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -45,7 +44,6 @@ _cleanup()
 # real QA test starts here
 _supported_fs generic
 _supported_os Linux
-_setup_testdir
 
 echo "Feel the serenity."
 
tests/shared/051 +2 -5
index 07399cc..e957f86 100755
@@ -40,8 +40,7 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    [ -n "$testdir" ] && rm -rf $testdir/$seq.dir1
-    _cleanup_testdir
+    [ -n "$TEST_DIR" ] && rm -rf $TEST_DIR/$seq.dir1
 }
 
 # -----
@@ -76,14 +75,12 @@ _supported_os Linux
 
 rm -f $seqres.full
 
-_setup_testdir
-
 _need_to_be_root
 _acl_setup_ids
 _require_acls
 
 # get dir
-cd $testdir
+cd $TEST_DIR
 rm -rf $seq.dir1
 mkdir $seq.dir1
 cd $seq.dir1
tests/shared/218 +0 -2
index f21b8b2..cd2076e 100755
@@ -34,7 +34,6 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -46,7 +45,6 @@ _cleanup()
 _supported_fs xfs ext4 btrfs
 _supported_os Linux
 
-_setup_testdir
 # We require scratch so that we'll have free contiguous space
 _require_scratch
 _scratch_mkfs >/dev/null 2>&1
tests/udf/098 +0 -2
index 91e8a22..3a5db39 100755
@@ -81,8 +81,6 @@ _supported_os IRIX
 _require_scratch
 _require_attrs
 
-_setup_testdir
-
 cd $SCRATCH_MNT
 
 echo "create file foo"
tests/udf/102 +0 -1
index e27c086..8fd4697 100755
@@ -36,7 +36,6 @@ _cleanup()
 {
     rm -f $tmp.*
     cd /
-    _cleanup_testdir
 }
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/008 +2 -5
index e7a1768..56be923 100755
@@ -35,8 +35,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
     rm -f $tmp.*
-    rm -rf $testdir/randholes.$$.*
-    _cleanup_testdir
+    rm -rf $TEST_DIR/randholes.$$.*
 }
 
 _filter()
@@ -55,7 +54,7 @@ _do_test()
     _holes="$2"
     _param="$3"
 
-    out=$testdir/randholes.$$.$_n
+    out=$TEST_DIR/randholes.$$.$_n
     echo ""
     echo "randholes.$_n : $_param" | _filter
     echo "------------------------------------------"
@@ -89,8 +88,6 @@ _do_test()
 _supported_fs xfs
 _supported_os IRIX Linux
 
-_setup_testdir
-
 rm -f $seqres.full
 
 # Note on special numbers here.
tests/xfs/012 +2 -5
index cd9c485..4127222 100755
@@ -35,8 +35,7 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    rm -rf $testdir/holes.$$.*
-    _cleanup_testdir
+    rm -rf $TEST_DIR/holes.$$.*
 }
 
 _filesize()
@@ -56,7 +55,7 @@ _do_test()
 
     failed=0
 
-    out=$testdir/holes.$$.$_n
+    out=$TEST_DIR/holes.$$.$_n
     echo ""
     echo "holes.$_n : $_param"
     echo "-----------------------------------------------"
@@ -106,8 +105,6 @@ _do_test()
 _supported_fs xfs
 _supported_os IRIX Linux
 
-_setup_testdir
-
 rm -f $seqres.full
 
 # small & fairly dense
tests/xfs/048 +1 -4
index 40667e0..f9fb16f 100755
@@ -39,16 +39,13 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    _cleanup_testdir
 }
 
 # real QA test starts here
 _supported_fs xfs
 _supported_os IRIX Linux
 
-_setup_testdir
-
-src/fault $testdir || exit
+src/fault $TEST_DIR || exit
 
 # success, all done
 status=0
tests/xfs/066 +2 -5
index 6d4e1c2..d521ada 100755
@@ -40,22 +40,19 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    _cleanup_testdir
 }
 
 # real QA test starts here
 _supported_fs xfs
 _supported_os IRIX Linux
 
-_setup_testdir
-
 _my_stat_filter()
 {
     grep "[sS]ize" | sed "s/.*[sS]ize[: ]*\([[:digit:]]*\).*/\1 largefile/g"
 }
 
-rm -f $testdir/testfile
-if src/feature -t $testdir/testfile; then
+rm -f $TEST_DIR/testfile
+if src/feature -t $TEST_DIR/testfile; then
 	:
 else
 	_notrun "Installed libc doesn't correctly handle setrlimit/ftruncate64"
tests/xfs/078 +0 -1
index f2b674a..e04c6cc 100755
@@ -38,7 +38,6 @@ _cleanup()
     rm -f $tmp.*
     umount -d $LOOP_MNT 2>/dev/null
     rmdir $LOOP_MNT
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
tests/xfs/080 +1 -4
index b1cd0cb..59c6104 100755
@@ -39,7 +39,6 @@ _cleanup()
 { 
     cd /
     rm -f $tmp.*
-   _cleanup_testdir
 }
 
 _supported_fs xfs
@@ -48,13 +47,11 @@ _supported_fs xfs
 # but not at the moment.
 _supported_os Linux
 
-_setup_testdir
-
 quiet=-q
 clean=-c
 
 export here
-cd $testdir
+cd $TEST_DIR
 echo
 
 # real QA test starts here
tests/xfs/137 +1 -7
index 90dc1f5..79b3b89 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -44,7 +39,6 @@ _cleanup()
 _supported_fs xfs
 _supported_os Linux IRIX
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
tests/xfs/138 +1 -7
index d3c1009..1b11cf6 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -44,7 +39,6 @@ _cleanup()
 _supported_fs xfs
 _supported_os Linux IRIX
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
tests/xfs/139 +1 -7
index 1fbde58..e5296f7 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -44,7 +39,6 @@ _cleanup()
 _supported_fs xfs
 _supported_os Linux IRIX
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
tests/xfs/140 +1 -7
index ce52272..cccf262 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -44,7 +39,6 @@ _cleanup()
 _supported_fs xfs
 _supported_os Linux IRIX
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
tests/xfs/142 +1 -6
index 5a2ef9e..a1efcc2 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/143 +1 -6
index c86cc0a..c389a2b 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/144 +1 -6
index 0b5b21d..41041c4 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/145 +1 -6
index c8444f0..44b3e4e 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/146 +1 -6
index 1e13d95..c6343f8 100755
@@ -30,12 +30,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 _report_filter () {
     $PERL_PROG -ne "s/Report: \"0x[0-f]+\" was written and \"0x[0-f]+\" was read at/Report: \"HEX\" was written and \"HEX\" was read at/g ;
tests/xfs/147 +1 -6
index c22f24a..73ff7f9 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/150 +1 -6
index 3bf1c8b..f9e690a 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 _filter_fs_handle()
 {
tests/xfs/151 +1 -6
index d2e21f3..bba7094 100755
@@ -31,12 +31,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 _dm_create_session()
 {
tests/xfs/152 +1 -6
index 310f0dc..72bdabf 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 _filter_handles()
 {
tests/xfs/153 +1 -6
index 7b9a316..cac7722 100755
@@ -30,12 +30,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/154 +1 -6
index c281b37..810a6ac 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/155 +1 -6
index 23316f2..1a1631e 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/156 +1 -6
index 88b8cbf..d6e22b6 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/157 +1 -6
index a1243dc..bf65590 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/158 +1 -6
index 5c4dfcd..596f4c2 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/159 +1 -6
index 8d15162..fc5193f 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/160 +1 -6
index 44e9f2f..9a2e2d0 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/161 +1 -6
index 74d6dbe..11e53de 100755
@@ -30,12 +30,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 _filter_get_allocinfo()
 {
tests/xfs/162 +1 -6
index 64d001c..4edb68f 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/163 +1 -6
index 3a2d3b9..e283545 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 _filter_paths()
 {
tests/xfs/166 +1 -7
index 02b3237..2a96f8a 100755
@@ -29,14 +29,9 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
+trap "exit \$status" 0 1 2 3 15
 rm -f $seqres.full
 
-_cleanup()
-{
-    _cleanup_testdir
-}
-
 # get standard environment, filters and checks
 . ./common/rc
 . ./common/filter
@@ -80,7 +75,6 @@ _filter_blocks()
 _supported_fs xfs
 _supported_os Linux
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
tests/xfs/167 +0 -2
index d75de23..ab0156f 100755
@@ -36,7 +36,6 @@ _cleanup()
 {
 	$KILLALL_PROG -r -q -TERM fsstress 2> /dev/null
 	sync	# ensures all fsstress processes died
-	_cleanup_testdir
 }
 
 workout()
@@ -59,7 +58,6 @@ _supported_os Linux
 
 [ -n "$KILLALL_PROG" ] || _notrun "killall executable not found"
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
tests/xfs/168 +1 -6
index 901125a..6fc4540 100755
@@ -31,12 +31,7 @@ here=`pwd`
 tmp=/tmp/$$
 rm -f $seqres.full
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 _filter_dmapi_print_event() {
     $PERL_PROG -ne '
tests/xfs/179 +1 -7
index 6402eda..ce50d99 100755
@@ -30,12 +30,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -45,7 +40,6 @@ _cleanup()
 _supported_fs xfs
 _supported_os Linux IRIX
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
tests/xfs/180 +1 -7
index 404f352..a0fb69a 100755
@@ -30,12 +30,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -45,7 +40,6 @@ _cleanup()
 _supported_fs xfs
 _supported_os Linux IRIX
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
tests/xfs/182 +1 -7
index f55e018..b75e4fc 100755
@@ -30,12 +30,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
@@ -45,7 +40,6 @@ _cleanup()
 _supported_fs xfs
 _supported_os Linux IRIX
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
tests/xfs/185 +1 -6
index 6de0ca9..17334de 100755
@@ -29,12 +29,7 @@ echo "QA output created by $seq"
 here=`pwd`
 tmp=/tmp/$$
 status=1    # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    _cleanup_testdir
-}
+trap "exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
tests/xfs/216 +0 -2
index a21df9d..8513479 100755
@@ -34,7 +34,6 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -45,7 +44,6 @@ _cleanup()
 _supported_fs xfs
 _supported_os Linux
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
tests/xfs/217 +0 -2
index 25a6c01..6c439c0 100755
@@ -34,7 +34,6 @@ _cleanup()
 {
     cd /
     rm -f $tmp.*
-    _cleanup_testdir
 }
 
 # get standard environment, filters and checks
@@ -45,7 +44,6 @@ _cleanup()
 _supported_fs xfs
 _supported_os Linux
 
-_setup_testdir
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
tests/xfs/250 +0 -1
index b9953f7..3b67c3f 100755
@@ -36,7 +36,6 @@ _cleanup()
 	umount -d $LOOP_MNT 2>/dev/null
 	rm -f $LOOP_DEV
 	rmdir $LOOP_MNT
-	_cleanup_testdir
 }
 
 # get standard environment, filters and checks
Quoted 5 lines

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#10 lore raw
Quoted 4 lines · Christoph Hellwig
Quoted 1 line · Christoph Hellwig

ping?

ping^2?

I just got write access to the XFS git repos on oss.sgi.com, so I'll start hoovering up all the outstanding xfstests patches as a shakedown pass before I touch anything else...

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#11 lore raw
Quoted 9 lines · Dave Chinner
Quoted 4 lines · Christoph Hellwig
Quoted 1 line · Christoph Hellwig

ping?

ping^2?

I just got write access to the XFS git repos on oss.sgi.com, so I'll start hoovering up all the outstanding xfstests patches as a shakedown pass before I touch anything else...

You might want to chat with Rich. There may be some already in progress.

-Ben

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#12 lore raw
Quoted 5 lines · Ben Myers
Quoted 4 lines · Dave Chinner
Quoted 3 lines · Christoph Hellwig
Quoted 1 line · Christoph Hellwig

ping?

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

ping^2?

I just got write access to the XFS git repos on oss.sgi.com, so I'll start hoovering up all the outstanding xfstests patches as a shakedown pass before I touch anything else...

You might want to chat with Rich. There may be some already in progress.

I've already pushed the ones I found last week on the list.

FYI, I've been waiting for repo write perms to be able to push them since wednesday last week. Rich hasn't said anything on the mailing list or on IRC in that time, so I can only conclude that he's off doing something else.

Handling xfstests patches in a manner necessary for upstream commit is something I've already integrated into my day-to-day workflow. As such, I'm able to push reviewed patches at almost any time (within reason - next day is best for everyone) at almost zero cost to me. That cost will go down as I script and optimise my workflow.

If other developers don't want me to do this, let them speak up.

However, as a maintainer, I'm not happy with leaving reviewed patches on the list for weeks before commiting them. As a developer, there is nothing more frsutrating that having to continually remind the maintainer that they need to commit a patch.

Hence if a developer sends a ping to remind the maintainers about a reviewed patch that has been sitting around, then I'm going to do something about it straight away...

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#13 lore raw
Quoted 8 lines · Dave Chinner
Quoted 7 lines · Ben Myers
Quoted 6 lines · Dave Chinner
Quoted 4 lines · Christoph Hellwig
Quoted 1 line · Christoph Hellwig

ping?

ping^2?

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

I just got write access to the XFS git repos on oss.sgi.com, so I'll start hoovering up all the outstanding xfstests patches as a shakedown pass before I touch anything else...

You might want to chat with Rich. There may be some already in progress.

I've already pushed the ones I found last week on the list.

Thanks for doing this.

Quoted 13 lines

FYI, I've been waiting for repo write perms to be able to push them since wednesday last week. Rich hasn't said anything on the mailing list or on IRC in that time, so I can only conclude that he's off doing something else.

Handling xfstests patches in a manner necessary for upstream commit is something I've already integrated into my day-to-day workflow. As such, I'm able to push reviewed patches at almost any time (within reason - next day is best for everyone) at almost zero cost to me. That cost will go down as I script and optimise my workflow.

If other developers don't want me to do this, let them speak up.

Quoted 8 lines

However, as a maintainer, I'm not happy with leaving reviewed patches on the list for weeks before commiting them. As a developer, there is nothing more frsutrating that having to continually remind the maintainer that they need to commit a patch.

Hence if a developer sends a ping to remind the maintainers about a reviewed patch that has been sitting around, then I'm going to do something about it straight away...

My apologies to Christoph. I missed that I thought he was waiting for a review, not a commit from me.

Quoted 5 lines

Cheers,

Dave.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#14 lore raw
Quoted 7 lines · Rich Johnston
Quoted 4 lines · Dave Chinner

On Mon, Dec 02, 2013 at 05:36:30PM -0600, Ben Myers wrote:
Hence if a developer sends a ping to remind the maintainers about a reviewed patch that has been sitting around, then I'm going to do something about it straight away...

My apologies to Christoph. I missed that I thought he was waiting for a review, not a commit from me.

One of the roles of a maintainer is to review code when nobody else steps up to do it. So rather than wait for someone else to review the code, you should do it yourself, wait 24-48 for any responses once you give it a Reviewed-by tag, and then you can commit it.

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#15 lore raw
In reply to Christoph Hellwig
Quoted 28 lines · Christoph Hellwig

For historical reasons beyond my knowledge xfstests tries to abuse the scratch device as test device for nfs and udf. Because not all test have inherited the right usage of the _setup_testdir and _cleanup_testdir helpers this leads to lots of unessecary test failures.

Remove the special casing, which gets nfs down to a minimal number of failures.

common/rc +1 -5
index ea3af12..c64933a 100644
@@ -975,11 +975,7 @@ _require_scratch()
  {
      case "$FSTYP" in
  	nfs*)
-		 echo $SCRATCH_DEV | grep -q ":" > /dev/null 2>&1
-		 if [ -z "$SCRATCH_DEV" -o "$?" != "0" ]
-		 then
-		     _notrun "this test requires a valid \$SCRATCH_DEV"
-		 fi
+                 _notrun "requires a scratch device"
  		 ;;
  	*)
  		 if [ -z "$SCRATCH_DEV" -o "`_is_block_dev $SCRATCH_DEV`" = "" ]

common/rc _full_platform_details() · line 1770

Quoted 2 lines
common/rc +0 -0
@@ -1773,100 +1769,6 @@ _full_platform_details()
       echo "$os/$platform $host $kernel"
  }

Hi!

Sorry for my post-commit "review".

But for what purposes did you delete this scratch device handling for nfs? Now each test case that uses _require_scratch returns [not run].

It means most of the generic/ test cases.

I think we should revert this part of code. How do you think?

Thanks.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#16 lore raw
Quoted 8 lines · Stanislav Kholmanskikh

Sorry for my post-commit "review".

But for what purposes did you delete this scratch device handling for nfs? Now each test case that uses _require_scratch returns [not run].

It means most of the generic/ test cases.

I think we should revert this part of code. How do you think?

Tests really requiring a scratch device don't make sense for XFS, as the scratch device is supposed to get recreated for every test.

However it seems like a lot of tests should simply run on the test device. I'll take care of moving them over to use the test device.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs