2 # SPDX-License-Identifier: GPL-2.0
7 # Ext4 defragmentation stress test
8 # Two defrag tasks use common donor file
11 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
17 status=1 # failure is the default!
18 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
20 # get standard environment, filters and checks
25 # real QA test starts here
31 BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
32 # We need space for 3 files (one donor file and two test files)
33 # Reserve space for 4 files in order to avoid ENOSPC
34 FILE_SIZE=$((BLK_DEV_SIZE * (512 / (3+1))))
36 cat >$fio_config <<EOF
37 # Common e4defrag regression tests
41 directory=${SCRATCH_MNT}
46 continue_on_error=write
49 #################################
51 # Two defrag tasks use common donor file
60 numjobs=${LOAD_FACTOR}
61 runtime=30*${TIME_FACTOR}
72 numjobs=${LOAD_FACTOR}
73 runtime=30*${TIME_FACTOR}
78 iodepth=128*${LOAD_FACTOR}
90 runtime=30*${TIME_FACTOR}
93 [aio-buffer-verifier-2]
106 runtime=30*${TIME_FACTOR}
114 echo " Start defragment activity"
116 cat $fio_config >> $seqres.full
117 run_check $FIO_PROG $fio_config
120 _require_fio $fio_config
123 _scratch_mkfs >> $seqres.full 2>&1
127 _scratch_unmount 2>/dev/null
131 if ! _scratch_unmount; then
132 echo "failed to umount"