diff options
Diffstat (limited to 'ubuntu/scripts/qemu-system-tests.sh')
-rwxr-xr-x | ubuntu/scripts/qemu-system-tests.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/ubuntu/scripts/qemu-system-tests.sh b/ubuntu/scripts/qemu-system-tests.sh new file mode 100755 index 0000000..b681699 --- /dev/null +++ b/ubuntu/scripts/qemu-system-tests.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# +# A simple wrapper to run a series of expect based system tests +# +# This expects the follow environment variables to be set: +# QEMU_BIN - path to binary +# QEMU_ARGS - arguments to run +# QEMU_MACHINE - machine type +# KERNEL_ARGS - arguments to kernel +# IMAGE - URL to image +# +# It expects the system test image to be in /home/image +# +# The expect script that will control QEMU, prefix will be qemu- and suffix .expect +# + +pushd `dirname $0` > /dev/null +BASE=`pwd -P` +popd > /dev/null + +IMAGE_FILE=${IMAGE##*/} +IMAGE_NAME=${IMAGE_FILE%.*} + +: ${KERNEL_IMAGE}=/home/image + +for test in $@; do + lava-test-case qemu-${test}-${QEMU_MACHINE}-${IMAGE_NAME} \ + --shell ${BASE}/qemu-${test}.expect ${QEMU_BIN} ${QEMU_ARGS} -machine type=${QEMU_MACHINE} \ + -kernel ${KERNEL_IMAGE} -append "${KERNEL_ARGS}" +done + |