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 #-----------------------------------------------------------------------
35 echo "QA output created by $seq"
39 status=1 # failure is the default!
40 trap "_cleanup; exit \$status" 0 1 2 3 15
48 # get standard environment, filters and checks
52 # real QA test starts here
54 _supported_os Linux IRIX
61 _scratch_mkfs >/dev/null 2>&1
64 echo "End-of-file zeroing with direct I/O"
65 xfs_io -F -f -d -t -c "pwrite -S 0x63 0 65536" \
67 -c "pwrite -S 0x41 65536 65536" \
68 -c "pread -v 0 131072" \
69 $SCRATCH_MNT/eof-zeroing_direct | _filter_xfs_io_unique
72 echo "Basic Block Hole test"
73 xfs_io -F -f -t -c "truncate 8192" \
74 -c "pread -v 5000 3000" \
75 $SCRATCH_MNT/blackhole | _filter_xfs_io_unique
78 echo "Test buffered and direct IO coherency"
79 xfs_io -F -f -t -c "pwrite -S 0x41 8000 1000" \
80 -c "pwrite -S 0x57 4000 1000" \
81 $SCRATCH_MNT/buff_direct_coherency | _filter_xfs_io_unique
83 xfs_io -F -d -c "pwrite -S 0x78 20480 4096"\
84 -c "pwrite -S 0x79 4096 4096"\
85 $SCRATCH_MNT/buff_direct_coherency | _filter_xfs_io_unique
87 xfs_io -F -c "pread -v 0 9000"\
88 $SCRATCH_MNT/buff_direct_coherency | _filter_xfs_io_unique
91 echo "Test direct read and write"
92 xfs_io -F -f -d -t -c "pwrite -S 0x78 0 65536"\
93 -c "pread -v 0 65536"\
94 -c "pwrite -S 0x46 65536 6553600"\
95 -c "pread -v 0 6619136"\
96 $SCRATCH_MNT/direct_io | _filter_xfs_io_unique
98 xfs_io -F -d -c "pread -v 0 6619136"\
99 $SCRATCH_MNT/direct_io | _filter_xfs_io_unique
101 xfs_io -F -f -d -t -c "pwrite -S 0x61 0 65536"\
102 -c "pread -v 0 65536"\
103 -c "pwrite -S 0x62 65536 131072"\
104 -c "pread -v 0 131072"\
105 $SCRATCH_MNT/async_direct_io | _filter_xfs_io_unique
107 xfs_io -F -d -c "pread -v 0 131072"\
108 $SCRATCH_MNT/async_direct_io | _filter_xfs_io_unique
112 xfs_io -F -f -t -c "truncate 131072"\
113 -c "pwrite -S 0x5F 0 131072"\
115 -c "truncate 131072"\
116 -c "pwrite -S 0x61 65535 2"\
117 -c "pread -v 0 131072"\
118 $SCRATCH_MNT/fsb_edge_test | _filter_xfs_io_unique
121 echo "Open Trunk test (O_TRUNC)"
124 xfs_io -F -f -t -c "pread -v 0 100" $SCRATCH_MNT/$n | _filter_xfs_io_unique
126 echo "Test" > $SCRATCH_MNT/$n
127 xfs_io -F -f -t -c "pread -v 0 100" $SCRATCH_MNT/$n | _filter_xfs_io_unique
134 echo "append to me" > $SCRATCH_MNT/append
135 xfs_io -F -a -c "pwrite -S 0x61 0 10" \
137 $SCRATCH_MNT/append | _filter_xfs_io_unique
140 echo "Small Vector Async"
141 echo "abcdefghijklmnopqrstuvwxyz" > $SCRATCH_MNT/small_vector_async
142 xfs_io -F -f -c "pread -v 0 1"\
156 -c "pwrite -S 0x61 4090 1"\
157 -c "pwrite -S 0x62 4091 1"\
158 -c "pwrite -S 0x63 4092 1"\
159 -c "pwrite -S 0x64 4093 1"\
160 -c "pwrite -S 0x65 4094 1"\
161 -c "pwrite -S 0x66 4095 1"\
162 -c "pwrite -S 0x67 4096 1"\
163 -c "pwrite -S 0x68 4097 1"\
164 -c "pwrite -S 0x69 4098 1"\
165 -c "pwrite -S 0x6A 4099 1"\
166 -c "pwrite -S 0x6B 4100 1"\
167 -c "pwrite -S 0x6C 4101 1"\
168 -c "pwrite -S 0x6D 4102 1"\
169 -c "pwrite -S 0x6E 4103 1"\
170 -c "pwrite -S 0x6F 4104 1"\
171 -c "pwrite -S 0x70 4105 1"\
172 -c "pread -v 4090 4"\
173 -c "pread -v 4094 4"\
174 -c "pread -v 4098 4"\
175 -c "pread -v 4102 4"\
176 -c "pwrite -S 0x61 10000000000 1"\
177 -c "pwrite -S 0x62 10000000001 1"\
178 -c "pwrite -S 0x63 10000000002 1"\
179 -c "pwrite -S 0x64 10000000003 1"\
180 -c "pwrite -S 0x65 10000000004 1"\
181 -c "pwrite -S 0x66 10000000005 1"\
182 -c "pwrite -S 0x67 10000000006 1"\
183 -c "pwrite -S 0x68 10000000007 1"\
184 -c "pwrite -S 0x69 10000000008 1"\
185 -c "pwrite -S 0x6A 10000000009 1"\
186 -c "pwrite -S 0x6B 10000000010 1"\
187 -c "pwrite -S 0x6C 10000000011 1"\
188 -c "pwrite -S 0x6D 10000000012 1"\
189 -c "pwrite -S 0x6E 10000000013 1"\
190 -c "pwrite -S 0x6F 10000000014 1"\
191 -c "pwrite -S 0x70 10000000015 1"\
192 -c "pread -v 10000000000 4"\
193 -c "pread -v 10000000004 4"\
194 -c "pread -v 10000000008 4"\
195 -c "pread -v 10000000012 4"\
196 $SCRATCH_MNT/small_vector_async | _filter_xfs_io_unique
199 echo "Small Vector Sync"
200 echo "abcdefghijklmnopqrstuvwxyz" > $SCRATCH_MNT/small_vector_async
201 xfs_io -F -f -s -c "pread -v 0 1"\
215 -c "pwrite -S 0x61 4090 1"\
216 -c "pwrite -S 0x62 4091 1"\
217 -c "pwrite -S 0x63 4092 1"\
218 -c "pwrite -S 0x64 4093 1"\
219 -c "pwrite -S 0x65 4094 1"\
220 -c "pwrite -S 0x66 4095 1"\
221 -c "pwrite -S 0x67 4096 1"\
222 -c "pwrite -S 0x68 4097 1"\
223 -c "pwrite -S 0x69 4098 1"\
224 -c "pwrite -S 0x6A 4099 1"\
225 -c "pwrite -S 0x6B 4100 1"\
226 -c "pwrite -S 0x6C 4101 1"\
227 -c "pwrite -S 0x6D 4102 1"\
228 -c "pwrite -S 0x6E 4103 1"\
229 -c "pwrite -S 0x6F 4104 1"\
230 -c "pwrite -S 0x70 4105 1"\
231 -c "pread -v 4090 4"\
232 -c "pread -v 4094 4"\
233 -c "pread -v 4098 4"\
234 -c "pread -v 4102 4"\
235 -c "pwrite -S 0x61 10000000000 1"\
236 -c "pwrite -S 0x62 10000000001 1"\
237 -c "pwrite -S 0x63 10000000002 1"\
238 -c "pwrite -S 0x64 10000000003 1"\
239 -c "pwrite -S 0x65 10000000004 1"\
240 -c "pwrite -S 0x66 10000000005 1"\
241 -c "pwrite -S 0x67 10000000006 1"\
242 -c "pwrite -S 0x68 10000000007 1"\
243 -c "pwrite -S 0x69 10000000008 1"\
244 -c "pwrite -S 0x6A 10000000009 1"\
245 -c "pwrite -S 0x6B 10000000010 1"\
246 -c "pwrite -S 0x6C 10000000011 1"\
247 -c "pwrite -S 0x6D 10000000012 1"\
248 -c "pwrite -S 0x6E 10000000013 1"\
249 -c "pwrite -S 0x6F 10000000014 1"\
250 -c "pwrite -S 0x70 10000000015 1"\
251 -c "pread -v 10000000000 4"\
252 -c "pread -v 10000000004 4"\
253 -c "pread -v 10000000008 4"\
254 -c "pread -v 10000000012 4"\
255 $SCRATCH_MNT/small_vector_async | _filter_xfs_io_unique