xfstests: remove fio config files after finished test
authorZheng Liu <wenqing.lz@taobao.com>
Tue, 14 May 2013 13:35:44 +0000 (08:35 -0500)
committerRich Johnston <rjohnston@sgi.com>
Tue, 14 May 2013 13:35:44 +0000 (08:35 -0500)
After finished test, temporarily fio config file should be removed.
This commit tries to fix this problem in the following test cases:
  - generic/299-300
  - ext4/301-304
  - shared/305

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Acked-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
tests/ext4/301
tests/ext4/302
tests/ext4/303
tests/ext4/304
tests/generic/299
tests/generic/300
tests/shared/305

index e1583d4956fb13510641b7a820e186a304b59dec..0ca3622f7a0db6beea146b224fe87c8498b903f6 100755 (executable)
@@ -28,6 +28,7 @@ echo "QA output created by $seq"
 
 here=`pwd`
 tmp=/tmp/$$
+fio_config=$tmp.fio
 status=1       # failure is the default!
 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
 
@@ -49,7 +50,7 @@ BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
 # reserve 30% in order to avoid ENOSPC
 FILE_SIZE=$((BLK_DEV_SIZE * (512 / (2 + 1))))
 
-cat >$tmp-$seq.fio <<EOF
+cat >$fio_config <<EOF
 # Common e4defrag regression tests
 [global]
 ioengine=ioe_e4defrag
@@ -101,11 +102,11 @@ _workout()
        echo ""
        echo " Start defragment activity"
        echo ""
-       cat $tmp-$seq.fio >>  $seqres.full
-       run_check $FIO_PROG $tmp-$seq.fio
+       cat $fio_config >>  $seqres.full
+       run_check $FIO_PROG $fio_config
 }
 
-_require_fio $tmp-$seq.fio
+_require_fio $fio_config
 
 _scratch_mkfs  >> $seqres.full 2>&1
 _scratch_mount
index abca8058a870bc570306d1f87ed1d5a8438ee4c0..497f4c6264bcdcf461bd43bba4c7f37ea834a284 100755 (executable)
@@ -29,6 +29,7 @@ echo "QA output created by $seq"
 
 here=`pwd`
 tmp=/tmp/$$
+fio_config=$tmp.fio
 status=1       # failure is the default!
 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
 
@@ -49,7 +50,7 @@ BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
 # reserve 30% in order to avoid ENOSPC
 FILE_SIZE=$((BLK_DEV_SIZE * (512 / (2 + 1))))
 
-cat >$tmp-$seq.fio <<EOF
+cat >$fio_config <<EOF
 # Common e4defrag regression tests
 [global]
 ioengine=ioe_e4defrag
@@ -117,11 +118,11 @@ _workout()
        echo ""
        echo " Start defragment activity"
        echo ""
-       cat $tmp-$seq.fio >>  $seqres.full
-       run_check $FIO_PROG $tmp-$seq.fio
+       cat $fio_config >>  $seqres.full
+       run_check $FIO_PROG $fio_config
 }
 
-_require_fio $tmp-$seq.fio
+_require_fio $fio_config
 
 _scratch_mkfs  >> $seqres.full 2>&1
 _scratch_mount
index 70515766acfe3e652ca591859e3a753905760f93..93354e5f983d114ec06430c91312352851670515 100755 (executable)
@@ -29,6 +29,7 @@ echo "QA output created by $seq"
 
 here=`pwd`
 tmp=/tmp/$$
+fio_config=$tmp.fio
 status=1       # failure is the default!
 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
 
@@ -49,7 +50,7 @@ BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
 # Reserve space for 4 files in order to avoid ENOSPC
 FILE_SIZE=$((BLK_DEV_SIZE * (512 / (3+1))))
 
-cat >$tmp-$seq.fio <<EOF
+cat >$fio_config <<EOF
 # Common e4defrag regression tests
 [global]
 ioengine=ioe_e4defrag
@@ -127,11 +128,11 @@ _workout()
        echo ""
        echo " Start defragment activity"
        echo ""
-       cat $tmp-$seq.fio >>  $seqres.full
-       run_check $FIO_PROG $tmp-$seq.fio
+       cat $fio_config >>  $seqres.full
+       run_check $FIO_PROG $fio_config
 }
 
-_require_fio $tmp-$seq.fio
+_require_fio $fio_config
 
 _scratch_mkfs  >> $seqres.full 2>&1
 _scratch_mount
index 5d15ecb2d2e8574e86f1161516432b328bb918c7..74e601a89375ac929b778705b56bfe04e05f6ff4 100755 (executable)
@@ -30,6 +30,7 @@ echo "QA output created by $seq"
 
 here=`pwd`
 tmp=/tmp/$$
+fio_config=$tmp.fio
 status=1       # failure is the default!
 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
 
@@ -50,7 +51,7 @@ BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
 # reserve 30% in order to avoid ENOSPC
 FILE_SIZE=$((BLK_DEV_SIZE * (512 / (2 + 1))))
 
-cat >$tmp-$seq.fio <<EOF
+cat >$fio_config <<EOF
 # Common e4defrag regression tests
 [global]
 ioengine=ioe_e4defrag
