blob: 988dcbc4b898f9bfed6d5bddb20ff21727e78d18 [file] [log] [blame]
azvyagintsevf19ddc82018-02-20 18:39:32 +02001FROM ubuntu:16.04
azvyagintsevf19ddc82018-02-20 18:39:32 +02002LABEL maintainer="qa@mirantis.com"
3
4ARG TEMPEST_TAG="mcp/pike"
5# Tempest plugins
6ARG HORIZON_TAG="mcp/pike"
Ilya Menkovbf725142018-03-05 20:18:01 +04007ARG BARBICAN_TAG="mcp/pike"
azvyagintsevf19ddc82018-02-20 18:39:32 +02008ARG DESIGNATE_TAG="mcp/pike"
9ARG HEAT_TAG="mcp/pike"
Ilya Menkovbf725142018-03-05 20:18:01 +040010ARG IRONIC_TAG="mcp/pike"
11ARG MANILA_TAG="mcp/pike"
12ARG TELEMETRY_TAG="mcp/pike"
ibumarskov48ca2092018-10-18 13:49:17 +040013ARG PATROLE_TAG="0.4.x"
14ARG TUNGSTEN_TAG="0.1.x"
azvyagintsevf19ddc82018-02-20 18:39:32 +020015# global openstack requirements repo
sandriichenko3b17b482018-03-20 20:29:31 +020016# This is the commit where tempest version is 17.2.0 in u-c
17ARG UPPER_CONSTRAINTS_TAG="83b1de74834fbcdbe749e270c29e76cdc28f85d5"
Oleksii Butenko1fed0f02018-07-27 14:19:14 +030018
azvyagintsevf19ddc82018-02-20 18:39:32 +020019ENV DEBIAN_FRONTEND=noninteractive \
20 DEBCONF_NONINTERACTIVE_SEEN=true \
21 LANG=C.UTF-8 \
22 LANGUAGE=$LANG
23SHELL ["/bin/bash", "-xec"]
24USER root
25# pre-update
26RUN cd /etc/apt/ && echo > sources.list \
27 && echo "deb [arch=amd64] http://cz.archive.ubuntu.com/ubuntu xenial main restricted universe multiverse" >> sources.list \
28 && echo "deb [arch=amd64] http://cz.archive.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse" >> sources.list \
29 && echo "deb [arch=amd64] http://cz.archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse" >> sources.list \
30 && echo 'Acquire::Languages "none";' > apt.conf.d/docker-no-languages \
31 && echo 'Acquire::GzipIndexes "true"; Acquire::CompressionTypes::Order:: "gz";' > apt.conf.d/docker-gzip-indexes \
32 && echo 'APT::Get::Install-Recommends "false"; APT::Get::Install-Suggests "false";' > apt.conf.d/docker-recommends \
33 && apt-get update && apt-get upgrade -y \
sandriichenko3ac92e92018-10-30 15:04:55 +000034 && apt-get install -y vim-tiny git-core python-pip libffi-dev libssl-dev python-dev python3-dev iputils-ping patch openssh-server
35
36RUN mkdir -p /root/.ssh
37COPY bin/ssh/config /root/.ssh/
38COPY bin/ssh/mcp-jenkins.key /root/.ssh/
39RUN chmod 400 /root/.ssh/mcp-jenkins.key
azvyagintsevf19ddc82018-02-20 18:39:32 +020040
Maksym Shalamova95d7202018-04-19 17:21:19 +030041#Due to upstream bug we should use fixed version of pip
sgarbuz5d5631f2018-04-18 13:54:56 +030042RUN pip install -U 'pip==9.0.3'
azvyagintsevf19ddc82018-02-20 18:39:32 +020043WORKDIR /var/lib/
44# TODO migrate to downstrem mirror?
45RUN git clone https://github.com/openstack/requirements.git openstack_requirements && \
46 pushd openstack_requirements; git checkout $UPPER_CONSTRAINTS_TAG; popd ;
47
sandriichenko3ac92e92018-10-30 15:04:55 +000048RUN sed -i -e 's|tempest===17.2.0|git+ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/tempest@mcp/pike#egg=tempest|g' \
Maksym Shalamovdf54d202018-04-13 16:13:12 +030049 /var/lib/openstack_requirements/upper-constraints.txt;
50
sandriichenko3ac92e92018-10-30 15:04:55 +000051RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/tempest-horizon tempest-horizon-plugin; \
azvyagintsevf19ddc82018-02-20 18:39:32 +020052 pushd tempest-horizon-plugin ; git checkout $HORIZON_TAG; \
sandriichenko3ac92e92018-10-30 15:04:55 +000053 pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt ; \
sandriichenko3b17b482018-03-20 20:29:31 +020054 popd;
azvyagintsevf19ddc82018-02-20 18:39:32 +020055
sandriichenko3ac92e92018-10-30 15:04:55 +000056RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/barbican-tempest-plugin && \
azvyagintsevf19ddc82018-02-20 18:39:32 +020057 pushd barbican-tempest-plugin; git checkout $BARBICAN_TAG; \
sandriichenko3b17b482018-03-20 20:29:31 +020058 pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt . ; \
59 popd;
azvyagintsevf19ddc82018-02-20 18:39:32 +020060
sandriichenko3ac92e92018-10-30 15:04:55 +000061RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/designate-tempest-plugin && \
azvyagintsevf19ddc82018-02-20 18:39:32 +020062 pushd designate-tempest-plugin; git checkout $DESIGNATE_TAG; \
sandriichenko3b17b482018-03-20 20:29:31 +020063 pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt . ; \
64 popd;
azvyagintsevf19ddc82018-02-20 18:39:32 +020065
sandriichenko3ac92e92018-10-30 15:04:55 +000066RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/heat-tempest-plugin && \
azvyagintsevf19ddc82018-02-20 18:39:32 +020067 pushd heat-tempest-plugin; git checkout $HEAT_TAG; \
sandriichenko3b17b482018-03-20 20:29:31 +020068 pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt . ; \
69 popd;
azvyagintsevf19ddc82018-02-20 18:39:32 +020070
sandriichenko3ac92e92018-10-30 15:04:55 +000071RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/ironic-tempest-plugin && \
azvyagintsevf19ddc82018-02-20 18:39:32 +020072 pushd ironic-tempest-plugin; git checkout $IRONIC_TAG; \
sandriichenko3b17b482018-03-20 20:29:31 +020073 pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt . ; \
74 popd;
azvyagintsevf19ddc82018-02-20 18:39:32 +020075
sandriichenko3ac92e92018-10-30 15:04:55 +000076RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/manila-tempest-plugin && \
azvyagintsevf19ddc82018-02-20 18:39:32 +020077 pushd manila-tempest-plugin; git checkout $MANILA_TAG; \
sandriichenko3b17b482018-03-20 20:29:31 +020078 pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt . ; \
79 popd;
azvyagintsevf19ddc82018-02-20 18:39:32 +020080
sandriichenko3ac92e92018-10-30 15:04:55 +000081RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/telemetry-tempest-plugin && \
azvyagintsevf19ddc82018-02-20 18:39:32 +020082 pushd telemetry-tempest-plugin; git checkout $TELEMETRY_TAG; \
sandriichenko3b17b482018-03-20 20:29:31 +020083 pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt . ; \
84 popd;
85
ibumarskov86e9adc2018-10-18 13:49:17 +040086RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/patrole patrole-tempest-plugin ; \
87 pushd /var/lib/patrole-tempest-plugin; git checkout $PATROLE_TAG; \
88 pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt . ; \
89 popd;
90
91RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/contrail/tungsten-tempest tungsten-tempest-plugin ; \
92 pushd /var/lib/tungsten-tempest-plugin; git checkout $TUNGSTEN_TAG; \
93 pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt . ; \
94 popd;
95
sandriichenko3ac92e92018-10-30 15:04:55 +000096RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/tempest && \
sandriichenko3b17b482018-03-20 20:29:31 +020097 pushd tempest; git checkout $TEMPEST_TAG; \
azvyagintsevf19ddc82018-02-20 18:39:32 +020098 pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt ; \
99 pip install . ; popd;
100
sandriichenko7ec32172018-03-19 17:21:21 +0200101RUN pip install junitxml
Maksym Shalamov6f5e8d92018-04-12 18:19:09 +0300102# Patch junitxml library to include skipped tests in the test report totals header
103COPY bin/patches/junitxml_init.patch /tmp/junitxml_init.patch
104RUN patch /usr/local/lib/python2.7/dist-packages/junitxml/__init__.py /tmp/junitxml_init.patch
sandriichenko7ec32172018-03-19 17:21:21 +0200105
Maksym Shalamov98189f52018-04-24 13:36:26 +0300106# Patch os_testr library to fix issue ralated with tempest black-list option
107COPY bin/patches/regex_builder.patch /tmp/regex_builder.patch
108RUN patch /usr/local/lib/python2.7/dist-packages/os_testr/regex_builder.py /tmp/regex_builder.patch
109
azvyagintsevf19ddc82018-02-20 18:39:32 +0200110# Cleanup.
111RUN apt-get -y purge libx11-data xauth libxmuu1 libxcb1 libx11-6 libxext6 \
112 ppp pppconfig pppoeconf popularity-contest cpp gcc g++ libssl-doc
113RUN apt-get -y autoremove; apt-get -y clean;
114RUN rm -rf /root/.cache
115RUN rm -rf /var/lib/apt/lists/*
sandriichenko3ac92e92018-10-30 15:04:55 +0000116RUN rm -rf /root/.ssh
sandriichenko3a043ca2018-06-15 11:08:36 +0300117
118RUN echo "BUILD_TIMESTAMP=$(date '+%Y-%m-%d-%H-%M-%S' -u)" > /etc/build_timestamp
119
azvyagintsevf19ddc82018-02-20 18:39:32 +0200120#
121COPY bin/entrypoint.sh /usr/bin/entrypoint.sh
sandriichenko7ec32172018-03-19 17:21:21 +0200122COPY bin/run_tempest.sh /usr/bin/run-tempest
ibumarskov48ca2092018-10-18 13:49:17 +0400123COPY bin/opencontrail/policy.json /etc/opencontrail/policy.json
sandriichenko7ec32172018-03-19 17:21:21 +0200124
125ENV LOG_DIR='/root/tempest'
azvyagintsevf19ddc82018-02-20 18:39:32 +0200126
Maksym Shalamov98189f52018-04-24 13:36:26 +0300127COPY bin/skiplists /var/lib/tempest/skiplists
128
azvyagintsevf19ddc82018-02-20 18:39:32 +0200129WORKDIR /var/lib/tempest/
130ENTRYPOINT ["/usr/bin/entrypoint.sh"]
131
132# Build
Maksym Shalamov8d89b892018-09-03 13:50:48 +0300133# docker build -t docker-ci-tempest:$(date "+%Y_%m_%d_%H_%M_%S") .