tests: remove udf/101
[xfstests-dev.git] / tests / ext4 / 303
1 #! /bin/bash
2 # FSQA Test No. 303
3 #
4 # Ext4 defragmentation stress test
5 # Two defrag tasks use common donor file
6 #
7 #-----------------------------------------------------------------------
8 # (c) 2013 Dmitry Monakhov
9 #
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.
13 #
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.
18 #
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
22 #
23 #-----------------------------------------------------------------------
24 #
25
26 seq=`basename $0`
27 seqres=$RESULT_DIR/$seq
28 echo "QA output created by $seq"
29
30 here=`pwd`
31 tmp=/tmp/$$
32 fio_config=$tmp.fio
33 status=1        # failure is the default!
34 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
35
36 # get standard environment, filters and checks
37 . ./common/rc
38 . ./common/filter
39 . ./common/defrag
40
41 # real QA test starts here
42 _supported_os Linux
43 _supported_fs ext4
44 _require_scratch
45 _require_defrag
46 _require_odirect
47
48 BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
49 # We need space for 3 files (one donor file and two test files)
50 # Reserve space for 4 files in order to avoid ENOSPC
51 FILE_SIZE=$((BLK_DEV_SIZE * (512 / (3+1))))
52
53 cat >$fio_config <<EOF
54 # Common e4defrag regression tests
55 [global]
56 ioengine=ioe_e4defrag
57 iodepth=1
58 directory=${SCRATCH_MNT}
59 filesize=${FILE_SIZE}
60 size=999G
61 buffered=0
62 fadvise_hint=0
63 continue_on_error=write
64 ignore_error=,EBUSY
65
66 #################################
67 # Test3
68 # Two defrag tasks use common donor file
69 [defrag-1]
70 ioengine=e4defrag
71 iodepth=1
72 bs=128k
73 donorname=test3.def
74 filename=test31
75 inplace=0
76 rw=write
77 numjobs=${LOAD_FACTOR}
78 runtime=30*${TIME_FACTOR}
79 time_based
80
81 [defrag-2]
82 ioengine=e4defrag
83 iodepth=1
84 bs=128k
85 donorname=test3.def
86 filename=test32
87 inplace=0
88 rw=write
89 numjobs=${LOAD_FACTOR}
90 runtime=30*${TIME_FACTOR}
91 time_based
92
93 [aio-dio-verifier-1]
94 ioengine=libaio
95 iodepth=128*${LOAD_FACTOR}
96 numjobs=1
97 verify=crc32c-intel
98 verify_fatal=1
99 verify_dump=1
100 verify_backlog=1024
101 verify_async=1
102 verifysort=1
103 direct=1
104 bs=64k
105 rw=write
106 filename=test31
107 runtime=30*${TIME_FACTOR}
108 time_based
109
110 [aio-buffer-verifier-2]
111 ioengine=libaio
112 numjobs=1
113 verify=crc32c-intel
114 verify_fatal=1
115 verify_dump=1
116 verify_backlog=1024
117 verify_async=1
118 verifysort=1
119 buffered=1
120 bs=64k
121 rw=randrw
122 filename=test32
123 runtime=30*${TIME_FACTOR}
124 time_based
125
126 EOF
127
128 _workout()
129 {
130         echo ""
131         echo " Start defragment activity"
132         echo ""
133         cat $fio_config >>  $seqres.full
134         run_check $FIO_PROG $fio_config
135 }
136
137 _require_fio $fio_config
138
139 rm -f $seqres.full
140 _scratch_mkfs  >> $seqres.full 2>&1
141 _scratch_mount
142
143 if ! _workout; then
144         _scratch_unmount 2>/dev/null
145         exit
146 fi
147
148 if ! _scratch_unmount; then
149         echo "failed to umount"
150         status=1
151         exit
152 fi
153 status=0
154 exit