blob: cd69aecf930384ae9c88752bc659f6ac7dc80d4a [file] [log] [blame]
Andrew Geissler0205e8d2016-08-10 07:46:19 -05001#!/bin/bash -xe
2#
3# Build the required docker image to run QEMU and Robot test cases
4#
5# Parameters:
6# parm1: <optional, the name of the docker image to generate>
7# default is openbmc/ubuntu-robot-qemu
8
9set -uo pipefail
10
11DOCKER_IMG_NAME=${1:-"openbmc/ubuntu-robot-qemu"}
12
13# Determine our architecture, ppc64le or the other one
14if [ $(uname -m) == "ppc64le" ]; then
15 DOCKER_BASE="ppc64le/"
16else
17 DOCKER_BASE=""
18fi
19
20################################# docker img # #################################
21# Create docker image that can run QEMU and Robot Tests
22Dockerfile=$(cat << EOF
23FROM ${DOCKER_BASE}ubuntu:latest
24
25ENV DEBIAN_FRONTEND noninteractive
26
27RUN apt-get update && apt-get install -yy \
28 debianutils \
29 gawk \
30 git \
31 python \
32 python-dev \
33 python-setuptools \
34 socat \
35 texinfo \
36 wget \
37 gcc \
38 libffi-dev \
39 libssl-dev \
40 xterm \
41 mwm \
42 ssh \
43 vim \
44 iputils-ping \
45 sudo \
46 cpio \
47 unzip \
48 diffstat \
49 expect \
Rahul Maheshwari6b9bb1e2017-03-13 06:56:12 -050050 curl \
51 build-essential
Andrew Geissler0205e8d2016-08-10 07:46:19 -050052
53RUN easy_install \
54 tox \
55 pip \
56 requests
57
58RUN pip install \
59 robotframework \
60 robotframework-requests \
61 robotframework-sshlibrary \
62 robotframework-scplibrary
63
Rahul Maheshwari6b9bb1e2017-03-13 06:56:12 -050064RUN wget https://sourceforge.net/projects/ipmitool/files/ipmitool/1.8.18/ipmitool-1.8.18.tar.bz2
65RUN tar xvfj ipmitool-*.tar.bz2
66RUN ./ipmitool-1.8.18/configure
67RUN make
68RUN make install
69
Andrew Geissler0205e8d2016-08-10 07:46:19 -050070RUN grep -q ${GROUPS} /etc/group || groupadd -g ${GROUPS} ${USER}
71RUN grep -q ${UID} /etc/passwd || useradd -d ${HOME} -m -u ${UID} -g ${GROUPS} \
72 ${USER}
73USER ${USER}
74ENV HOME ${HOME}
75RUN /bin/bash
76EOF
77)
78
79################################# docker img # #################################
80
81# Build above image
82docker build -t ${DOCKER_IMG_NAME} - <<< "${Dockerfile}"