root / tests / qemu-iotests / 005 @ 5d9c577d
History | View | Annotate | Download (1.6 kB)
1 | 6bf19c94 | Christoph Hellwig | #!/bin/sh |
---|---|---|---|
2 | 6bf19c94 | Christoph Hellwig | # |
3 | 6bf19c94 | Christoph Hellwig | # Make sure qemu-img can create 5TB images |
4 | 6bf19c94 | Christoph Hellwig | # |
5 | 6bf19c94 | Christoph Hellwig | # Based on a testcase from Chris Wright, |
6 | 6bf19c94 | Christoph Hellwig | # https://bugzilla.redhat.com/show_bug.cgi?id=491943 |
7 | 6bf19c94 | Christoph Hellwig | # |
8 | 6bf19c94 | Christoph Hellwig | # Copyright (C) 2009 Red Hat, Inc. |
9 | 6bf19c94 | Christoph Hellwig | # |
10 | 6bf19c94 | Christoph Hellwig | # This program is free software; you can redistribute it and/or modify |
11 | 6bf19c94 | Christoph Hellwig | # it under the terms of the GNU General Public License as published by |
12 | 6bf19c94 | Christoph Hellwig | # the Free Software Foundation; either version 2 of the License, or |
13 | 6bf19c94 | Christoph Hellwig | # (at your option) any later version. |
14 | 6bf19c94 | Christoph Hellwig | # |
15 | 6bf19c94 | Christoph Hellwig | # This program is distributed in the hope that it will be useful, |
16 | 6bf19c94 | Christoph Hellwig | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | 6bf19c94 | Christoph Hellwig | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
18 | 6bf19c94 | Christoph Hellwig | # GNU General Public License for more details. |
19 | 6bf19c94 | Christoph Hellwig | # |
20 | 6bf19c94 | Christoph Hellwig | # You should have received a copy of the GNU General Public License |
21 | 6bf19c94 | Christoph Hellwig | # along with this program; if not, write to the Free Software |
22 | 6bf19c94 | Christoph Hellwig | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
23 | 6bf19c94 | Christoph Hellwig | # USA |
24 | 6bf19c94 | Christoph Hellwig | # |
25 | 6bf19c94 | Christoph Hellwig | |
26 | 6bf19c94 | Christoph Hellwig | # creator |
27 | 6bf19c94 | Christoph Hellwig | owner=hch@lst.de |
28 | 6bf19c94 | Christoph Hellwig | |
29 | 6bf19c94 | Christoph Hellwig | seq=`basename $0` |
30 | 6bf19c94 | Christoph Hellwig | echo "QA output created by $seq" |
31 | 6bf19c94 | Christoph Hellwig | |
32 | 6bf19c94 | Christoph Hellwig | here=`pwd` |
33 | 6bf19c94 | Christoph Hellwig | tmp=/tmp/$$ |
34 | 6bf19c94 | Christoph Hellwig | status=1 # failure is the default! |
35 | 6bf19c94 | Christoph Hellwig | |
36 | 6bf19c94 | Christoph Hellwig | _cleanup() |
37 | 6bf19c94 | Christoph Hellwig | { |
38 | 6bf19c94 | Christoph Hellwig | _cleanup_test_img |
39 | 6bf19c94 | Christoph Hellwig | } |
40 | 6bf19c94 | Christoph Hellwig | trap "_cleanup; exit \$status" 0 1 2 3 15 |
41 | 6bf19c94 | Christoph Hellwig | |
42 | 6bf19c94 | Christoph Hellwig | # get standard environment, filters and checks |
43 | 6bf19c94 | Christoph Hellwig | . ./common.rc |
44 | 6bf19c94 | Christoph Hellwig | . ./common.filter |
45 | 6bf19c94 | Christoph Hellwig | |
46 | 6bf19c94 | Christoph Hellwig | _supported_fmt generic |
47 | 6bf19c94 | Christoph Hellwig | _supported_os Linux |
48 | 6bf19c94 | Christoph Hellwig | |
49 | 5d9c577d | Christoph Hellwig | # vpc is limited to 127GB, so we can't test it here |
50 | 5d9c577d | Christoph Hellwig | if [ "$IMGFMT" = "vpc" ]; then |
51 | 5d9c577d | Christoph Hellwig | _notrun "image format $IMGFMT does not support large image sizes" |
52 | 5d9c577d | Christoph Hellwig | fi |
53 | 6bf19c94 | Christoph Hellwig | |
54 | 6bf19c94 | Christoph Hellwig | echo |
55 | 6bf19c94 | Christoph Hellwig | echo "creating large image" |
56 | 6bf19c94 | Christoph Hellwig | _make_test_img 5000G |
57 | 6bf19c94 | Christoph Hellwig | |
58 | 6bf19c94 | Christoph Hellwig | echo |
59 | 6bf19c94 | Christoph Hellwig | echo "small read" |
60 | 6bf19c94 | Christoph Hellwig | $QEMU_IO -c "read 1024 4096" $TEST_IMG | _filter_qemu_io |
61 | 6bf19c94 | Christoph Hellwig | |
62 | 6bf19c94 | Christoph Hellwig | echo |
63 | 6bf19c94 | Christoph Hellwig | echo "small write" |
64 | 6bf19c94 | Christoph Hellwig | $QEMU_IO -c "read 8192 4096" $TEST_IMG | _filter_qemu_io |
65 | 6bf19c94 | Christoph Hellwig | |
66 | 6bf19c94 | Christoph Hellwig | # success, all done |
67 | 6bf19c94 | Christoph Hellwig | echo "*** done" |
68 | 6bf19c94 | Christoph Hellwig | rm -f $seq.full |
69 | 6bf19c94 | Christoph Hellwig | status=0 |