4 # Ext4 defragmentation stress test
5 # Defragment file while other task does direct io
6 #-----------------------------------------------------------------------
7 # (c) 2013 Dmitry Monakhov
9 # This program is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License as
11 # published by the Free Software Foundation.
13 # This program is distributed in the hope that it would be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write the Free Software Foundation,
20 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #-----------------------------------------------------------------------
26 echo "QA output created by $seq"
30 status=1 # failure is the default!
31 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
33 # get standard environment, filters and checks
38 # real QA test starts here
45 NUM_JOBS=$((4*LOAD_FACTOR))
46 BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
47 # We need space for 2 files (test file, and donor one)
48 # reserve 30% in order to avoid ENOSPC
49 FILE_SIZE=$((BLK_DEV_SIZE * (512 / (2 + 1))))
51 cat >$tmp-$seq.fio <<EOF
52 # Common e4defrag regression tests
56 directory=${SCRATCH_MNT}
63 #################################
65 # Defragment file while other task does direct io
67 # Continious sequential defrag activity
77 runtime=30*${TIME_FACTOR}
83 iodepth=128*${LOAD_FACTOR}
95 runtime=30*${TIME_FACTOR}
102 echo " Start defragment activity"
104 cat $tmp-$seq.fio >> $seq.full
105 run_check $FIO_PROG $tmp-$seq.fio
108 _require_fio $tmp-$seq.fio
110 _scratch_mkfs >> $seq.full 2>&1
114 umount $SCRATCH_DEV 2>/dev/null
118 if ! _scratch_unmount; then
119 echo "failed to umount"