#!/usr/bin/env bash
#
# Test writing image headers of other formats into raw images
#
# Copyright (C) 2014 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=kwolf@redhat.com

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

status=1	# failure is the default!

_cleanup()
{
    _cleanup_qemu
    _rm_test_img "$TEST_IMG.src"
    _cleanup_test_img
}
trap "_cleanup; exit \$status" 0 1 2 3 15

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

_supported_fmt raw
_supported_proto file
_supported_os Linux
_require_drivers qcow qcow2 qed vdi vmdk vpc

qemu_comm_method=qmp

run_qemu()
{
    local raw_img="$1"
    local source_img="$2"
    local qmp_format="$3"
    local qmp_event="$4"

    _launch_qemu -drive file="${source_img}",format=raw,cache=${CACHEMODE},aio=${AIOMODE},id=src
    _send_qemu_cmd $QEMU_HANDLE "{ 'execute': 'qmp_capabilities' }" "return"

    _send_qemu_cmd $QEMU_HANDLE \
        "{'execute':'drive-mirror', 'arguments':{
            'device': 'src', 'target': '$raw_img', $qmp_format
            'mode': 'existing', 'sync': 'full'}}" \
        "return"

    _send_qemu_cmd $QEMU_HANDLE '' "$qmp_event"
    if test "$qmp_event" = BLOCK_JOB_ERROR; then
        _send_qemu_cmd $QEMU_HANDLE '' '"status": "null"'
    fi
    _send_qemu_cmd $QEMU_HANDLE '{"execute":"query-block-jobs"}' "return"
    _send_qemu_cmd $QEMU_HANDLE '{"execute":"quit"}' "return"
    wait=1 _cleanup_qemu
}

for fmt in qcow qcow2 qed vdi vmdk vpc; do

    echo
    echo "=== Writing a $fmt header into raw ==="
    echo

    TEST_IMG="$TEST_IMG.src" IMGFMT=$fmt _make_test_img 64M
    _make_test_img $(du -b "$TEST_IMG.src" | cut -f1) | _filter_img_create_size

    # This first test should fail: The image format was probed, we may not
    # write an image header at the start of the image
    run_qemu "$TEST_IMG" "$TEST_IMG.src" "" "BLOCK_JOB_ERROR" |
        _filter_block_job_len
    $QEMU_IO -c 'read -P 0 0 512' "$TEST_IMG" | _filter_qemu_io


    # When raw was explicitly specified, the same must succeed
    run_qemu "$TEST_IMG" "$TEST_IMG.src" "'format': 'raw'," "BLOCK_JOB_READY"
    $QEMU_IMG compare -f raw -F raw "$TEST_IMG" "$TEST_IMG.src"

done


for sample_img in empty.bochs iotest-dirtylog-10G-4M.vhdx parallels-v1 \
                  simple-pattern.cloop; do

    echo
    echo "=== Copying sample image $sample_img into raw ==="
    echo

    # Can't use _use_sample_img because that isn't designed to be used multiple
    # times and it overwrites $TEST_IMG (both breaks cleanup)
    bzcat "$SAMPLE_IMG_DIR/$sample_img.bz2" > "$TEST_IMG.src"
    _make_test_img $(du -b "$TEST_IMG.src" | cut -f1) | _filter_img_create_size

    run_qemu "$TEST_IMG" "$TEST_IMG.src" "" "BLOCK_JOB_ERROR" |
        _filter_block_job_offset | _filter_block_job_len
    $QEMU_IO -c 'read -P 0 0 512' "$TEST_IMG" | _filter_qemu_io

    run_qemu "$TEST_IMG" "$TEST_IMG.src" "'format': 'raw'," "BLOCK_JOB_READY"
    $QEMU_IMG compare -f raw -F raw "$TEST_IMG" "$TEST_IMG.src"
done

echo
echo "=== Write legitimate MBR into raw ==="
echo

for sample_img in grub_mbr.raw; do
    bzcat "$SAMPLE_IMG_DIR/$sample_img.bz2" > "$TEST_IMG.src"
    _make_test_img $(du -b "$TEST_IMG.src" | cut -f1) | _filter_img_create_size

    run_qemu "$TEST_IMG" "$TEST_IMG.src" "" "BLOCK_JOB_READY"
    $QEMU_IMG compare -f raw -F raw "$TEST_IMG" "$TEST_IMG.src"

    run_qemu "$TEST_IMG" "$TEST_IMG.src" "'format': 'raw'," "BLOCK_JOB_READY"
    $QEMU_IMG compare -f raw -F raw "$TEST_IMG" "$TEST_IMG.src"
done


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