4 # Ext4 defragmentation stress test
5 # Two defrag tasks use common 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 echo "QA output created by $seq"
31 status=1 # failure is the default!
32 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
34 # get standard environment, filters and checks
39 # real QA test starts here
46 BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
47 # We need space for 3 files (one donor file and two test files)
48 # Reserve space for 4 files in order to avoid ENOSPC
49 FILE_SIZE=$((BLK_DEV_SIZE * (512 / (3+1))))
51 cat >$tmp-$seq.fio <<EOF
52 # Common e4defrag regression tests
56 directory=${SCRATCH_MNT}
63 #################################
65 # Two defrag tasks use common donor file
74 numjobs=${LOAD_FACTOR}
75 runtime=30*${TIME_FACTOR}
86 numjobs=${LOAD_FACTOR}
87 runtime=30*${TIME_FACTOR}
92 iodepth=128*${LOAD_FACTOR}
104 runtime=30*${TIME_FACTOR}
107 [aio-buffer-verifier-2]
120 runtime=30*${TIME_FACTOR}
128 echo " Start defragment activity"
130 cat $tmp-$seq.fio >> $seq.full
131 run_check $FIO_PROG $tmp-$seq.fio
134 _require_fio $tmp-$seq.fio
136 _scratch_mkfs >> $seq.full 2>&1
140 umount $SCRATCH_DEV 2>/dev/null
144 if ! _scratch_unmount; then
145 echo "failed to umount"