#!/usr/bin/env bash
#
# Test valid filenames for blkdebug and blkverify representatively for
# other protocols (such as NBD) when queried
#
# 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=mreitz@redhat.com

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

status=1	# failure is the default!

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

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

# Basically all formats, but "raw" has issues with _filter_imgfmt regarding the
# raw comparison image for blkverify; also, all images have to support creation
_supported_fmt qcow qcow2 qed vdi vhdx vmdk vpc
_supported_proto file
_supported_os Linux
_require_drivers blkdebug blkverify
_unsupported_imgopts "subformat=monolithicFlat" "subformat=twoGbMaxExtentFlat" \
    "subformat=twoGbMaxExtentSparse"

do_run_qemu()
{
    $QEMU -nographic -qmp stdio -serial none "$@"
}

run_qemu()
{
    # Get the "file": "foo" entry ($foo may only contain escaped double quotes,
    # which is how we can extract it)
    do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_imgfmt | _filter_qmp \
        | _filter_qemu | grep "drv0" \
        | sed -e 's/^.*"file": "\(\(\\"\|[^"]\)*\)".*$/\1/' -e 's/\\"/"/g'
}

test_qemu()
{
    run_qemu -drive "if=none,id=drv0,$1" <<EOF
        { 'execute': 'qmp_capabilities' }
        { 'execute': 'query-block' }
        { 'execute': 'quit' }
EOF
}



IMG_SIZE=128K

_make_test_img $IMG_SIZE
$QEMU_IMG create -f raw "$TEST_IMG.compare" $IMG_SIZE \
    | _filter_testdir | _filter_imgfmt

echo
echo '=== Testing simple filename for blkverify ==='
echo

# This should return simply the filename itself
test_qemu "file=blkverify:$TEST_IMG.compare:$TEST_IMG"

echo
echo '=== Testing filename reconstruction for blkverify ==='
echo

# This should return the same filename as above
test_qemu "file.driver=blkverify,file.raw.filename=$TEST_IMG.compare,file.test.file.filename=$TEST_IMG"

echo
echo '=== Testing JSON filename for blkdebug ==='
echo

# blkdebug cannot create a configuration file, therefore it is unable to
# generate a plain filename here; thus this should return a JSON filename
test_qemu "file.driver=blkdebug,file.image.filename=$TEST_IMG,file.inject-error.0.event=l1_update"

echo
echo '=== Testing indirectly enforced JSON filename ==='
echo

# Because blkdebug cannot return a plain filename, blkverify is forced to
# generate a JSON object here as well
test_qemu "file.driver=blkverify,file.raw.filename=$TEST_IMG.compare,file.test.file.driver=blkdebug,file.test.file.image.filename=$TEST_IMG,file.test.file.inject-error.0.event=l1_update"

echo
echo '=== Testing plain filename for blkdebug ==='
echo

touch "$TEST_DIR/blkdebug.conf"
test_qemu "file.driver=blkdebug,file.config=$TEST_DIR/blkdebug.conf,file.image.filename=$TEST_IMG"

echo
echo '=== Testing plain filename for blkdebug without configuration file ==='
echo

test_qemu "file.driver=blkdebug,file.image.filename=$TEST_IMG"


rm -f "$TEST_IMG.compare" "$TEST_DIR/blkdebug.conf"

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