xref: /openbmc/qemu/tests/qemu-iotests/079 (revision fef80ea073c4862bc9eaddb6ddb0ed970b8ad7c4)
111a82d14SPhilippe Mathieu-Daudé#!/usr/bin/env bash
2*9dd003a9SVladimir Sementsov-Ogievskiy# group: rw auto
3693a50adSHu Tao#
4693a50adSHu Tao# Test qcow2 preallocation with different cluster_sizes
5693a50adSHu Tao#
6693a50adSHu Tao# Copyright (C) 2014 Fujitsu.
7693a50adSHu Tao#
8693a50adSHu Tao# This program is free software; you can redistribute it and/or modify
9693a50adSHu Tao# it under the terms of the GNU General Public License as published by
10693a50adSHu Tao# the Free Software Foundation; either version 2 of the License, or
11693a50adSHu Tao# (at your option) any later version.
12693a50adSHu Tao#
13693a50adSHu Tao# This program is distributed in the hope that it will be useful,
14693a50adSHu Tao# but WITHOUT ANY WARRANTY; without even the implied warranty of
15693a50adSHu Tao# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16693a50adSHu Tao# GNU General Public License for more details.
17693a50adSHu Tao#
18693a50adSHu Tao# You should have received a copy of the GNU General Public License
19693a50adSHu Tao# along with this program.  If not, see <http://www.gnu.org/licenses/>.
20693a50adSHu Tao#
21693a50adSHu Tao
22693a50adSHu Tao# creator
23693a50adSHu Taoowner=hutao@cn.fujitsu.com
24693a50adSHu Tao
25693a50adSHu Taoseq=`basename $0`
26693a50adSHu Taoecho "QA output created by $seq"
27693a50adSHu Tao
28693a50adSHu Taostatus=1	# failure is the default!
29693a50adSHu Tao
30693a50adSHu Tao_cleanup()
31693a50adSHu Tao{
32693a50adSHu Tao	_cleanup_test_img
33693a50adSHu Tao}
34693a50adSHu Taotrap "_cleanup; exit \$status" 0 1 2 3 15
35693a50adSHu Tao
36693a50adSHu Tao# get standard environment, filters and checks
37693a50adSHu Tao. ./common.rc
38693a50adSHu Tao. ./common.filter
39693a50adSHu Tao
40693a50adSHu Tao_supported_fmt qcow2
4157284d2aSMax Reitz_supported_proto file nfs fuse
42693a50adSHu Tao
43178d383fSThomas Huth# Some containers (e.g. non-x86 on Travis) do not allow large files
44178d383fSThomas Huth_require_large_file 4G
45178d383fSThomas Huth
46693a50adSHu Taoecho "=== Check option preallocation and cluster_size ==="
47693a50adSHu Taoecho
48693a50adSHu Taocluster_sizes="16384 32768 65536 131072 262144 524288 1048576 2097152 4194304"
49693a50adSHu Tao
50693a50adSHu Taofor s in $cluster_sizes; do
51407fb56aSMax Reitz    _make_test_img -o "preallocation=metadata,cluster_size=$s" 4G
52693a50adSHu Taodone
53693a50adSHu Tao
54693a50adSHu Tao# success, all done
55693a50adSHu Taoecho "*** done"
56693a50adSHu Taorm -f $seq.full
57693a50adSHu Taostatus=0
58