#!/bin/bash
#
# qemu-img measure sub-command tests
#
# 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=stefanha@redhat.com

seq=`basename $0`
echo "QA output created by $seq"

status=1    # failure is the default!

_cleanup()
{
    _cleanup_test_img
    rm -f "$TEST_IMG.converted"
}
trap "_cleanup; exit \$status" 0 1 2 3 15

# get standard environment, filters and checks
. ./common.rc
. ./common.filter
. ./common.pattern

_supported_fmt raw qcow2
_supported_proto file
_supported_os Linux

echo "== Input validation =="
echo

_make_test_img 1G

$QEMU_IMG measure # missing arguments
$QEMU_IMG measure --size 2G "$TEST_IMG" # only one allowed
$QEMU_IMG measure "$TEST_IMG" a # only one filename allowed
$QEMU_IMG measure --object secret,id=sec0,data=MTIzNDU2,format=base64 # missing filename
$QEMU_IMG measure --image-opts # missing filename
$QEMU_IMG measure -f qcow2 # missing filename
$QEMU_IMG measure -l snap1 # missing filename
$QEMU_IMG measure -o , # invalid option list
$QEMU_IMG measure -l snapshot.foo # invalid snapshot option
$QEMU_IMG measure --output foo # invalid output format
$QEMU_IMG measure --size -1 # invalid image size
$QEMU_IMG measure -O foo "$TEST_IMG" # unknown image file format

make_test_img_with_fmt() {
    # Shadow global variables within this function
    local IMGFMT="$1" IMGOPTS=""
    _make_test_img "$2"
}

qemu_io_with_fmt() {
    # Shadow global variables within this function
    local QEMU_IO_OPTIONS=$(echo "$QEMU_IO_OPTIONS" | sed "s/-f $IMGFMT/-f $1/")
    shift
    $QEMU_IO "$@"
}

# The proof is in the pudding: converted image size cannot be larger than the
# required size.
#
# Note: if a change to the image format code causes the file size to change,
# then this test fails!  This is good because it's a reminder to check that the
# required size is still at least as big as the actual converted file size.
convert_and_show_size() {
    local fmt="$1"
    shift
    $QEMU_IMG convert -f "$fmt" -O "$IMGFMT" "$TEST_IMG" "$@" "$TEST_IMG.converted"
    stat -c "converted image file size in bytes: %s" "$TEST_IMG.converted"
}

for ofmt in human json; do
    echo
    echo "== Size calculation for a new file ($ofmt) =="
    echo

    # Try a few interesting sizes
    $QEMU_IMG measure --output=$ofmt -O "$IMGFMT" --size 0
    $QEMU_IMG measure --output=$ofmt -O "$IMGFMT" --size 2G
    $QEMU_IMG measure --output=$ofmt -O "$IMGFMT" --size 64G
    $QEMU_IMG measure --output=$ofmt -O "$IMGFMT" --size 256G
    $QEMU_IMG measure --output=$ofmt -O "$IMGFMT" --size 1T
    $QEMU_IMG measure --output=$ofmt -O "$IMGFMT" --size 2P
    $QEMU_IMG measure --output=$ofmt -O "$IMGFMT" --size 7E

    # Always test the raw input files but also IMGFMT
    for fmt in $(echo -e "raw\n$IMGFMT\n" | sort -u); do
        echo
        echo "== Empty $fmt input image ($ofmt) =="
        echo
        make_test_img_with_fmt "$fmt" 0
        $QEMU_IMG measure --output=$ofmt -f "$fmt" -O "$IMGFMT" "$TEST_IMG"
        echo
        convert_and_show_size "$fmt"

        echo
        echo "== $fmt input image with data ($ofmt) =="
        echo
        make_test_img_with_fmt "$fmt" 1G
        $QEMU_IMG measure --output=$ofmt -f "$fmt" -O "$IMGFMT" "$TEST_IMG"
        qemu_io_with_fmt "$fmt" -c "write 512 512" "$TEST_IMG" | _filter_qemu_io
        qemu_io_with_fmt "$fmt" -c "write 64K 64K" "$TEST_IMG" | _filter_qemu_io
        if [ "$fmt" = "qcow2" ]; then
            $QEMU_IMG snapshot -c snapshot1 "$TEST_IMG"
        fi
        qemu_io_with_fmt "$fmt" -c "write 128M 63K" "$TEST_IMG" | _filter_qemu_io
        $QEMU_IMG measure --output=$ofmt -f "$fmt" -O "$IMGFMT" "$TEST_IMG"
        echo
        convert_and_show_size "$fmt"

        if [ "$fmt" = "qcow2" ]; then
            echo
            echo "== $fmt input image with internal snapshot ($ofmt) =="
            echo
            $QEMU_IMG measure --output=$ofmt -f "$fmt" -l snapshot1 \
                              -O "$IMGFMT" "$TEST_IMG"
            echo
            convert_and_show_size "$fmt" -l snapshot1
        fi

        if [ "$IMGFMT" = "qcow2" ]; then
            echo
            echo "== $fmt input image and a backing file ($ofmt) =="
            echo
            # The backing file doesn't need to exist :)
            $QEMU_IMG measure --output=$ofmt -o backing_file=x \
                              -f "$fmt" -O "$IMGFMT" "$TEST_IMG"
        fi

        echo
        echo "== $fmt input image and preallocation ($ofmt) =="
        echo
        $QEMU_IMG measure --output=$ofmt -o preallocation=full \
                          -f "$fmt" -O "$IMGFMT" "$TEST_IMG"
        echo
        convert_and_show_size "$fmt" -o preallocation=full

        echo
        echo "== Fully-allocated $fmt input image ($ofmt) =="
        echo
        make_test_img_with_fmt "$fmt" 8M
        qemu_io_with_fmt "$fmt" -c "write 0 8M" "$TEST_IMG" | _filter_qemu_io
        $QEMU_IMG measure --output=$ofmt -f "$fmt" -O "$IMGFMT" "$TEST_IMG"
        echo
        convert_and_show_size "$fmt"
    done
done

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