From: Zheng Liu Date: Tue, 14 May 2013 13:35:44 +0000 (-0500) Subject: xfstests: remove fio config files after finished test X-Git-Tag: v2022.05.01~3433 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=05aab5cf04e791eb5e85c00722a721909f6c0ae0;p=xfstests-dev.git xfstests: remove fio config files after finished test 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 Acked-by: Dave Chinner Reviewed-by: Rich Johnston Signed-off-by: Rich Johnston --- diff --git a/tests/ext4/301 b/tests/ext4/301 index e1583d49..0ca3622f 100755 --- a/tests/ext4/301 +++ b/tests/ext4/301 @@ -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 <$fio_config <> $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 diff --git a/tests/ext4/302 b/tests/ext4/302 index abca8058..497f4c62 100755 --- a/tests/ext4/302 +++ b/tests/ext4/302 @@ -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 <$fio_config <> $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 diff --git a/tests/ext4/303 b/tests/ext4/303 index 70515766..93354e5f 100755 --- a/tests/ext4/303 +++ b/tests/ext4/303 @@ -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 <$fio_config <> $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 diff --git a/tests/ext4/304 b/tests/ext4/304 index 5d15ecb2..74e601a8 100755 --- a/tests/ext4/304 +++ b/tests/ext4/304 @@ -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 <$fio_config <> $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 diff --git a/tests/generic/299 b/tests/generic/299 index 5f3edc40..14cce967 100644 --- a/tests/generic/299 +++ b/tests/generic/299 @@ -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 <$fio_config <> $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" diff --git a/tests/generic/300 b/tests/generic/300 index 687e62dd..7c607281 100644 --- a/tests/generic/300 +++ b/tests/generic/300 @@ -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 <$fio_config <> $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 diff --git a/tests/shared/305 b/tests/shared/305 index 91cbf036..8e8b0cb7 100644 --- a/tests/shared/305 +++ b/tests/shared/305 @@ -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 <$fio_config < /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