#!/bin/bash
#
# Copyright (C) 2009 Red Hat, Inc.
# Copyright (c) 2000-2006 Silicon Graphics, Inc.  All Rights Reserved.
#
# 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/>.
#

dd()
{
   if [ "$HOSTOS" == "Linux" ]
   then	
	command dd --help | grep noxfer > /dev/null 2>&1
	
	if [ "$?" -eq 0 ]
	    then
		command dd status=noxfer $@
	    else
		command dd $@
    	fi
   else
	command dd $@
   fi
}

# we need common.config
if [ "$iam" != "check" ]
then
    if ! . ./common.config
        then
        echo "$iam: failed to source common.config"
        exit 1
    fi
fi

# make sure we have a standard umask
umask 022

if [ "$IMGPROTO" = "file" ]; then
    TEST_IMG=$TEST_DIR/t.$IMGFMT
elif [ "$IMGPROTO" = "nbd" ]; then
    TEST_IMG_FILE=$TEST_DIR/t.$IMGFMT
    TEST_IMG="nbd:127.0.0.1:10810"
elif [ "$IMGPROTO" = "ssh" ]; then
    TEST_IMG_FILE=$TEST_DIR/t.$IMGFMT
    TEST_IMG="ssh://127.0.0.1$TEST_IMG_FILE"
else
    TEST_IMG=$IMGPROTO:$TEST_DIR/t.$IMGFMT
fi

function valgrind_qemu_io()
{
    valgrind --log-file=/tmp/$$.valgrind --error-exitcode=99 $REAL_QEMU_IO "$@"
    if [ $? != 0 ]; then
        cat /tmp/$$.valgrind
    fi
    rm -f /tmp/$$.valgrind
}


_optstr_add()
{
    if [ -n "$1" ]; then
        echo "$1,$2"
    else
        echo "$2"
    fi
}

_set_default_imgopts()
{
    if [ "$IMGFMT" == "qcow2" ] && ! (echo "$IMGOPTS" | grep "compat=" > /dev/null); then
        IMGOPTS=$(_optstr_add "$IMGOPTS" "compat=1.1")
    fi
}

_make_test_img()
{
    # extra qemu-img options can be added by tests
    # at least one argument (the image size) needs to be added
    local extra_img_options=""
    local image_size=$*
    local optstr=""
    local img_name=""

    if [ -n "$TEST_IMG_FILE" ]; then
        img_name=$TEST_IMG_FILE
    else
        img_name=$TEST_IMG
    fi

    if [ -n "$IMGOPTS" ]; then
        optstr=$(_optstr_add "$optstr" "$IMGOPTS")
    fi

    if [ "$1" = "-b" ]; then
        extra_img_options="$1 $2"
        image_size=$3
    fi
    if [ \( "$IMGFMT" = "qcow2" -o "$IMGFMT" = "qed" \) -a -n "$CLUSTER_SIZE" ]; then
        optstr=$(_optstr_add "$optstr" "cluster_size=$CLUSTER_SIZE")
    fi

    if [ -n "$optstr" ]; then
        extra_img_options="-o $optstr $extra_img_options"
    fi

    # XXX(hch): have global image options?
    $QEMU_IMG create -f $IMGFMT $extra_img_options $img_name $image_size | \
        sed -e "s#$IMGPROTO:$TEST_DIR#TEST_DIR#g" \
            -e "s#$TEST_DIR#TEST_DIR#g" \
            -e "s#$IMGFMT#IMGFMT#g" \
            -e "s# encryption=off##g" \
            -e "s# cluster_size=[0-9]\\+##g" \
            -e "s# table_size=[0-9]\\+##g" \
            -e "s# compat='[^']*'##g" \
            -e "s# compat6=\\(on\\|off\\)##g" \
            -e "s# static=\\(on\\|off\\)##g" \
            -e "s# zeroed_grain=\\(on\\|off\\)##g" \
            -e "s# subformat='[^']*'##g" \
            -e "s# adapter_type='[^']*'##g" \
            -e "s# lazy_refcounts=\\(on\\|off\\)##g"

    # Start an NBD server on the image file, which is what we'll be talking to
    if [ $IMGPROTO = "nbd" ]; then
        eval "$QEMU_NBD -v -t -b 127.0.0.1 -p 10810  $TEST_IMG_FILE &"
        QEMU_NBD_PID=$!
        sleep 1 # FIXME: qemu-nbd needs to be listening before we continue
    fi
}

_cleanup_test_img()
{
    case "$IMGPROTO" in

        nbd)
            kill $QEMU_NBD_PID
            rm -f $TEST_IMG_FILE
            ;;
        file)
            rm -f $TEST_DIR/t.$IMGFMT
            rm -f $TEST_DIR/t.$IMGFMT.orig
            rm -f $TEST_DIR/t.$IMGFMT.base
            ;;

        rbd)
            rbd rm $TEST_DIR/t.$IMGFMT > /dev/null
            ;;

        sheepdog)
            collie vdi delete $TEST_DIR/t.$IMGFMT
            ;;

    esac
}

_check_test_img()
{
    $QEMU_IMG check "$@" -f $IMGFMT $TEST_IMG 2>&1 | \
        sed -e '/allocated.*fragmented.*compressed clusters/d' \
            -e 's/qemu-img: This image format does not support checks/No errors were found on the image./' \
            -e '/Image end offset: [0-9]\+/d'
}

_img_info()
{
    $QEMU_IMG info "$@" $TEST_IMG 2>&1 | \
        sed -e "s#$IMGPROTO:$TEST_DIR#TEST_DIR#g" \
            -e "s#$TEST_DIR#TEST_DIR#g" \
            -e "s#$IMGFMT#IMGFMT#g" \
            -e "/^disk size:/ D" \
            -e "/actual-size/ D"
}

