Allow a different qemu-system-arm to be passed to test scripts
The default qemu-system-arm used within the test automation pipeline
is currently hard coded to use the one within the bitbake image
under test. This commit allows more flexibility with the qemu tool
used.
Future commits will build upon this to allow using a
qemu-system-arm version which supports witherspoon and therefore
will enable regression testing of the witherspoon and other openbmc
platforms within QEMU.
There's a long term goal to ensure the bitbake image builds the
appropriate qemu-system-arm into itself but there are some complexities
with that.
Change-Id: I93d39bf8482acb8adbc2b1da2d805448af2bcf75
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/run-qemu-robot-test.sh b/run-qemu-robot-test.sh
index be87575..248e54d 100755
--- a/run-qemu-robot-test.sh
+++ b/run-qemu-robot-test.sh
@@ -36,6 +36,11 @@
# to do the runs. If specified k8s will launch a group of
# containers into a kubernetes cluster using the helper
# script.
+# QEMU_BIN = Location of qemu-system-arm binary to use when starting
+# QEMU relative to upstream workspace. Default is
+# ./tmp/sysroots/${QEMU_ARCH}/usr/bin/qemu-system-arm
+# which is the default location when doing a bitbake
+# of obmc-phosphor-image
#
###############################################################################
@@ -66,6 +71,9 @@
exit 1
esac
+# Set the location of the qemu binary relative to UPSTREAM_WORKSPACE
+QEMU_BIN=${QEMU_BIN:-./tmp/sysroots/${QEMU_ARCH}/usr/bin/qemu-system-arm}
+
# Get the base directory of the openbmc-build-scripts repo so we can return
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
@@ -86,6 +94,7 @@
--env HOME=${OBMC_BUILD_DIR} \
--env QEMU_RUN_TIMER=${QEMU_RUN_TIMER} \
--env QEMU_ARCH=${QEMU_ARCH} \
+ --env QEMU_BIN=${QEMU_BIN} \
--workdir "${OBMC_BUILD_DIR}" \
--volume "${UPSTREAM_WORKSPACE}":"${OBMC_BUILD_DIR}" \
--tty \
diff --git a/scripts/boot-qemu.sh b/scripts/boot-qemu.sh
index bb2e3e6..bf62ed0 100755
--- a/scripts/boot-qemu.sh
+++ b/scripts/boot-qemu.sh
@@ -19,6 +19,13 @@
# parm2: <optional, full path to base directory of qemu binary and images >
# default is ${HOME}
#
+# Optional Env Variable:
+#
+# QEMU_BIN = Location of qemu-system-arm binary to use when starting
+# QEMU relative to upstream workspace. Default is
+# ./tmp/sysroots/${QEMU_ARCH}/usr/bin/qemu-system-arm
+# which is the default location when doing a bitbake
+# of obmc-phosphor-image
###############################################################################
set -uo pipefail
@@ -39,6 +46,9 @@
exit -1
fi
+# Set the location of the qemu binary relative to BASE_DIR
+QEMU_BIN=${QEMU_BIN:-./tmp/sysroots/${QEMU_ARCH}/usr/bin/qemu-system-arm}
+
# Enter the base directory
cd ${BASE_DIR}
@@ -52,7 +62,7 @@
fi
# Launch QEMU using the qemu-system-arm
-./tmp/sysroots/${QEMU_ARCH}/usr/bin/qemu-system-arm \
+${QEMU_BIN} \
-device virtio-net,netdev=mynet \
-netdev user,id=mynet,hostfwd=tcp:${IP}:22-:22,hostfwd=tcp:${IP}:443-:443,hostfwd=tcp:${IP}:80-:80 \
-machine versatilepb \
diff --git a/scripts/build-qemu-robot-docker.sh b/scripts/build-qemu-robot-docker.sh
index 912a4fc..58b6fb0 100755
--- a/scripts/build-qemu-robot-docker.sh
+++ b/scripts/build-qemu-robot-docker.sh
@@ -51,7 +51,9 @@
diffstat \
expect \
curl \
- build-essential
+ build-essential \
+ libpixman-1-0 \
+ libglib2.0-0
RUN easy_install \
tox \