1321fd7d2SMax Reitz#!/bin/bash 2321fd7d2SMax Reitz# 3321fd7d2SMax Reitz# Test case for deleting a backing file 4321fd7d2SMax Reitz# 5321fd7d2SMax Reitz# Copyright (C) 2013 Red Hat, Inc. 6321fd7d2SMax Reitz# 7321fd7d2SMax Reitz# This program is free software; you can redistribute it and/or modify 8321fd7d2SMax Reitz# it under the terms of the GNU General Public License as published by 9321fd7d2SMax Reitz# the Free Software Foundation; either version 2 of the License, or 10321fd7d2SMax Reitz# (at your option) any later version. 11321fd7d2SMax Reitz# 12321fd7d2SMax Reitz# This program is distributed in the hope that it will be useful, 13321fd7d2SMax Reitz# but WITHOUT ANY WARRANTY; without even the implied warranty of 14321fd7d2SMax Reitz# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15321fd7d2SMax Reitz# GNU General Public License for more details. 16321fd7d2SMax Reitz# 17321fd7d2SMax Reitz# You should have received a copy of the GNU General Public License 18321fd7d2SMax Reitz# along with this program. If not, see <http://www.gnu.org/licenses/>. 19321fd7d2SMax Reitz# 20321fd7d2SMax Reitz 21321fd7d2SMax Reitz# creator 22321fd7d2SMax Reitzowner=mreitz@redhat.com 23321fd7d2SMax Reitz 24321fd7d2SMax Reitzseq="$(basename $0)" 25321fd7d2SMax Reitzecho "QA output created by $seq" 26321fd7d2SMax Reitz 27321fd7d2SMax Reitzhere="$PWD" 28321fd7d2SMax Reitztmp=/tmp/$$ 29321fd7d2SMax Reitzstatus=1 # failure is the default! 30321fd7d2SMax Reitz 31321fd7d2SMax Reitz_cleanup() 32321fd7d2SMax Reitz{ 33321fd7d2SMax Reitz _cleanup_test_img 34321fd7d2SMax Reitz} 35321fd7d2SMax Reitztrap "_cleanup; exit \$status" 0 1 2 3 15 36321fd7d2SMax Reitz 37321fd7d2SMax Reitz# get standard environment, filters and checks 38321fd7d2SMax Reitz. ./common.rc 39321fd7d2SMax Reitz. ./common.filter 40321fd7d2SMax Reitz 41321fd7d2SMax Reitz_supported_fmt cow qed qcow qcow2 vmdk 42321fd7d2SMax Reitz_supported_proto generic 43321fd7d2SMax Reitz_supported_os Linux 44*d2329f27SFam Zheng_unsupported_imgopts "subformat=monolithicFlat" "subformat=twoGbMaxExtentFlat" 45321fd7d2SMax Reitz 46321fd7d2SMax ReitzIMG_SIZE=128K 47321fd7d2SMax Reitz 48321fd7d2SMax Reitzecho 49321fd7d2SMax Reitzecho "=== Creating an image with a backing file and deleting that file ===" 50321fd7d2SMax Reitzecho 51321fd7d2SMax ReitzTEST_IMG="$TEST_IMG.base" _make_test_img $IMG_SIZE 52321fd7d2SMax Reitz_make_test_img -b "$TEST_IMG.base" $IMG_SIZE 53321fd7d2SMax Reitzrm -f "$TEST_IMG.base" 54321fd7d2SMax Reitz# Just open the image and close it right again (this should print an error message) 55321fd7d2SMax Reitz$QEMU_IO -c quit "$TEST_IMG" 2>&1 | _filter_testdir | _filter_imgfmt 56321fd7d2SMax Reitz 57321fd7d2SMax Reitz# success, all done 58321fd7d2SMax Reitzecho "*** done" 59321fd7d2SMax Reitzrm -f $seq.full 60321fd7d2SMax Reitzstatus=0 61