xref: /openbmc/qemu/tests/qemu-iotests/054 (revision 11a82d14293cd66f428f535741717ff338c0722b)
1*11a82d14SPhilippe Mathieu-Daudé#!/usr/bin/env 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 Wolfstatus=1	# failure is the default!
28bd91ecbfSKevin Wolf
29bd91ecbfSKevin Wolf_cleanup()
30bd91ecbfSKevin Wolf{
31bd91ecbfSKevin Wolf	_cleanup_test_img
32bd91ecbfSKevin Wolf}
33bd91ecbfSKevin Wolftrap "_cleanup; exit \$status" 0 1 2 3 15
34bd91ecbfSKevin Wolf
35bd91ecbfSKevin Wolf# get standard environment, filters and checks
36bd91ecbfSKevin Wolf. ./common.rc
37bd91ecbfSKevin Wolf. ./common.filter
38bd91ecbfSKevin Wolf
39bd91ecbfSKevin Wolf_supported_fmt qcow2
401f7bf7d0SPeter Lieven_supported_proto file
41bd91ecbfSKevin Wolf_supported_os Linux
42bd91ecbfSKevin Wolf
43bd91ecbfSKevin Wolfecho
44bd91ecbfSKevin Wolfecho "creating too large image (1 EB)"
45bd91ecbfSKevin Wolf_make_test_img $((1024*1024))T
46bd91ecbfSKevin Wolf
47bd91ecbfSKevin Wolfecho
48bd91ecbfSKevin Wolfecho "creating too large image (1 EB) using qcow2.py"
49bd91ecbfSKevin Wolf_make_test_img 4G
50ea81ca9dSMax Reitz$PYTHON qcow2.py "$TEST_IMG" set-header size $((1024 ** 6))
51bd91ecbfSKevin Wolf_check_test_img
52bd91ecbfSKevin Wolf
53bd91ecbfSKevin Wolf# success, all done
54bd91ecbfSKevin Wolfecho "*** done"
55bd91ecbfSKevin Wolfrm -f $seq.full
56bd91ecbfSKevin Wolfstatus=0
57