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 #-----------------------------------------------------------------------
25 owner=dmonakhov@openvz.org
28 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
47 NUM_JOBS=$((4*LOAD_FACTOR))
48 BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
49 # We need space for 2 files (test file, and donor one)
50 # reserve 30% in order to avoid ENOSPC
51 FILE_SIZE=$((BLK_DEV_SIZE * (512 / (2 + 1))))
53 cat >$tmp-$seq.fio <<EOF
54 # Common e4defrag regression tests
58 directory=${SCRATCH_MNT}
65 #################################
67 # Defragment file while other task does direct io
69 # Continious sequential defrag activity
79 runtime=30*${TIME_FACTOR}
85 iodepth=128*${LOAD_FACTOR}
97 runtime=30*${TIME_FACTOR}
104 echo " Start defragment activity"
106 cat $tmp-$seq.fio >> $seq.full
107 run_check $FIO_PROG $tmp-$seq.fio
110 _require_fio $tmp-$seq.fio
112 _scratch_mkfs >> $seq.full 2>&1
116 umount $SCRATCH_DEV 2>/dev/null
120 if ! _scratch_unmount; then
121 echo "failed to umount"