blob: d14b25a710478c12059751cf4f6768e639cb106d [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 \
Saqib Khan362ca852017-03-21 10:48:46 -050034 python3 \
35 python3-dev \
36 python3-setuptools \
Andrew Geissler0205e8d2016-08-10 07:46:19 -050037 socat \
38 texinfo \
39 wget \
40 gcc \
41 libffi-dev \
42 libssl-dev \
43 xterm \
44 mwm \
45 ssh \
46 vim \
47 iputils-ping \
48 sudo \
49 cpio \
50 unzip \
51 diffstat \
52 expect \
Rahul Maheshwari6b9bb1e2017-03-13 06:56:12 -050053 curl \
Andrew Geissler7a88f292018-01-04 15:16:02 -060054 build-essential \
55 libpixman-1-0 \
Michael Walshf1e83762018-03-28 15:51:43 -050056 libglib2.0-0 \
Andrew Jeffery6ba68142018-04-05 13:30:52 +093057 sshpass \
58 libasound2 \
59 libfdt1 \
60 libpcre3
Andrew Geissler0205e8d2016-08-10 07:46:19 -050061
62RUN easy_install \
63 tox \
64 pip \
65 requests
66
67RUN pip install \
Alanny Lopez8594e432017-05-17 15:42:59 -050068 json2yaml \
Andrew Geissler0205e8d2016-08-10 07:46:19 -050069 robotframework \
70 robotframework-requests \
71 robotframework-sshlibrary \
Sunil M55d0d752018-03-22 07:04:17 -050072 robotframework-scplibrary \
73 pysnmp
Andrew Geissler0205e8d2016-08-10 07:46:19 -050074
Rahul Maheshwari6b9bb1e2017-03-13 06:56:12 -050075RUN wget https://sourceforge.net/projects/ipmitool/files/ipmitool/1.8.18/ipmitool-1.8.18.tar.bz2
76RUN tar xvfj ipmitool-*.tar.bz2
77RUN ./ipmitool-1.8.18/configure
78RUN make
79RUN make install
80
Andrew Geissler0205e8d2016-08-10 07:46:19 -050081RUN grep -q ${GROUPS} /etc/group || groupadd -g ${GROUPS} ${USER}
82RUN grep -q ${UID} /etc/passwd || useradd -d ${HOME} -m -u ${UID} -g ${GROUPS} \
83 ${USER}
84USER ${USER}
85ENV HOME ${HOME}
86RUN /bin/bash
87EOF
88)
89
90################################# docker img # #################################
91
92# Build above image
93docker build -t ${DOCKER_IMG_NAME} - <<< "${Dockerfile}"