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