1*c4d01535SMax Reitz#!/bin/bash 2*c4d01535SMax Reitz# 3*c4d01535SMax Reitz# Test case for non-existing backing file when creating a qcow2 image 4*c4d01535SMax Reitz# and not specifying the size 5*c4d01535SMax Reitz# 6*c4d01535SMax Reitz# Copyright (C) 2014 Red Hat, Inc. 7*c4d01535SMax Reitz# 8*c4d01535SMax Reitz# This program is free software; you can redistribute it and/or modify 9*c4d01535SMax Reitz# it under the terms of the GNU General Public License as published by 10*c4d01535SMax Reitz# the Free Software Foundation; either version 2 of the License, or 11*c4d01535SMax Reitz# (at your option) any later version. 12*c4d01535SMax Reitz# 13*c4d01535SMax Reitz# This program is distributed in the hope that it will be useful, 14*c4d01535SMax Reitz# but WITHOUT ANY WARRANTY; without even the implied warranty of 15*c4d01535SMax Reitz# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16*c4d01535SMax Reitz# GNU General Public License for more details. 17*c4d01535SMax Reitz# 18*c4d01535SMax Reitz# You should have received a copy of the GNU General Public License 19*c4d01535SMax Reitz# along with this program. If not, see <http://www.gnu.org/licenses/>. 20*c4d01535SMax Reitz# 21*c4d01535SMax Reitz 22*c4d01535SMax Reitz# creator 23*c4d01535SMax Reitzowner=mreitz@redhat.com 24*c4d01535SMax Reitz 25*c4d01535SMax Reitzseq="$(basename $0)" 26*c4d01535SMax Reitzecho "QA output created by $seq" 27*c4d01535SMax Reitz 28*c4d01535SMax Reitzhere="$PWD" 29*c4d01535SMax Reitztmp=/tmp/$$ 30*c4d01535SMax Reitzstatus=1 # failure is the default! 31*c4d01535SMax Reitz 32*c4d01535SMax Reitz_cleanup() 33*c4d01535SMax Reitz{ 34*c4d01535SMax Reitz _cleanup_test_img 35*c4d01535SMax Reitz} 36*c4d01535SMax Reitztrap "_cleanup; exit \$status" 0 1 2 3 15 37*c4d01535SMax Reitz 38*c4d01535SMax Reitz# get standard environment, filters and checks 39*c4d01535SMax Reitz. ./common.rc 40*c4d01535SMax Reitz. ./common.filter 41*c4d01535SMax Reitz 42*c4d01535SMax Reitz_supported_fmt qed qcow qcow2 vmdk 43*c4d01535SMax Reitz_supported_proto file 44*c4d01535SMax Reitz_supported_os Linux 45*c4d01535SMax Reitz_unsupported_imgopts "subformat=monolithicFlat" "subformat=twoGbMaxExtentFlat" 46*c4d01535SMax Reitz 47*c4d01535SMax Reitz$QEMU_IMG create -f $IMGFMT -b "$TEST_IMG.inexistent" "$TEST_IMG" 2>&1 \ 48*c4d01535SMax Reitz | _filter_testdir | _filter_imgfmt 49*c4d01535SMax Reitz 50*c4d01535SMax Reitz# success, all done 51*c4d01535SMax Reitzecho '*** done' 52*c4d01535SMax Reitzrm -f $seq.full 53*c4d01535SMax Reitzstatus=0 54