#!/bin/bash
#
# Test preallocated resize of raw images
#
# Copyright (C) 2017 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

# creator
owner=mreitz@redhat.com

seq=$(basename $0)
echo "QA output created by $seq"

here=$PWD
status=1	# failure is the default!

_cleanup()
{
	_cleanup_test_img
}
trap "_cleanup; exit \$status" 0 1 2 3 15

# get standard environment and filters
. ./common.rc
. ./common.filter

_supported_fmt raw
_supported_proto file
_supported_os Linux

# in kB
CREATION_SIZE=128
GROWTH_SIZE=256

echo '=== Testing image growth ==='

for create_mode in off falloc full; do
    for growth_mode in off falloc full; do
        echo
        echo "--- create_mode=$create_mode growth_mode=$growth_mode ---"

        IMGOPTS="preallocation=$create_mode" _make_test_img ${CREATION_SIZE}K
        $QEMU_IMG resize -f "$IMGFMT" --preallocation=$growth_mode "$TEST_IMG" +${GROWTH_SIZE}K

        expected_size=0
        if [ $create_mode != off ]; then
            expected_size=$CREATION_SIZE
        fi
        if [ $growth_mode != off ]; then
            expected_size=$((expected_size + $GROWTH_SIZE))
        fi

        actual_size=$($QEMU_IMG info -f "$IMGFMT" "$TEST_IMG" | grep 'disk size')
        actual_size=$(echo "$actual_size" | sed -e 's/^[^0-9]*\([0-9]\+\).*$/\1/')

        # The actual size may exceed the expected size, depending on the file
        # system. Therefore we just test that the actual size is at least what
        # we expect.
        if [ $actual_size -lt $expected_size ]; then
            echo "ERROR: Image should have at least ${expected_size}K, but has ${actual_size}K"
        fi
    done
done

echo
echo '=== Testing image shrinking ==='

# None of this should work except for "off", because other modes cannot be used
# for shrinking
for growth_mode in falloc full off; do
    echo
    echo "--- growth_mode=$growth_mode ---"
    $QEMU_IMG resize -f "$IMGFMT" --shrink --preallocation=$growth_mode "$TEST_IMG" -${GROWTH_SIZE}K
done

echo
echo '=== Testing image growth on 2G empty image ==='

for growth_mode in falloc full; do
    echo
    echo "--- growth_mode=$growth_mode ---"

    # Maybe we want to do an lseek() to the end of the file before the
    # preallocation; if the file has a length of 2 GB, that would
    # return an integer that overflows to negative when put into a
    # plain int.  We should use the correct type for the result, and
    # this tests we do.

    _make_test_img 2G
    $QEMU_IMG resize -f "$IMGFMT" --preallocation=$growth_mode "$TEST_IMG" +${GROWTH_SIZE}K

    actual_size=$($QEMU_IMG info -f "$IMGFMT" "$TEST_IMG" | grep 'disk size')
    actual_size=$(echo "$actual_size" | sed -e 's/^[^0-9]*\([0-9]\+\).*$/\1/')

    if [ $actual_size -lt $GROWTH_SIZE ]; then
        echo "ERROR: Image should have at least ${GROWTH_SIZE}K, but has ${actual_size}K"
    fi
done

# success, all done
echo '*** done'
rm -f $seq.full
status=0
