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