Statistics
| Branch: | Revision:

root / tests / qemu-iotests / 047 @ 30bd6a4d

History | View | Annotate | Download (1.6 kB)

1 b93d6d24 Kevin Wolf
#!/bin/bash
2 b93d6d24 Kevin Wolf
#
3 b93d6d24 Kevin Wolf
# Regression test for commit b7ab0fea (which was a corruption fix,
4 b93d6d24 Kevin Wolf
# despite the commit message claiming otherwise)
5 b93d6d24 Kevin Wolf
#
6 b93d6d24 Kevin Wolf
# Copyright (C) 2013 Red Hat, Inc.
7 b93d6d24 Kevin Wolf
#
8 b93d6d24 Kevin Wolf
# This program is free software; you can redistribute it and/or modify
9 b93d6d24 Kevin Wolf
# it under the terms of the GNU General Public License as published by
10 b93d6d24 Kevin Wolf
# the Free Software Foundation; either version 2 of the License, or
11 b93d6d24 Kevin Wolf
# (at your option) any later version.
12 b93d6d24 Kevin Wolf
#
13 b93d6d24 Kevin Wolf
# This program is distributed in the hope that it will be useful,
14 b93d6d24 Kevin Wolf
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15 b93d6d24 Kevin Wolf
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 b93d6d24 Kevin Wolf
# GNU General Public License for more details.
17 b93d6d24 Kevin Wolf
#
18 b93d6d24 Kevin Wolf
# You should have received a copy of the GNU General Public License
19 b93d6d24 Kevin Wolf
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
20 b93d6d24 Kevin Wolf
#
21 b93d6d24 Kevin Wolf
22 b93d6d24 Kevin Wolf
# creator
23 b93d6d24 Kevin Wolf
owner=kwolf@redhat.com
24 b93d6d24 Kevin Wolf
25 b93d6d24 Kevin Wolf
seq=`basename $0`
26 b93d6d24 Kevin Wolf
echo "QA output created by $seq"
27 b93d6d24 Kevin Wolf
28 b93d6d24 Kevin Wolf
here=`pwd`
29 b93d6d24 Kevin Wolf
tmp=/tmp/$$
30 b93d6d24 Kevin Wolf
status=1	# failure is the default!
31 b93d6d24 Kevin Wolf
32 b93d6d24 Kevin Wolf
_cleanup()
33 b93d6d24 Kevin Wolf
{
34 b93d6d24 Kevin Wolf
	_cleanup_test_img
35 b93d6d24 Kevin Wolf
}
36 b93d6d24 Kevin Wolf
trap "_cleanup; exit \$status" 0 1 2 3 15
37 b93d6d24 Kevin Wolf
38 b93d6d24 Kevin Wolf
# get standard environment, filters and checks
39 b93d6d24 Kevin Wolf
. ./common.rc
40 b93d6d24 Kevin Wolf
. ./common.filter
41 b93d6d24 Kevin Wolf
42 b93d6d24 Kevin Wolf
_supported_fmt qcow2
43 b93d6d24 Kevin Wolf
_supported_proto generic
44 b93d6d24 Kevin Wolf
_supported_os Linux
45 b93d6d24 Kevin Wolf
46 b93d6d24 Kevin Wolf
size=128M
47 b93d6d24 Kevin Wolf
48 b93d6d24 Kevin Wolf
_make_test_img $size
49 b93d6d24 Kevin Wolf
50 b93d6d24 Kevin Wolf
function qemu_io_cmds()
51 b93d6d24 Kevin Wolf
{
52 b93d6d24 Kevin Wolf
cat <<EOF
53 b93d6d24 Kevin Wolf
write -P 0x66 0 320k
54 b93d6d24 Kevin Wolf
write 320k 128k
55 b93d6d24 Kevin Wolf
write -P 0x55 1M 128k
56 b93d6d24 Kevin Wolf
write -P 0x88 448k 128k
57 b93d6d24 Kevin Wolf
discard 320k 128k
58 b93d6d24 Kevin Wolf
aio_flush
59 b93d6d24 Kevin Wolf
60 b93d6d24 Kevin Wolf
write -P 0x77 0 480k
61 b93d6d24 Kevin Wolf
aio_flush
62 b93d6d24 Kevin Wolf
63 b93d6d24 Kevin Wolf
read -P 0x77 0 480k
64 b93d6d24 Kevin Wolf
read -P 0x88 480k 96k
65 b93d6d24 Kevin Wolf
read -P 0x55 1M 128k
66 b93d6d24 Kevin Wolf
EOF
67 b93d6d24 Kevin Wolf
}
68 b93d6d24 Kevin Wolf
69 fef9c191 Jeff Cody
qemu_io_cmds | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
70 b93d6d24 Kevin Wolf
_check_test_img
71 b93d6d24 Kevin Wolf
72 b93d6d24 Kevin Wolf
# success, all done
73 b93d6d24 Kevin Wolf
echo "*** done"
74 b93d6d24 Kevin Wolf
rm -f $seq.full
75 b93d6d24 Kevin Wolf
status=0