1*d1319b07SFam Zheng#!/bin/bash 2*d1319b07SFam Zheng# 3*d1319b07SFam Zheng# Create, read, write big image 4*d1319b07SFam Zheng# 5*d1319b07SFam Zheng# Copyright (C) 2014 Red Hat, Inc. 6*d1319b07SFam Zheng# 7*d1319b07SFam Zheng# This program is free software; you can redistribute it and/or modify 8*d1319b07SFam Zheng# it under the terms of the GNU General Public License as published by 9*d1319b07SFam Zheng# the Free Software Foundation; either version 2 of the License, or 10*d1319b07SFam Zheng# (at your option) any later version. 11*d1319b07SFam Zheng# 12*d1319b07SFam Zheng# This program is distributed in the hope that it will be useful, 13*d1319b07SFam Zheng# but WITHOUT ANY WARRANTY; without even the implied warranty of 14*d1319b07SFam Zheng# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15*d1319b07SFam Zheng# GNU General Public License for more details. 16*d1319b07SFam Zheng# 17*d1319b07SFam Zheng# You should have received a copy of the GNU General Public License 18*d1319b07SFam Zheng# along with this program. If not, see <http://www.gnu.org/licenses/>. 19*d1319b07SFam Zheng# 20*d1319b07SFam Zheng 21*d1319b07SFam Zheng# creator 22*d1319b07SFam Zhengowner=famz@redhat.com 23*d1319b07SFam Zheng 24*d1319b07SFam Zhengseq=`basename $0` 25*d1319b07SFam Zhengecho "QA output created by $seq" 26*d1319b07SFam Zheng 27*d1319b07SFam Zhenghere=`pwd` 28*d1319b07SFam Zhengtmp=/tmp/$$ 29*d1319b07SFam Zhengstatus=1 # failure is the default! 30*d1319b07SFam Zheng 31*d1319b07SFam Zheng_cleanup() 32*d1319b07SFam Zheng{ 33*d1319b07SFam Zheng _cleanup_test_img 34*d1319b07SFam Zheng} 35*d1319b07SFam Zhengtrap "_cleanup; exit \$status" 0 1 2 3 15 36*d1319b07SFam Zheng 37*d1319b07SFam Zheng# get standard environment, filters and checks 38*d1319b07SFam Zheng. ./common.rc 39*d1319b07SFam Zheng. ./common.filter 40*d1319b07SFam Zheng 41*d1319b07SFam Zheng_supported_fmt qcow2 vmdk vhdx qed 42*d1319b07SFam Zheng_supported_proto generic 43*d1319b07SFam Zheng_supported_os Linux 44*d1319b07SFam Zheng_unsupported_imgopts "subformat=twoGbMaxExtentFlat" \ 45*d1319b07SFam Zheng "subformat=twoGbMaxExtentSparse" 46*d1319b07SFam Zheng 47*d1319b07SFam Zhengecho 48*d1319b07SFam Zhengecho "creating large image" 49*d1319b07SFam Zheng_make_test_img 16T 50*d1319b07SFam Zheng 51*d1319b07SFam Zhengecho 52*d1319b07SFam Zhengecho "small read" 53*d1319b07SFam Zheng$QEMU_IO -c "read 1024 4096" "$TEST_IMG" | _filter_qemu_io 54*d1319b07SFam Zheng 55*d1319b07SFam Zhengecho 56*d1319b07SFam Zhengecho "small write" 57*d1319b07SFam Zheng$QEMU_IO -c "write 8192 4096" "$TEST_IMG" | _filter_qemu_io 58*d1319b07SFam Zheng 59*d1319b07SFam Zhengecho 60*d1319b07SFam Zhengecho "small read at high offset" 61*d1319b07SFam Zheng$QEMU_IO -c "read 14T 4096" "$TEST_IMG" | _filter_qemu_io 62*d1319b07SFam Zheng 63*d1319b07SFam Zhengecho 64*d1319b07SFam Zhengecho "small write at high offset" 65*d1319b07SFam Zheng$QEMU_IO -c "write 14T 4096" "$TEST_IMG" | _filter_qemu_io 66*d1319b07SFam Zheng 67*d1319b07SFam Zheng# success, all done 68*d1319b07SFam Zhengecho "*** done" 69*d1319b07SFam Zhengrm -f $seq.full 70*d1319b07SFam Zhengstatus=0 71