87d34d2d0c0e52ec5bd722b511b7462bb1a9fcdf
[xfstests-dev.git] / 132
1 #! /bin/sh
2 #
3 #-----------------------------------------------------------------------
4 # Copyright (c) 2006 Silicon Graphics, Inc.  All Rights Reserved.
5 #
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License as
8 # published by the Free Software Foundation.
9 #
10 # This program is distributed in the hope that it would be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write the Free Software Foundation,
17 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18 #
19 #-----------------------------------------------------------------------
20 #
21 # FSQA Test No. 132
22 #
23 # xfs_io aligned vector rw created from CXFSQA test
24 # unixfile_vector_aligned_rw
25 #
26 # creator
27 owner=allanr@sgi.com
28
29 seq=`basename $0`
30 echo "QA output created by $seq"
31
32 here=`pwd`
33 tmp=/tmp/$$
34 status=1    # failure is the default!
35 trap "_cleanup; exit \$status" 0 1 2 3 15
36
37 _cleanup()
38 {
39     cd /
40     _cleanup_testdir
41 }
42
43 # get standard environment, filters and checks
44 . ./common.rc
45 . ./common.filter
46
47 common_line_filter()
48 {
49     perl -ne 'if (/.*:(.*)/) {
50         if ( "$last_line" ne "$1" ) { print $_; $first_match=1; }
51         elsif ( $first_match==1 ) { print "*\n"; $first_match=0; }
52         $last_line="$1";
53     }
54     else {
55         print $_
56     }'
57 }
58
59 _filter_xfs_io()
60 {
61     common_line_filter | sed -e "s/[0-9/.]* [GMKiBbytes]*, [0-9]* ops\; [0-9/:. sec]* ([inf0-9/.]* [EPGMKiBbytes]*\/sec and [inf0-9/.]* ops\/sec)/XXX Bytes, X ops\; XX:XX:XX.X (XXX YYY\/sec and XXX ops\/sec)/"
62 }
63
64 # real QA test starts here
65 _supported_fs xfs
66 _supported_os Linux IRIX
67
68 _setup_testdir
69 _require_scratch
70
71 _scratch_mkfs >/dev/null 2>&1
72 _scratch_mount
73
74 xfs_io -f -t -c "pwrite -S 0x63 0 512" \
75     -c "pwrite -S 0x64 512 512" \
76     -c "pwrite -S 0x65 1024 512" \
77     -c "pwrite -S 0x66 1536 512" \
78     -c "pwrite -S 0x67 2048 512" \
79     -c "pwrite -S 0x68 2560 512" \
80     -c "pwrite -S 0x69 3072 512" \
81     -c "pwrite -S 0x6A 3584 512" \
82     -c "pread -v 0 512" \
83     -c "pread -v 512 512" \
84     -c "pread -v 1024 512" \
85     -c "pread -v 1536 512" \
86     -c "pread -v 2048 512" \
87     -c "pread -v 2560 512" \
88     -c "pread -v 3072 512" \
89     -c "pread -v 3584 512" \
90     $SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io
91
92 xfs_io -f -c "pwrite -S 0x63 4096 1024" \
93     -c "pwrite -S 0x6B 5120 1024" \
94     -c "pwrite -S 0x6C 6144 1024" \
95     -c "pwrite -S 0x6D 7168 1024" \
96     -c "pread -v 0 1024" \
97     -c "pread -v 1024 1024" \
98     -c "pread -v 2048 1024" \
99     -c "pread -v 3072 1024" \
100     -c "pread -v 4096 1024" \
101     -c "pread -v 5120 1024" \
102     -c "pread -v 6144 1024" \
103     -c "pread -v 7168 1024" \
104     $SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io
105
106 xfs_io -f -c "pwrite -S 0x6E 8192 2048" \
107     -c "pwrite -S 0x6F 10240 2048" \
108     -c "pread -v 0 2048" \
109     -c "pread -v 2048 2048" \
110     -c "pread -v 4096 2048" \
111     -c "pread -v 6144 2048" \
112     -c "pread -v 8192 2048" \
113     -c "pread -v 10240 2048" \
114     $SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io
115
116 xfs_io -f -c "pwrite -S 0x70 12288 4096" \
117     -c "pread -v 0 4096" \
118     -c "pread -v 4096 4096" \
119     -c "pread -v 8192 4096" \
120     -c "pread -v 12288 4096" \
121     $SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io
122
123 xfs_io -f -c "pwrite -S 0x71 16384 8192" \
124     -c "pwrite -S 0x72 24576 8192" \
125     -c "pread -v 0 8192" \
126     -c "pread -v 8192 8192" \
127     -c "pread -v 8192 8192" \
128     -c "pread -v 16384 8192" \
129     $SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io
130
131 xfs_io -f -c "pwrite -S 0x73 32768 16384" \
132     -c "pwrite -S 0x74 49152 16384" \
133     -c "pread -v 0 16384" \
134     -c "pread -v 16384 16384" \
135     -c "pread -v 32768 16384" \
136     -c "pread -v 49152 16384" \
137     $SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io
138
139 xfs_io -f -c "pwrite -S 0x75 65536 32768" \
140     -c "pwrite -S 0x76 98304 32768" \
141     -c "pread -v 0 32768" \
142     -c "pread -v 32768 32768" \
143     -c "pread -v 65536 32768" \
144     -c "pread -v 98304 32768" \
145     $SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io
146
147 xfs_io -f -c "pwrite -S 0x76 131072 65536" \
148     -c "pwrite -S 0x77 196608 65536" \
149     -c "pread -v 0 65536" \
150     -c "pread -v 65536 65536" \
151     -c "pread -v 131072 65536" \
152     -c "pread -v 196608 65536" \
153     $SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io
154
155 xfs_io -f -c "pwrite -S 0x76 262144 131072" \
156     -c "pwrite -S 0x77 393216 131072" \
157     -c "pread -v 0 131072" \
158     -c "pread -v 131072 131072" \
159     -c "pread -v 262144 131072" \
160     -c "pread -v 393216 131072" \
161     $SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io
162
163 xfs_io -f -c "pwrite -S 0x76 524288 524288" \
164     -c "pwrite -S 0x77 1048576 524288" \
165     -c "pread -v 0 524288" \
166     -c "pread -v 524288 524288" \
167     -c "pread -v 1048576 524288" \
168     $SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io
169
170 xfs_io -f -c "pwrite -S 0x32 1048576 1048576" \
171     -c "pwrite -S 0x33 2097152 1048576" \
172     -c "pwrite -S 0x34 3145728 1048576" \
173     -c "pwrite -S 0x35 4194304 1048576" \
174     -c "pwrite -S 0x36 5242880 1048576" \
175     -c "pwrite -S 0x37 6291456 1048576" \
176     -c "pwrite -S 0x38 7340032 1048576" \
177     -c "pwrite -S 0x39 8388608 1048576" \
178     -c "pread -v 0 1048576" \
179     -c "pread -v 1048576 1048576" \
180     -c "pread -v 2097152 1048576" \
181     -c "pread -v 3145728 1048576" \
182     -c "pread -v 4194304 1048576" \
183     -c "pread -v 5242880 1048576" \
184     -c "pread -v 6291456 1048576" \
185     -c "pread -v 7340032 1048576" \
186     -c "pread -v 8388608 1048576" \
187     $SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io
188
189 xfs_io -f -c "pwrite -S 0x32 1048576 1048576" \
190     -c "pwrite -S 0x33 2097152 1048576" \
191     -c "pwrite -S 0x34 3145728 1048576" \
192     -c "pwrite -S 0x35 4194304 1048576" \
193     -c "pwrite -S 0x36 5242880 1048576" \
194     -c "pwrite -S 0x37 6291456 1048576" \
195     -c "pwrite -S 0x38 7340032 1048576" \
196     -c "pwrite -S 0x39 8388608 1048576" \
197     -c "pwrite -S 0x3A 9437184 1048576" \
198     -c "pread -v 0 1048576" \
199     -c "pread -v 1048576 1048576" \
200     -c "pread -v 2097152 1048576" \
201     -c "pread -v 3145728 1048576" \
202     -c "pread -v 4194304 1048576" \
203     -c "pread -v 5242880 1048576" \
204     -c "pread -v 6291456 1048576" \
205     -c "pread -v 7340032 1048576" \
206     -c "pread -v 8388608 1048576" \
207     -c "pread -v 9437184 1048576" \
208     $SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io
209
210 xfs_io -f -c "pwrite -S 0x92 10485760 10485760" \
211     -c "pwrite -S 0x93 20971520 10485760" \
212     -c "pwrite -S 0x94 31457280 10485760" \
213     -c "pwrite -S 0x95 41943040 10485760" \
214     -c "pwrite -S 0x96 52428800 10485760" \
215     -c "pwrite -S 0x97 62914560 10485760" \
216     -c "pwrite -S 0x98 73400320 10485760" \
217     -c "pwrite -S 0x99 83886080 10485760" \
218     -c "pwrite -S 0x9A 94371840 10485760" \
219     -c "pread -v 0 10485760" \
220     -c "pread -v 10485760 10485760" \
221     -c "pread -v 20971520 10485760" \
222     -c "pread -v 31457280 10485760" \
223     -c "pread -v 41943040 10485760" \
224     -c "pread -v 52428800 10485760" \
225     -c "pread -v 62914560 10485760" \
226     -c "pread -v 73400320 10485760" \
227     -c "pread -v 83886080 10485760" \
228     -c "pread -v 94371840 10485760" \
229     $SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io
230
231 status=0
232 exit