replace FSF postal addresses with www.gnu.org links
[qemu-iotests/stefanha.git] / 014
blobd7f50afcd53745f86a90bbbe29c5be671d503177
1 #!/bin/sh
3 # qcow2 pattern test, complex patterns including compression and snapshots
6 # Copyright (C) 2009 Red Hat, Inc.
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
22 # creator
23 owner=kwolf@redhat.com
25 seq=`basename $0`
26 echo "QA output created by $seq"
28 here=`pwd`
29 tmp=/tmp/$$
30 status=1 # failure is the default!
32 _cleanup()
34 _cleanup_test_img
36 trap "_cleanup; exit \$status" 0 1 2 3 15
38 # get standard environment, filters and checks
39 . ./common.rc
40 . ./common.filter
41 . ./common.pattern
43 # much of this could be generic for any format supporting snapshots
44 _supported_fmt qcow2
45 _supported_os Linux
47 TEST_OFFSETS="0 4294967296"
48 TEST_OPS="writev read write readv"
50 _make_test_img 6G
52 echo "Testing empty image:"
53 for offset in $TEST_OFFSETS; do
54 echo test2: With offset $offset
55 io_test2 $offset
56 _check_test_img
57 done
59 # With snapshots
60 for i in `seq 1 3`; do
61 $QEMU_IMG snapshot -c test$i $TEST_IMG
62 for offset in $TEST_OFFSETS; do
63 echo With snapshot test$i, offset $offset
64 for op in $TEST_OPS; do
65 io_test $op $offset
66 done
67 _check_test_img
68 done
69 done
71 # success, all done
72 echo "*** done"
73 rm -f $seq.full
74 status=0