4 # xfs_io vector read/write and trunc tests. modified from cxfsqa tests
5 # - unixfile_basic_block_hole
6 # - unixfile_buffer_direct_coherency
8 # - unixfile_eof_direct
10 # - unixfile_open_append
11 # - unixfile_open_trunc
12 # - unixfile_small_vector_async_rw
13 # - unixfile_small_vector_sync_rw
15 #-----------------------------------------------------------------------
16 # Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
18 # This program is free software; you can redistribute it and/or
19 # modify it under the terms of the GNU General Public License as
20 # published by the Free Software Foundation.
22 # This program is distributed in the hope that it would be useful,
23 # but WITHOUT ANY WARRANTY; without even the implied warranty of
24 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 # GNU General Public License for more details.
27 # You should have received a copy of the GNU General Public License
28 # along with this program; if not, write the Free Software Foundation,
29 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
31 #-----------------------------------------------------------------------
37 echo "QA output created by $seq"
41 status=1 # failure is the default!
42 trap "_cleanup; exit \$status" 0 1 2 3 15
50 # get standard environment, filters and checks
54 # real QA test starts here
56 _supported_os Linux IRIX
63 _scratch_mkfs >/dev/null 2>&1
66 echo "End-of-file zeroing with direct I/O"
67 xfs_io -F -f -d -t -c "pwrite -S 0x63 0 65536" \
69 -c "pwrite -S 0x41 65536 65536" \
70 -c "pread -v 0 131072" \
71 $SCRATCH_MNT/eof-zeroing_direct | _filter_xfs_io_unique
74 echo "Basic Block Hole test"
75 xfs_io -F -f -t -c "truncate 8192" \
76 -c "pread -v 5000 3000" \
77 $SCRATCH_MNT/blackhole | _filter_xfs_io_unique
80 echo "Test buffered and direct IO coherency"
81 xfs_io -F -f -t -c "pwrite -S 0x41 8000 1000" \
82 -c "pwrite -S 0x57 4000 1000" \
83 $SCRATCH_MNT/buff_direct_coherency | _filter_xfs_io_unique
85 xfs_io -F -d -c "pwrite -S 0x78 20480 4096"\
86 -c "pwrite -S 0x79 4096 4096"\
87 $SCRATCH_MNT/buff_direct_coherency | _filter_xfs_io_unique
89 xfs_io -F -c "pread -v 0 9000"\
90 $SCRATCH_MNT/buff_direct_coherency | _filter_xfs_io_unique
93 echo "Test direct read and write"
94 xfs_io -F -f -d -t -c "pwrite -S 0x78 0 65536"\
95 -c "pread -v 0 65536"\
96 -c "pwrite -S 0x46 65536 6553600"\
97 -c "pread -v 0 6619136"\
98 $SCRATCH_MNT/direct_io | _filter_xfs_io_unique
100 xfs_io -F -d -c "pread -v 0 6619136"\
101 $SCRATCH_MNT/direct_io | _filter_xfs_io_unique
103 xfs_io -F -f -d -t -c "pwrite -S 0x61 0 65536"\
104 -c "pread -v 0 65536"\
105 -c "pwrite -S 0x62 65536 131072"\
106 -c "pread -v 0 131072"\
107 $SCRATCH_MNT/async_direct_io | _filter_xfs_io_unique
109 xfs_io -F -d -c "pread -v 0 131072"\
110 $SCRATCH_MNT/async_direct_io | _filter_xfs_io_unique
114 xfs_io -F -f -t -c "truncate 131072"\
115 -c "pwrite -S 0x5F 0 131072"\
117 -c "truncate 131072"\
118 -c "pwrite -S 0x61 65535 2"\
119 -c "pread -v 0 131072"\
120 $SCRATCH_MNT/fsb_edge_test | _filter_xfs_io_unique
123 echo "Open Trunk test (O_TRUNC)"
126 xfs_io -F -f -t -c "pread -v 0 100" $SCRATCH_MNT/$n | _filter_xfs_io_unique
128 echo "Test" > $SCRATCH_MNT/$n
129 xfs_io -F -f -t -c "pread -v 0 100" $SCRATCH_MNT/$n | _filter_xfs_io_unique
136 echo "append to me" > $SCRATCH_MNT/append
137 xfs_io -F -a -c "pwrite -S 0x61 0 10" \
139 $SCRATCH_MNT/append | _filter_xfs_io_unique
142 echo "Small Vector Async"
143 echo "abcdefghijklmnopqrstuvwxyz" > $SCRATCH_MNT/small_vector_async
144 xfs_io -F -f -c "pread -v 0 1"\
158 -c "pwrite -S 0x61 4090 1"\
159 -c "pwrite -S 0x62 4091 1"\
160 -c "pwrite -S 0x63 4092 1"\
161 -c "pwrite -S 0x64 4093 1"\
162 -c "pwrite -S 0x65 4094 1"\
163 -c "pwrite -S 0x66 4095 1"\
164 -c "pwrite -S 0x67 4096 1"\
165 -c "pwrite -S 0x68 4097 1"\
166 -c "pwrite -S 0x69 4098 1"\
167 -c "pwrite -S 0x6A 4099 1"\
168 -c "pwrite -S 0x6B 4100 1"\
169 -c "pwrite -S 0x6C 4101 1"\
170 -c "pwrite -S 0x6D 4102 1"\
171 -c "pwrite -S 0x6E 4103 1"\
172 -c "pwrite -S 0x6F 4104 1"\
173 -c "pwrite -S 0x70 4105 1"\
174 -c "pread -v 4090 4"\
175 -c "pread -v 4094 4"\
176 -c "pread -v 4098 4"\
177 -c "pread -v 4102 4"\
178 -c "pwrite -S 0x61 10000000000 1"\
179 -c "pwrite -S 0x62 10000000001 1"\
180 -c "pwrite -S 0x63 10000000002 1"\
181 -c "pwrite -S 0x64 10000000003 1"\
182 -c "pwrite -S 0x65 10000000004 1"\
183 -c "pwrite -S 0x66 10000000005 1"\
184 -c "pwrite -S 0x67 10000000006 1"\
185 -c "pwrite -S 0x68 10000000007 1"\
186 -c "pwrite -S 0x69 10000000008 1"\
187 -c "pwrite -S 0x6A 10000000009 1"\
188 -c "pwrite -S 0x6B 10000000010 1"\
189 -c "pwrite -S 0x6C 10000000011 1"\
190 -c "pwrite -S 0x6D 10000000012 1"\
191 -c "pwrite -S 0x6E 10000000013 1"\
192 -c "pwrite -S 0x6F 10000000014 1"\
193 -c "pwrite -S 0x70 10000000015 1"\
194 -c "pread -v 10000000000 4"\
195 -c "pread -v 10000000004 4"\
196 -c "pread -v 10000000008 4"\
197 -c "pread -v 10000000012 4"\
198 $SCRATCH_MNT/small_vector_async | _filter_xfs_io_unique
201 echo "Small Vector Sync"
202 echo "abcdefghijklmnopqrstuvwxyz" > $SCRATCH_MNT/small_vector_async
203 xfs_io -F -f -s -c "pread -v 0 1"\
217 -c "pwrite -S 0x61 4090 1"\
218 -c "pwrite -S 0x62 4091 1"\
219 -c "pwrite -S 0x63 4092 1"\
220 -c "pwrite -S 0x64 4093 1"\
221 -c "pwrite -S 0x65 4094 1"\
222 -c "pwrite -S 0x66 4095 1"\
223 -c "pwrite -S 0x67 4096 1"\
224 -c "pwrite -S 0x68 4097 1"\
225 -c "pwrite -S 0x69 4098 1"\
226 -c "pwrite -S 0x6A 4099 1"\
227 -c "pwrite -S 0x6B 4100 1"\
228 -c "pwrite -S 0x6C 4101 1"\
229 -c "pwrite -S 0x6D 4102 1"\
230 -c "pwrite -S 0x6E 4103 1"\
231 -c "pwrite -S 0x6F 4104 1"\
232 -c "pwrite -S 0x70 4105 1"\
233 -c "pread -v 4090 4"\
234 -c "pread -v 4094 4"\
235 -c "pread -v 4098 4"\
236 -c "pread -v 4102 4"\
237 -c "pwrite -S 0x61 10000000000 1"\
238 -c "pwrite -S 0x62 10000000001 1"\
239 -c "pwrite -S 0x63 10000000002 1"\
240 -c "pwrite -S 0x64 10000000003 1"\
241 -c "pwrite -S 0x65 10000000004 1"\
242 -c "pwrite -S 0x66 10000000005 1"\
243 -c "pwrite -S 0x67 10000000006 1"\
244 -c "pwrite -S 0x68 10000000007 1"\
245 -c "pwrite -S 0x69 10000000008 1"\
246 -c "pwrite -S 0x6A 10000000009 1"\
247 -c "pwrite -S 0x6B 10000000010 1"\
248 -c "pwrite -S 0x6C 10000000011 1"\
249 -c "pwrite -S 0x6D 10000000012 1"\
250 -c "pwrite -S 0x6E 10000000013 1"\
251 -c "pwrite -S 0x6F 10000000014 1"\
252 -c "pwrite -S 0x70 10000000015 1"\
253 -c "pread -v 10000000000 4"\
254 -c "pread -v 10000000004 4"\
255 -c "pread -v 10000000008 4"\
256 -c "pread -v 10000000012 4"\
257 $SCRATCH_MNT/small_vector_async | _filter_xfs_io_unique