blob: b0c5587ab943c2218e0c01fbb77396cafd277e5f [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"
Anastasia Kuznetsova66df6422018-08-29 18:15:01 +040013ARG OCTAVIA_TAG="mcp/pike"
ibumarskov48ca2092018-10-18 13:49:17 +040014ARG PATROLE_TAG="0.4.x"
15ARG TUNGSTEN_TAG="0.1.x"
azvyagintsevf19ddc82018-02-20 18:39:32 +020016# global openstack requirements repo
sandriichenko3b17b482018-03-20 20:29:31 +020017# This is the commit where tempest version is 17.2.0 in u-c
18ARG UPPER_CONSTRAINTS_TAG="83b1de74834fbcdbe749e270c29e76cdc28f85d5"
Oleksii Butenko1fed0f02018-07-27 14:19:14 +030019
azvyagintsevf19ddc82018-02-20 18:39:32 +020020ENV DEBIAN_FRONTEND=noninteractive \
21 DEBCONF_NONINTERACTIVE_SEEN=true \
22 LANG=C.UTF-8 \
23 LANGUAGE=$LANG
24SHELL ["/bin/bash", "-xec"]
25USER root
26# pre-update
27RUN cd /etc/apt/ && echo > sources.list \
28 && echo "deb [arch=amd64] http://cz.archive.ubuntu.com/ubuntu xenial main restricted universe multiverse" >> sources.list \
29 && echo "deb [arch=amd64] http://cz.archive.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse" >> sources.list \
30 && echo "deb [arch=amd64] http://cz.archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse" >> sources.list \
31 && echo 'Acquire::Languages "none";' > apt.conf.d/docker-no-languages \
32 && echo 'Acquire::GzipIndexes "true"; Acquire::CompressionTypes::Order:: "gz";' > apt.conf.d/docker-gzip-indexes \
33 && echo 'APT::Get::Install-Recommends "false"; APT::Get::Install-Suggests "false";' > apt.conf.d/docker-recommends \
34 && apt-get update && apt-get upgrade -y \
sandriichenko3ac92e92018-10-30 15:04:55 +000035 && apt-get install -y vim-tiny git-core python-pip libffi-dev libssl-dev python-dev python3-dev iputils-ping patch openssh-server
36
37RUN mkdir -p /root/.ssh
38COPY bin/ssh/config /root/.ssh/
39COPY bin/ssh/mcp-jenkins.key /root/.ssh/
40RUN chmod 400 /root/.ssh/mcp-jenkins.key
azvyagintsevf19ddc82018-02-20 18:39:32 +020041
Maksym Shalamova95d7202018-04-19 17:21:19 +030042#Due to upstream bug we should use fixed version of pip
sgarbuz5d5631f2018-04-18 13:54:56 +030043RUN pip install -U 'pip==9.0.3'
azvyagintsevf19ddc82018-02-20 18:39:32 +020044WORKDIR /var/lib/
45# TODO migrate to downstrem mirror?
46RUN git clone https://github.com/openstack/requirements.git openstack_requirements && \
47 pushd openstack_requirements; git checkout $UPPER_CONSTRAINTS_TAG; popd ;
48
sandriichenko3ac92e92018-10-30 15:04:55 +000049RUN 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 +030050 /var/lib/openstack_requirements/upper-constraints.txt;
51
sandriichenko3ac92e92018-10-30 15:04:55 +000052RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/tempest-horizon tempest-horizon-plugin; \
azvyagintsevf19ddc82018-02-20 18:39:32 +020053 pushd tempest-horizon-plugin ; git checkout $HORIZON_TAG; \
sandriichenko3ac92e92018-10-30 15:04:55 +000054 pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt ; \
sandriichenko3b17b482018-03-20 20:29:31 +020055 popd;
azvyagintsevf19ddc82018-02-20 18:39:32 +020056
sandriichenko3ac92e92018-10-30 15:04:55 +000057RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/barbican-tempest-plugin && \
azvyagintsevf19ddc82018-02-20 18:39:32 +020058 pushd barbican-tempest-plugin; git checkout $BARBICAN_TAG; \
sandriichenko3b17b482018-03-20 20:29:31 +020059 pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt . ; \
60 popd;
azvyagintsevf19ddc82018-02-20 18:39:32 +020061
sandriichenko3ac92e92018-10-30 15:04:55 +000062RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/designate-tempest-plugin && \
azvyagintsevf19ddc82018-02-20 18:39:32 +020063 pushd designate-tempest-plugin; git checkout $DESIGNATE_TAG; \
sandriichenko3b17b482018-03-20 20:29:31 +020064 pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt . ; \
65 popd;
azvyagintsevf19ddc82018-02-20 18:39:32 +020066
sandriichenko3ac92e92018-10-30 15:04:55 +000067RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/heat-tempest-plugin && \
azvyagintsevf19ddc82018-02-20 18:39:32 +020068 pushd heat-tempest-plugin; git checkout $HEAT_TAG; \
sandriichenko3b17b482018-03-20 20:29:31 +020069 pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt . ; \
70 popd;
azvyagintsevf19ddc82018-02-20 18:39:32 +020071
sandriichenko3ac92e92018-10-30 15:04:55 +000072RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/ironic-tempest-plugin && \
azvyagintsevf19ddc82018-02-20 18:39:32 +020073 pushd ironic-tempest-plugin; git checkout $IRONIC_TAG; \
sandriichenko3b17b482018-03-20 20:29:31 +020074 pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt . ; \
75 popd;
azvyagintsevf19ddc82018-02-20 18:39:32 +020076
sandriichenko3ac92e92018-10-30 15:04:55 +000077RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/manila-tempest-plugin && \
azvyagintsevf19ddc82018-02-20 18:39:32 +020078 pushd manila-tempest-plugin; git checkout $MANILA_TAG; \
sandriichenko3b17b482018-03-20 20:29:31 +020079 pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt . ; \
80 popd;
azvyagintsevf19ddc82018-02-20 18:39:32 +020081
sandriichenko3ac92e92018-10-30 15:04:55 +000082RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/telemetry-tempest-plugin && \
azvyagintsevf19ddc82018-02-20 18:39:32 +020083 pushd telemetry-tempest-plugin; git checkout $TELEMETRY_TAG; \
sandriichenko3b17b482018-03-20 20:29:31 +020084 pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt . ; \
85 popd;
86
sandriichenko3ac92e92018-10-30 15:04:55 +000087RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/octavia-tempest-plugin && \
Anastasia Kuznetsova66df6422018-08-29 18:15:01 +040088 pushd octavia-tempest-plugin; git checkout $OCTAVIA_TAG; \
89 pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt . ; \
90 popd;
91
ibumarskov48ca2092018-10-18 13:49:17 +040092RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/patrole patrole-tempest-plugin ; \
93 pushd /var/lib/patrole-tempest-plugin; git checkout $PATROLE_TAG; \
94 pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt . ; \
95 popd;
96
97RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/contrail/tungsten-tempest tungsten-tempest-plugin ; \
98 pushd /var/lib/tungsten-tempest-plugin; git checkout $TUNGSTEN_TAG; \
99 pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt . ; \
100 popd;
101
sandriichenko3ac92e92018-10-30 15:04:55 +0000102RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/tempest && \
sandriichenko3b17b482018-03-20 20:29:31 +0200103 pushd tempest; git checkout $TEMPEST_TAG; \
azvyagintsevf19ddc82018-02-20 18:39:32 +0200104 pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt ; \
105 pip install . ; popd;
106
sandriichenko7ec32172018-03-19 17:21:21 +0200107RUN pip install junitxml
Maksym Shalamov6f5e8d92018-04-12 18:19:09 +0300108# Patch junitxml library to include skipped tests in the test report totals header
109COPY bin/patches/junitxml_init.patch /tmp/junitxml_init.patch
110RUN patch /usr/local/lib/python2.7/dist-packages/junitxml/__init__.py /tmp/junitxml_init.patch
sandriichenko7ec32172018-03-19 17:21:21 +0200111
Maksym Shalamov98189f52018-04-24 13:36:26 +0300112# Patch os_testr library to fix issue ralated with tempest black-list option
113COPY bin/patches/regex_builder.patch /tmp/regex_builder.patch
114RUN patch /usr/local/lib/python2.7/dist-packages/os_testr/regex_builder.py /tmp/regex_builder.patch
115
azvyagintsevf19ddc82018-02-20 18:39:32 +0200116# Cleanup.
117RUN apt-get -y purge libx11-data xauth libxmuu1 libxcb1 libx11-6 libxext6 \
118 ppp pppconfig pppoeconf popularity-contest cpp gcc g++ libssl-doc
119RUN apt-get -y autoremove; apt-get -y clean;
120RUN rm -rf /root/.cache
121RUN rm -rf /var/lib/apt/lists/*
sandriichenko3ac92e92018-10-30 15:04:55 +0000122RUN rm -rf /root/.ssh
sandriichenko3a043ca2018-06-15 11:08:36 +0300123
124RUN echo "BUILD_TIMESTAMP=$(date '+%Y-%m-%d-%H-%M-%S' -u)" > /etc/build_timestamp
125
azvyagintsevf19ddc82018-02-20 18:39:32 +0200126#
127COPY bin/entrypoint.sh /usr/bin/entrypoint.sh
sandriichenko7ec32172018-03-19 17:21:21 +0200128COPY bin/run_tempest.sh /usr/bin/run-tempest
ibumarskov48ca2092018-10-18 13:49:17 +0400129COPY bin/opencontrail/policy.json /etc/opencontrail/policy.json
sandriichenko7ec32172018-03-19 17:21:21 +0200130
131ENV LOG_DIR='/root/tempest'
azvyagintsevf19ddc82018-02-20 18:39:32 +0200132
Maksym Shalamov98189f52018-04-24 13:36:26 +0300133COPY bin/skiplists /var/lib/tempest/skiplists
134
azvyagintsevf19ddc82018-02-20 18:39:32 +0200135WORKDIR /var/lib/tempest/
136ENTRYPOINT ["/usr/bin/entrypoint.sh"]
137
138# Build
Maksym Shalamov8d89b892018-09-03 13:50:48 +0300139# docker build -t docker-ci-tempest:$(date "+%Y_%m_%d_%H_%M_%S") .