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 seqres=$RESULT_DIR/$seq
27 echo "QA output created by $seq"
32 status=1 # failure is the default!
33 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
35 # get standard environment, filters and checks
40 # real QA test starts here
46 NUM_JOBS=$((4*LOAD_FACTOR))
47 BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
48 # We need space for 2 files (test file, and donor one)
49 # reserve 30% in order to avoid ENOSPC
50 FILE_SIZE=$((BLK_DEV_SIZE * (512 / (2 + 1))))
52 cat >$fio_config <<EOF
53 # Common e4defrag regression tests
57 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 $fio_config >> $seqres.full
105 run_check $FIO_PROG $fio_config
108 _require_fio $fio_config
110 _scratch_mkfs >> $seqres.full 2>&1
114 _scratch_unmount 2>/dev/null
118 if ! _scratch_unmount; then
119 echo "failed to umount"