1*bd91ecbfSKevin Wolf#!/bin/bash 2*bd91ecbfSKevin Wolf# 3*bd91ecbfSKevin Wolf# Test huge qcow2 images 4*bd91ecbfSKevin Wolf# 5*bd91ecbfSKevin Wolf# Copyright (C) 2013 Red Hat, Inc. 6*bd91ecbfSKevin Wolf# 7*bd91ecbfSKevin Wolf# This program is free software; you can redistribute it and/or modify 8*bd91ecbfSKevin Wolf# it under the terms of the GNU General Public License as published by 9*bd91ecbfSKevin Wolf# the Free Software Foundation; either version 2 of the License, or 10*bd91ecbfSKevin Wolf# (at your option) any later version. 11*bd91ecbfSKevin Wolf# 12*bd91ecbfSKevin Wolf# This program is distributed in the hope that it will be useful, 13*bd91ecbfSKevin Wolf# but WITHOUT ANY WARRANTY; without even the implied warranty of 14*bd91ecbfSKevin Wolf# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15*bd91ecbfSKevin Wolf# GNU General Public License for more details. 16*bd91ecbfSKevin Wolf# 17*bd91ecbfSKevin Wolf# You should have received a copy of the GNU General Public License 18*bd91ecbfSKevin Wolf# along with this program. If not, see <http://www.gnu.org/licenses/>. 19*bd91ecbfSKevin Wolf# 20*bd91ecbfSKevin Wolf 21*bd91ecbfSKevin Wolf# creator 22*bd91ecbfSKevin Wolfowner=kwolf@redhat.com 23*bd91ecbfSKevin Wolf 24*bd91ecbfSKevin Wolfseq=`basename $0` 25*bd91ecbfSKevin Wolfecho "QA output created by $seq" 26*bd91ecbfSKevin Wolf 27*bd91ecbfSKevin Wolfhere=`pwd` 28*bd91ecbfSKevin Wolftmp=/tmp/$$ 29*bd91ecbfSKevin Wolfstatus=1 # failure is the default! 30*bd91ecbfSKevin Wolf 31*bd91ecbfSKevin Wolf_cleanup() 32*bd91ecbfSKevin Wolf{ 33*bd91ecbfSKevin Wolf _cleanup_test_img 34*bd91ecbfSKevin Wolf} 35*bd91ecbfSKevin Wolftrap "_cleanup; exit \$status" 0 1 2 3 15 36*bd91ecbfSKevin Wolf 37*bd91ecbfSKevin Wolf# get standard environment, filters and checks 38*bd91ecbfSKevin Wolf. ./common.rc 39*bd91ecbfSKevin Wolf. ./common.filter 40*bd91ecbfSKevin Wolf 41*bd91ecbfSKevin Wolf_supported_fmt qcow2 42*bd91ecbfSKevin Wolf_supported_proto generic 43*bd91ecbfSKevin Wolf_supported_os Linux 44*bd91ecbfSKevin Wolf 45*bd91ecbfSKevin Wolfecho 46*bd91ecbfSKevin Wolfecho "creating too large image (1 EB)" 47*bd91ecbfSKevin Wolf_make_test_img $((1024*1024))T 48*bd91ecbfSKevin Wolf 49*bd91ecbfSKevin Wolfecho 50*bd91ecbfSKevin Wolfecho "creating too large image (1 EB) using qcow2.py" 51*bd91ecbfSKevin Wolf_make_test_img 4G 52*bd91ecbfSKevin Wolf./qcow2.py $TEST_IMG set-header size $((1024 ** 6)) 53*bd91ecbfSKevin Wolf_check_test_img 54*bd91ecbfSKevin Wolf 55*bd91ecbfSKevin Wolf# success, all done 56*bd91ecbfSKevin Wolfecho "*** done" 57*bd91ecbfSKevin Wolfrm -f $seq.full 58*bd91ecbfSKevin Wolfstatus=0 59