Script which launches QEMU and runs robot CI test against it
This script will be run within automation to do a basic QEMU
CI test against the input openbmc build.
Change-Id: I6ffccd7f5767bec9bc673b1a41bd7bd1d960924c
Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
diff --git a/scripts/build-qemu-robot-docker.sh b/scripts/build-qemu-robot-docker.sh
new file mode 100755
index 0000000..d1339ac
--- /dev/null
+++ b/scripts/build-qemu-robot-docker.sh
@@ -0,0 +1,75 @@
+#!/bin/bash -xe
+#
+# Build the required docker image to run QEMU and Robot test cases
+#
+# Parameters:
+# parm1: <optional, the name of the docker image to generate>
+# default is openbmc/ubuntu-robot-qemu
+
+set -uo pipefail
+
+DOCKER_IMG_NAME=${1:-"openbmc/ubuntu-robot-qemu"}
+
+# Determine our architecture, ppc64le or the other one
+if [ $(uname -m) == "ppc64le" ]; then
+ DOCKER_BASE="ppc64le/"
+else
+ DOCKER_BASE=""
+fi
+
+################################# docker img # #################################
+# Create docker image that can run QEMU and Robot Tests
+Dockerfile=$(cat << EOF
+FROM ${DOCKER_BASE}ubuntu:latest
+
+ENV DEBIAN_FRONTEND noninteractive
+
+RUN apt-get update && apt-get install -yy \
+ debianutils \
+ gawk \
+ git \
+ python \
+ python-dev \
+ python-setuptools \
+ socat \
+ texinfo \
+ wget \
+ gcc \
+ libffi-dev \
+ libssl-dev \
+ xterm \
+ mwm \
+ ssh \
+ vim \
+ iputils-ping \
+ sudo \
+ cpio \
+ unzip \
+ diffstat \
+ expect \
+ curl
+
+RUN easy_install \
+ tox \
+ pip \
+ requests
+
+RUN pip install \
+ robotframework \
+ robotframework-requests \
+ robotframework-sshlibrary \
+ robotframework-scplibrary
+
+RUN grep -q ${GROUPS} /etc/group || groupadd -g ${GROUPS} ${USER}
+RUN grep -q ${UID} /etc/passwd || useradd -d ${HOME} -m -u ${UID} -g ${GROUPS} \
+ ${USER}
+USER ${USER}
+ENV HOME ${HOME}
+RUN /bin/bash
+EOF
+)
+
+################################# docker img # #################################
+
+# Build above image
+docker build -t ${DOCKER_IMG_NAME} - <<< "${Dockerfile}"