@@ -104,11 +105,11 @@ _workout()
        echo ""
        echo " Start defragment activity"
        echo ""
-       cat $tmp-$seq.fio >>  $seqres.full
-       run_check $FIO_PROG $tmp-$seq.fio
+       cat $fio_config >>  $seqres.full
+       run_check $FIO_PROG $fio_config
 }
 
-_require_fio $tmp-$seq.fio
+_require_fio $fio_config
 
 _scratch_mkfs  >> $seqres.full 2>&1
 _scratch_mount
index 5f3edc4055117863080bdaaf729c371b1ab656bd..14cce967bb9e1f5aed31e0ee83de0e6764f5cad5 100644 (file)
@@ -30,6 +30,7 @@ echo "QA output created by $seq"
 
 here=`pwd`
 tmp=/tmp/$$
+fio_config=$tmp.fio
 status=1       # failure is the default!
 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
 
@@ -47,7 +48,7 @@ NUM_JOBS=$((4*LOAD_FACTOR))
 BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
 FILE_SIZE=$((BLK_DEV_SIZE * 512))
 
-cat >$tmp-$seq.fio <<EOF
+cat >$fio_config <<EOF
 ###########
 # $seq test fio activity
 # Filenames derived from jobsname and jobid like follows:
@@ -108,15 +109,15 @@ rw=randrw
 filename=buffered-aio-verifier
 EOF
 
-_require_fio $tmp-$seq.fio
+_require_fio $fio_config
 
 _workout()
 {
        echo ""
        echo "Run fio with random aio-dio pattern"
        echo ""
-       cat $tmp-$seq.fio >>  $seqres.full
-       run_check $FIO_PROG $tmp-$seq.fio &
+       cat $fio_config >>  $seqres.full
+       run_check $FIO_PROG $fio_config &
        pid=$!
        echo "Start fallocate/truncate loop"
 
index 687e62ddeed36512753643590b9d916cc3e38f32..7c6072815b40a84967bdea95ea33116b5d34dac6 100644 (file)
@@ -30,6 +30,7 @@ echo "QA output created by $seq"
 
 here=`pwd`
 tmp=/tmp/$$
+fio_config=$tmp.fio
 status=1       # failure is the default!
 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
 
@@ -51,7 +52,7 @@ then
 fi
 FS_SIZE=$((BLK_DEV_SIZE * 512))
 
-cat >$tmp-$seq.fio <<EOF
+cat >$fio_config <<EOF
 ###########
 # $seq test fio activity
 # Run DIO, fallocate and punch_hole threads on a single in parallel
@@ -128,11 +129,11 @@ _workout()
        echo ""
        echo "Run fio with random aio-dio pattern"
        echo ""
-       cat $tmp-$seq.fio >>  $seqres.full
-       run_check $FIO_PROG $tmp-$seq.fio
+       cat $fio_config >>  $seqres.full
+       run_check $FIO_PROG $fio_config
 }
 
-_require_fio $tmp-$seq.fio
+_require_fio $fio_config
 
 _scratch_mkfs_sized $FS_SIZE >> $seqres.full 2>&1
 _scratch_mount
index 91cbf03645e8cc5b55810df11dd9e8de2abe1505..8e8b0cb747d0dfdc625b30354581deae332f7ff0 100644 (file)
@@ -29,6 +29,7 @@ echo "QA output created by $seq"
 
 here=`pwd`
 tmp=/tmp/$$
+fio_config=$tmp.fio
 status=1       # failure is the default!
 
 # get standard environment, filters and checks
@@ -79,6 +80,7 @@ _cleanup()
 {
     poweron_scratch_dev
     disallow_fail_make_request
+    rm -f $tmp.*
 }
 trap "_cleanup; exit \$status" 1 2 3 15
 
@@ -87,7 +89,7 @@ NUM_JOBS=$((4*LOAD_FACTOR))
 BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
 FILE_SIZE=$((BLK_DEV_SIZE * 512))
 
-cat >$tmp-$seq.fio <<EOF
+cat >$fio_config <<EOF
 ###########
 # $seq test's fio activity
 # Filenames derived from jobsname and jobid like follows:
@@ -127,7 +129,7 @@ time_based
 
 EOF
 
-_require_fio $tmp-$seq.fio
+_require_fio $fio_config
 
 # Disable all sync operations to get higher load
 FSSTRESS_AVOID="$FSSTRESS_AVOID -ffsync=0 -fsync=0 -ffdatasync=0 -f setattr=1"
@@ -143,8 +145,8 @@ _workout()
        $FSSTRESS_PROG $args > /dev/null 2>&1 &
        fs_pid=$!
        echo "Start fio.."
-       cat $tmp-$seq.fio >>  $seqres.full
-       $FIO_PROG $tmp-$seq.fio >> $seqres.full 2>&1 &
+       cat $fio_config >>  $seqres.full
+       $FIO_PROG $fio_config >> $seqres.full 2>&1 &
        fio_pid=$!
 
        # Let's it work for awhile, and force device failure