summaryrefslogtreecommitdiff
path: root/ubuntu/scripts/qemu-system-tests.sh
blob: b681699508be1da1e198075a7c199866ced3e90f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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