Statistics
| Branch: | Revision:

root / tests / qemu-iotests / 035 @ b3ce604e

History | View | Annotate | Download (1.6 kB)

1 dad5e576 Kevin Wolf
#!/bin/bash
2 dad5e576 Kevin Wolf
#
3 dad5e576 Kevin Wolf
# Let a few AIO requests run in parallel and have them access different L2
4 dad5e576 Kevin Wolf
# tables so that the cache has a chance to get used up.
5 dad5e576 Kevin Wolf
#
6 dad5e576 Kevin Wolf
# Copyright (C) 2012 Red Hat, Inc.
7 dad5e576 Kevin Wolf
#
8 dad5e576 Kevin Wolf
# This program is free software; you can redistribute it and/or modify
9 dad5e576 Kevin Wolf
# it under the terms of the GNU General Public License as published by
10 dad5e576 Kevin Wolf
# the Free Software Foundation; either version 2 of the License, or
11 dad5e576 Kevin Wolf
# (at your option) any later version.
12 dad5e576 Kevin Wolf
#
13 dad5e576 Kevin Wolf
# This program is distributed in the hope that it will be useful,
14 dad5e576 Kevin Wolf
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15 dad5e576 Kevin Wolf
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 dad5e576 Kevin Wolf
# GNU General Public License for more details.
17 dad5e576 Kevin Wolf
#
18 dad5e576 Kevin Wolf
# You should have received a copy of the GNU General Public License
19 dad5e576 Kevin Wolf
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
20 dad5e576 Kevin Wolf
#
21 dad5e576 Kevin Wolf
22 dad5e576 Kevin Wolf
# creator
23 dad5e576 Kevin Wolf
owner=kwolf@redhat.com
24 dad5e576 Kevin Wolf
25 dad5e576 Kevin Wolf
seq=`basename $0`
26 dad5e576 Kevin Wolf
echo "QA output created by $seq"
27 dad5e576 Kevin Wolf
28 dad5e576 Kevin Wolf
here=`pwd`
29 dad5e576 Kevin Wolf
tmp=/tmp/$$
30 dad5e576 Kevin Wolf
status=1	# failure is the default!
31 dad5e576 Kevin Wolf
32 dad5e576 Kevin Wolf
_cleanup()
33 dad5e576 Kevin Wolf
{
34 dad5e576 Kevin Wolf
	_cleanup_test_img
35 dad5e576 Kevin Wolf
}
36 dad5e576 Kevin Wolf
trap "_cleanup; exit \$status" 0 1 2 3 15
37 dad5e576 Kevin Wolf
38 dad5e576 Kevin Wolf
# get standard environment, filters and checks
39 dad5e576 Kevin Wolf
. ./common.rc
40 dad5e576 Kevin Wolf
. ./common.filter
41 dad5e576 Kevin Wolf
42 b84762e2 Stefan Hajnoczi
_supported_fmt qcow2
43 dad5e576 Kevin Wolf
_supported_proto generic
44 dad5e576 Kevin Wolf
_supported_os Linux
45 dad5e576 Kevin Wolf
46 dad5e576 Kevin Wolf
47 dad5e576 Kevin Wolf
size=6G
48 dad5e576 Kevin Wolf
CLUSTER_SIZE=512
49 dad5e576 Kevin Wolf
50 dad5e576 Kevin Wolf
echo
51 dad5e576 Kevin Wolf
echo "creating image"
52 dad5e576 Kevin Wolf
_make_test_img $size
53 dad5e576 Kevin Wolf
54 dad5e576 Kevin Wolf
function generate_requests() {
55 dad5e576 Kevin Wolf
    for i in $(seq 0 63); do
56 dad5e576 Kevin Wolf
        echo "aio_write ${i}M 512"
57 dad5e576 Kevin Wolf
        echo "aio_write ${i}M 512"
58 dad5e576 Kevin Wolf
        echo "aio_write ${i}M 512"
59 dad5e576 Kevin Wolf
    done
60 dad5e576 Kevin Wolf
}
61 dad5e576 Kevin Wolf
62 dad5e576 Kevin Wolf
generate_requests | $QEMU_IO $TEST_IMG | _filter_qemu_io |\
63 dad5e576 Kevin Wolf
	sed -e 's/bytes at offset [0-9]*/bytes at offset XXX/g'
64 dad5e576 Kevin Wolf
65 dad5e576 Kevin Wolf
echo
66 dad5e576 Kevin Wolf
echo "checking image for errors"
67 dad5e576 Kevin Wolf
_check_test_img
68 dad5e576 Kevin Wolf
69 dad5e576 Kevin Wolf
# success, all done
70 dad5e576 Kevin Wolf
echo "*** done"
71 dad5e576 Kevin Wolf
rm -f $seq.full
72 dad5e576 Kevin Wolf
status=0