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