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