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 #-----------------------------------------------------------------------
26 owner=dmonakhov@openvz.org
29 echo "QA output created by $seq"
33 status=1 # failure is the default!
34 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
36 # get standard environment, filters and checks
41 # real QA test starts here
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 # Perform defragmentation on file under buffered io
68 # while third task does direct io to donor file
70 # Continuous sequential defrag activity
80 numjobs=${LOAD_FACTOR}
81 runtime=30*${TIME_FACTOR}
84 # Run DIO/AIO for donor file
87 iodepth=128*${LOAD_FACTOR}
88 numjobs=${LOAD_FACTOR}
94 runtime=30*${TIME_FACTOR}
100 iodepth=128*${LOAD_FACTOR}
112 runtime=30*${TIME_FACTOR}
120 echo " Start defragment activity"
122 cat $tmp-$seq.fio >> $seq.full
123 run_check $FIO_PROG $tmp-$seq.fio
126 _require_fio $tmp-$seq.fio
128 _scratch_mkfs >> $seq.full 2>&1
132 umount $SCRATCH_DEV 2>/dev/null
136 if ! _scratch_unmount; then
137 echo "failed to umount"