_get_pids_by_name()
{
    if [ $# -ne 1 ]
    then
	echo "Usage: _get_pids_by_name process-name" 1>&2
	exit 1
    fi

    # Algorithm ... all ps(1) variants have a time of the form MM:SS or
    # HH:MM:SS before the psargs field, use this as the search anchor.
    #
    # Matches with $1 (process-name) occur if the first psarg is $1
    # or ends in /$1 ... the matching uses sed's regular expressions,
    # so passing a regex into $1 will work.

    ps $PS_ALL_FLAGS \
    | sed -n \
	-e 's/$/ /' \
	-e 's/[ 	][ 	]*/ /g' \
	-e 's/^ //' \
	-e 's/^[^ ]* //' \
	-e "/[0-9]:[0-9][0-9]  *[^ ]*\/$1 /s/ .*//p" \
	-e "/[0-9]:[0-9][0-9]  *$1 /s/ .*//p"
}

# fqdn for localhost
#
_get_fqdn()
{
    host=`hostname`
    $NSLOOKUP_PROG $host | $AWK_PROG '{ if ($1 == "Name:") print $2 }'
}

# check if run as root
#
_need_to_be_root()
{
    id=`id | $SED_PROG -e 's/(.*//' -e 's/.*=//'`
    if [ "$id" -ne 0 ]
    then
	echo "Arrgh ... you need to be root (not uid=$id) to run this test"
	exit 1
    fi
}


# Do a command, log it to $seq.full, optionally test return status
# and die if command fails. If called with one argument _do executes the
# command, logs it, and returns its exit status. With two arguments _do
# first prints the message passed in the first argument, and then "done"
# or "fail" depending on the return status of the command passed in the
# second argument. If the command fails and the variable _do_die_on_error
# is set to "always" or the two argument form is used and _do_die_on_error
# is set to "message_only" _do will print an error message to
# $seq.out and exit.

_do()
{
    if [ $# -eq 1 ]; then
	_cmd=$1
    elif [ $# -eq 2 ]; then
	_note=$1
	_cmd=$2
	echo -n "$_note... "
    else
	echo "Usage: _do [note] cmd" 1>&2
	status=1; exit
    fi

    (eval "echo '---' \"$_cmd\"") >>$here/$seq.full
    (eval "$_cmd") >$tmp._out 2>&1; ret=$?
    cat $tmp._out >>$here/$seq.full
    if [ $# -eq 2 ]; then
	if [ $ret -eq 0 ]; then
	    echo "done"
	else
	    echo "fail"
	fi
    fi
    if [ $ret -ne 0  ] \
	&& [ "$_do_die_on_error" = "always" \
	    -o \( $# -eq 2 -a "$_do_die_on_error" = "message_only" \) ]
    then
	[ $# -ne 2 ] && echo
	eval "echo \"$_cmd\" failed \(returned $ret\): see $seq.full"
	status=1; exit
    fi

    return $ret
}

# bail out, setting up .notrun file
#
_notrun()
{
    echo "$*" >$seq.notrun
    echo "$seq not run: $*"
    status=0
    exit
}

# just plain bail out
#
_fail()
{
    echo "$*" | tee -a $here/$seq.full
    echo "(see $seq.full for details)"
    status=1
    exit 1
}

# tests whether $IMGFMT is one of the supported image formats for a test
#
_supported_fmt()
{
    for f; do
	if [ "$f" = "$IMGFMT" -o "$f" = "generic" ]; then
	    return
	fi
    done

    _notrun "not suitable for this image format: $IMGFMT"
}

# tests whether $IMGPROTO is one of the supported image protocols for a test
#
_supported_proto()
{
    for f; do
	if [ "$f" = "$IMGPROTO" -o "$f" = "generic" ]; then
	    return
	fi
    done

    _notrun "not suitable for this image protocol: $IMGPROTO"
}

# tests whether the host OS is one of the supported OSes for a test
#
_supported_os()
{
    for h
    do
	if [ "$h" = "$HOSTOS" ]
	then
	    return
	fi
    done

    _notrun "not suitable for this OS: $HOSTOS"
}

_unsupported_qemu_io_options()
{
    for bad_opt
    do
        for opt in $QEMU_IO_OPTIONS
        do
            if [ "$bad_opt" = "$opt" ]
            then
                _notrun "not suitable for qemu-io option: $bad_opt"
            fi
        done
    done
}

# this test requires that a specified command (executable) exists
#
_require_command()
{
    [ -x "$1" ] || _notrun "$1 utility required, skipped this test"
}

_full_imgfmt_details()
{
    if [ -n "$IMGOPTS" ]; then
        echo "$IMGFMT ($IMGOPTS)"
    else
        echo "$IMGFMT"
    fi
}

_full_imgproto_details()
{
    echo "$IMGPROTO"
}

_full_platform_details()
{
    os=`uname -s`
    host=`hostname -s`
    kernel=`uname -r`
    platform=`uname -m`
    echo "$os/$platform $host $kernel"
}

_link_out_file()
{
   if [ -z "$1" ]; then
      echo Error must pass \$seq.
      exit
   fi
   rm -f $1
   if [ "`uname`" == "IRIX64" ] || [ "`uname`" == "IRIX" ]; then
      ln -s $1.irix $1
   elif [ "`uname`" == "Linux" ]; then
      ln -s $1.linux $1
   else
      echo Error test $seq does not run on the operating system: `uname`
      exit
   fi
}

_die()
{
        echo $@
        exit 1
}

# make sure this script returns success
/bin/true
