4 # Ext4 defragmentation stress test
5 # Perform defragmentation on file under buffered io
6 # while third task does direct io to donor file
7 #-----------------------------------------------------------------------
8 # (c) 2013 Dmitry Monakhov
10 # This program is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU General Public License as
12 # published by the Free Software Foundation.
14 # This program is distributed in the hope that it would be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write the Free Software Foundation,
21 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 #-----------------------------------------------------------------------
27 seqres=$RESULT_DIR/$seq
28 seqres=$RESULT_DIR/$seq
29 seqres=$RESULT_DIR/$seq
30 echo "QA output created by $seq"
34 status=1 # failure is the default!
35 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
37 # get standard environment, filters and checks
42 # real QA test starts here
49 BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
50 # We need space for 2 files (test file, and donor one)
51 # reserve 30% in order to avoid ENOSPC
52 FILE_SIZE=$((BLK_DEV_SIZE * (512 / (2 + 1))))
54 cat >$tmp-$seq.fio <<EOF
55 # Common e4defrag regression tests
59 directory=${SCRATCH_MNT}
66 ##########################################
68 # Perform defragmentation on file under buffered io
69 # while third task does direct io to donor file
71 # Continuous sequential defrag activity
81 numjobs=${LOAD_FACTOR}
82 runtime=30*${TIME_FACTOR}
85 # Run DIO/AIO for donor file
88 iodepth=128*${LOAD_FACTOR}
89 numjobs=${LOAD_FACTOR}
95 runtime=30*${TIME_FACTOR}
101 iodepth=128*${LOAD_FACTOR}
113 runtime=30*${TIME_FACTOR}
121 echo " Start defragment activity"
123 cat $tmp-$seq.fio >> $seqres.full
124 run_check $FIO_PROG $tmp-$seq.fio
127 _require_fio $tmp-$seq.fio
129 _scratch_mkfs >> $seqres.full 2>&1
133 umount $SCRATCH_DEV 2>/dev/null
137 if ! _scratch_unmount; then
138 echo "failed to umount"