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