xfstests: remove stale machine configs
[xfstests-dev.git] / 300
1 #! /bin/bash
2 # FSQA Test No. 300
3 #
4 # AIO/DIO stress test
5 # Run random AIO/DIO activity and fallocate/punch_hole simultaneously
6 # Test will operate on huge sparsed file so ENOSPC is expected.
7 #
8 #-----------------------------------------------------------------------
9 # (c) 2013 Dmitry Monakhov
10 #
11 # This program is free software; you can redistribute it and/or
12 # modify it under the terms of the GNU General Public License as
13 # published by the Free Software Foundation.
14 #
15 # This program is distributed in the hope that it would be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 # GNU General Public License for more details.
19 #
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write the Free Software Foundation,
22 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
23 #
24 #-----------------------------------------------------------------------
25 #
26
27 seq=`basename $0`
28 echo "QA output created by $seq"
29
30 here=`pwd`
31 tmp=/tmp/$$
32 status=1        # failure is the default!
33 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
34
35 # get standard environment, filters and checks
36 . ./common.rc
37 . ./common.filter
38
39 # real QA test starts here
40 _supported_fs generic
41 _supported_os Linux
42 _need_to_be_root
43 _require_scratch
44
45 NUM_JOBS=$((4*LOAD_FACTOR))
46 BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
47 if [ $((BLK_DEV_SIZE)) -gt 1048576 ]
48 then
49     BLK_DEV_SIZE=1048576
50 fi
51 FS_SIZE=$((BLK_DEV_SIZE * 512))
52
53 cat >$tmp-$seq.fio <<EOF
54 ###########
55 # $seq test fio activity
56 # Run DIO, fallocate and punch_hole threads on a single in parallel
57 #
58 # If race exist old dio request may rewrite punched block after it was
59 # allocated to another file, we will catch that by verifying blocks content
60 #
61 [global]
62 directory=${SCRATCH_MNT}
63 filesize=${FS_SIZE}
64 size=999G
65 continue_on_error=write
66 ignore_error=,ENOSPC
67 error_dump=0
68
69 create_on_open=1
70 fallocate=none
71 exitall=1
72
73 ## Perform direct aio, to files which may be truncated
74 ## by external task
75 [direct_aio_raicer]
76 ioengine=libaio
77 iodepth=128*${LOAD_FACTOR}
78 bs=128k
79 direct=1
80 numjobs=${NUM_JOBS}
81 rw=randwrite
82 runtime=100*${TIME_FACTOR}
83 time_based
84 filename=racer
85
86 # Run falloc and punch_hole threads in parallel
87 # After activity file will be highly fragmented
88 [falloc_raicer]
89 ioengine=falloc
90 runtime=100*${TIME_FACTOR}
91 iodepth=1
92 bssplit=128k/80:512k/10:32k/10
93 rw=randwrite
94 numjobs=1
95 filename=racer
96
97 [punch_hole_raicer]
98 ioengine=falloc
99 runtime=100*${TIME_FACTOR}
100 bs=4k
101 time_based=10
102 rw=randtrim
103 numjobs=2
104 filename=racer
105 time_based
106
107 # Verifier thread continiously write to newly allcated blocks
108 # and veryfy written content
109 [aio-dio-verifier]
110 ioengine=libaio
111 iodepth=128*${LOAD_FACTOR}
112 numjobs=1
113 verify=crc32c-intel
114 verify_fatal=1
115 verify_dump=1
116 verify_backlog=1024
117 verify_async=4
118 verifysort=1
119 direct=1
120 bs=4k
121 rw=randwrite
122 filename=aio-dio-verifier
123 EOF
124
125 _workout()
126 {
127         echo ""
128         echo "Run fio with random aio-dio pattern"
129         echo ""
130         cat $tmp-$seq.fio >>  $seq.full
131         run_check $FIO_PROG $tmp-$seq.fio
132 }
133
134 _require_fio $tmp-$seq.fio
135
136 _scratch_mkfs_sized $FS_SIZE >> $seq.full 2>&1
137 _scratch_mount
138
139 if ! _workout; then
140         umount $SCRATCH_DEV 2>/dev/null
141         exit
142 fi
143
144 if ! _scratch_unmount; then
145         echo "failed to umount"
146         status=1
147         exit
148 fi
149 _check_scratch_fs
150 status=$?
151 exit