#!/bin/bash
#
# XTF test utilities (x86_64).
#

# Arch-specific environment overrides.
function xtf_arch_prepare()
{
    export FW_PREFIX="${FW_PREFIX:-}"
    export QEMU_PREFIX="${QEMU_PREFIX:-}"
    export XEN_BINARY="${XEN_BINARY:-${WORKDIR}/xen}"
    export XEN_CMDLINE="${XEN_CMDLINE:-loglvl=all noreboot console_timestamps=boot console=com1}"
    export XTF_SRC_BRANCH="${XTF_SRC_BRANCH:-master}"
    export XTF_SRC_URI="${XTF_SRC_URI:-https://xenbits.xen.org/git-http/xtf.git}"
    export XTF_SRC_VARIANTS="hvm64 pv64"
}

# Perform arch-specific XTF environment setup.
function xtf_arch_setup()
{
    export TEST_CMD="${QEMU_PREFIX}qemu-system-x86_64 \
        -no-reboot \
        -nographic \
        -monitor none \
        -serial stdio \
        -m 2048 \
        -smp 2 \
        -kernel ${XEN_BINARY} \
        -initrd ${XTF_BINARY} \
        -append \"${XEN_CMDLINE}\" \
    "
}
