xref: /openbmc/qemu/tests/qemu-iotests/035 (revision 30edd9fa)
111a82d14SPhilippe Mathieu-Daudé#!/usr/bin/env 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 Wolfstatus=1	# failure is the default!
29dad5e576SKevin Wolf
30dad5e576SKevin Wolf_cleanup()
31dad5e576SKevin Wolf{
32dad5e576SKevin Wolf	_cleanup_test_img
33dad5e576SKevin Wolf}
34dad5e576SKevin Wolftrap "_cleanup; exit \$status" 0 1 2 3 15
35dad5e576SKevin Wolf
36dad5e576SKevin Wolf# get standard environment, filters and checks
37dad5e576SKevin Wolf. ./common.rc
38dad5e576SKevin Wolf. ./common.filter
39dad5e576SKevin Wolf
40b84762e2SStefan Hajnoczi_supported_fmt qcow2
41dad5e576SKevin Wolf_supported_proto generic
42dad5e576SKevin Wolf
43dad5e576SKevin Wolf
44dad5e576SKevin Wolfsize=6G
45dad5e576SKevin WolfCLUSTER_SIZE=512
46dad5e576SKevin Wolf
47dad5e576SKevin Wolfecho
48dad5e576SKevin Wolfecho "creating image"
49dad5e576SKevin Wolf_make_test_img $size
50dad5e576SKevin Wolf
518cedcffdSEric Blakegenerate_requests() {
52*30edd9faSThomas Huth    for ((i=0;i<=63;i++)); do
53dad5e576SKevin Wolf        echo "aio_write ${i}M 512"
54dad5e576SKevin Wolf        echo "aio_write ${i}M 512"
55dad5e576SKevin Wolf        echo "aio_write ${i}M 512"
56dad5e576SKevin Wolf    done
57dad5e576SKevin Wolf}
58dad5e576SKevin Wolf
59fef9c191SJeff Codygenerate_requests | $QEMU_IO "$TEST_IMG" | _filter_qemu_io |\
60dad5e576SKevin Wolf	sed -e 's/bytes at offset [0-9]*/bytes at offset XXX/g'
61dad5e576SKevin Wolf
62dad5e576SKevin Wolfecho
63dad5e576SKevin Wolfecho "checking image for errors"
64dad5e576SKevin Wolf_check_test_img
65dad5e576SKevin Wolf
66dad5e576SKevin Wolf# success, all done
67dad5e576SKevin Wolfecho "*** done"
68dad5e576SKevin Wolfrm -f $seq.full
69dad5e576SKevin Wolfstatus=0
70