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 echo "QA output created by $seq"
40 status=1 # failure is the default!
41 trap "exit \$status" 0 1 2 3 15
43 # get standard environment, filters and checks
47 # real QA test starts here
49 _supported_os Linux IRIX
55 _scratch_mkfs >/dev/null 2>&1
58 echo "End-of-file zeroing with direct I/O"
59 $XFS_IO_PROG -f -d -t -c "pwrite -S 0x63 0 65536" \
61 -c "pwrite -S 0x41 65536 65536" \
62 -c "pread -v 0 131072" \
63 $SCRATCH_MNT/eof-zeroing_direct | _filter_xfs_io_unique
66 echo "Basic Block Hole test"
67 $XFS_IO_PROG -f -t -c "truncate 8192" \
68 -c "pread -v 5000 3000" \
69 $SCRATCH_MNT/blackhole | _filter_xfs_io_unique
72 echo "Test buffered and direct IO coherency"
73 $XFS_IO_PROG -f -t -c "pwrite -S 0x41 8000 1000" \
74 -c "pwrite -S 0x57 4000 1000" \
75 $SCRATCH_MNT/buff_direct_coherency | _filter_xfs_io_unique
77 $XFS_IO_PROG -d -c "pwrite -S 0x78 20480 4096"\
78 -c "pwrite -S 0x79 4096 4096"\
79 $SCRATCH_MNT/buff_direct_coherency | _filter_xfs_io_unique
81 $XFS_IO_PROG -c "pread -v 0 9000"\
82 $SCRATCH_MNT/buff_direct_coherency | _filter_xfs_io_unique
85 echo "Test direct read and write"
86 $XFS_IO_PROG -f -d -t -c "pwrite -S 0x78 0 65536"\
87 -c "pread -v 0 65536"\
88 -c "pwrite -S 0x46 65536 6553600"\
89 -c "pread -v 0 6619136"\
90 $SCRATCH_MNT/direct_io | _filter_xfs_io_unique
92 $XFS_IO_PROG -d -c "pread -v 0 6619136"\
93 $SCRATCH_MNT/direct_io | _filter_xfs_io_unique
95 $XFS_IO_PROG -f -d -t -c "pwrite -S 0x61 0 65536"\
96 -c "pread -v 0 65536"\
97 -c "pwrite -S 0x62 65536 131072"\
98 -c "pread -v 0 131072"\
99 $SCRATCH_MNT/async_direct_io | _filter_xfs_io_unique
101 $XFS_IO_PROG -d -c "pread -v 0 131072"\
102 $SCRATCH_MNT/async_direct_io | _filter_xfs_io_unique
106 $XFS_IO_PROG -f -t -c "truncate 131072"\
107 -c "pwrite -S 0x5F 0 131072"\
109 -c "truncate 131072"\
110 -c "pwrite -S 0x61 65535 2"\
111 -c "pread -v 0 131072"\
112 $SCRATCH_MNT/fsb_edge_test | _filter_xfs_io_unique
115 echo "Open Trunk test (O_TRUNC)"
118 $XFS_IO_PROG -f -t -c "pread -v 0 100" $SCRATCH_MNT/$n | _filter_xfs_io_unique
120 echo "Test" > $SCRATCH_MNT/$n
121 $XFS_IO_PROG -f -t -c "pread -v 0 100" $SCRATCH_MNT/$n | _filter_xfs_io_unique
128 echo "append to me" > $SCRATCH_MNT/append
129 $XFS_IO_PROG -a -c "pwrite -S 0x61 0 10" \
131 $SCRATCH_MNT/append | _filter_xfs_io_unique
134 echo "Small Vector Async"
135 echo "abcdefghijklmnopqrstuvwxyz" > $SCRATCH_MNT/small_vector_async
136 $XFS_IO_PROG -f -c "pread -v 0 1"\
150 -c "pwrite -S 0x61 4090 1"\
151 -c "pwrite -S 0x62 4091 1"\
152 -c "pwrite -S 0x63 4092 1"\
153 -c "pwrite -S 0x64 4093 1"\
154 -c "pwrite -S 0x65 4094 1"\
155 -c "pwrite -S 0x66 4095 1"\
156 -c "pwrite -S 0x67 4096 1"\
157 -c "pwrite -S 0x68 4097 1"\
158 -c "pwrite -S 0x69 4098 1"\
159 -c "pwrite -S 0x6A 4099 1"\
160 -c "pwrite -S 0x6B 4100 1"\
161 -c "pwrite -S 0x6C 4101 1"\
162 -c "pwrite -S 0x6D 4102 1"\
163 -c "pwrite -S 0x6E 4103 1"\
164 -c "pwrite -S 0x6F 4104 1"\
165 -c "pwrite -S 0x70 4105 1"\
166 -c "pread -v 4090 4"\
167 -c "pread -v 4094 4"\
168 -c "pread -v 4098 4"\
169 -c "pread -v 4102 4"\
170 -c "pwrite -S 0x61 10000000000 1"\
171 -c "pwrite -S 0x62 10000000001 1"\
172 -c "pwrite -S 0x63 10000000002 1"\
173 -c "pwrite -S 0x64 10000000003 1"\
174 -c "pwrite -S 0x65 10000000004 1"\
175 -c "pwrite -S 0x66 10000000005 1"\
176 -c "pwrite -S 0x67 10000000006 1"\
177 -c "pwrite -S 0x68 10000000007 1"\
178 -c "pwrite -S 0x69 10000000008 1"\
179 -c "pwrite -S 0x6A 10000000009 1"\
180 -c "pwrite -S 0x6B 10000000010 1"\
181 -c "pwrite -S 0x6C 10000000011 1"\
182 -c "pwrite -S 0x6D 10000000012 1"\
183 -c "pwrite -S 0x6E 10000000013 1"\
184 -c "pwrite -S 0x6F 10000000014 1"\
185 -c "pwrite -S 0x70 10000000015 1"\
186 -c "pread -v 10000000000 4"\
187 -c "pread -v 10000000004 4"\
188 -c "pread -v 10000000008 4"\
189 -c "pread -v 10000000012 4"\
190 $SCRATCH_MNT/small_vector_async | _filter_xfs_io_unique
193 echo "Small Vector Sync"
194 echo "abcdefghijklmnopqrstuvwxyz" > $SCRATCH_MNT/small_vector_async
195 $XFS_IO_PROG -f -s -c "pread -v 0 1"\
209 -c "pwrite -S 0x61 4090 1"\
210 -c "pwrite -S 0x62 4091 1"\
211 -c "pwrite -S 0x63 4092 1"\
212 -c "pwrite -S 0x64 4093 1"\
213 -c "pwrite -S 0x65 4094 1"\
214 -c "pwrite -S 0x66 4095 1"\
215 -c "pwrite -S 0x67 4096 1"\
216 -c "pwrite -S 0x68 4097 1"\
217 -c "pwrite -S 0x69 4098 1"\
218 -c "pwrite -S 0x6A 4099 1"\
219 -c "pwrite -S 0x6B 4100 1"\
220 -c "pwrite -S 0x6C 4101 1"\
221 -c "pwrite -S 0x6D 4102 1"\
222 -c "pwrite -S 0x6E 4103 1"\
223 -c "pwrite -S 0x6F 4104 1"\
224 -c "pwrite -S 0x70 4105 1"\
225 -c "pread -v 4090 4"\
226 -c "pread -v 4094 4"\
227 -c "pread -v 4098 4"\
228 -c "pread -v 4102 4"\
229 -c "pwrite -S 0x61 10000000000 1"\
230 -c "pwrite -S 0x62 10000000001 1"\
231 -c "pwrite -S 0x63 10000000002 1"\
232 -c "pwrite -S 0x64 10000000003 1"\
233 -c "pwrite -S 0x65 10000000004 1"\
234 -c "pwrite -S 0x66 10000000005 1"\
235 -c "pwrite -S 0x67 10000000006 1"\
236 -c "pwrite -S 0x68 10000000007 1"\
237 -c "pwrite -S 0x69 10000000008 1"\
238 -c "pwrite -S 0x6A 10000000009 1"\
239 -c "pwrite -S 0x6B 10000000010 1"\
240 -c "pwrite -S 0x6C 10000000011 1"\
241 -c "pwrite -S 0x6D 10000000012 1"\
242 -c "pwrite -S 0x6E 10000000013 1"\
243 -c "pwrite -S 0x6F 10000000014 1"\
244 -c "pwrite -S 0x70 10000000015 1"\
245 -c "pread -v 10000000000 4"\
246 -c "pread -v 10000000004 4"\
247 -c "pread -v 10000000008 4"\
248 -c "pread -v 10000000012 4"\
249 $SCRATCH_MNT/small_vector_async | _filter_xfs_io_unique