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