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