blob: 867726df42cc6f2f2fad60b23375e7160ee7c743 [file] [log] [blame]
Oleksii Zhurba4ccdbf22018-09-04 21:00:19 -05001FROM ubuntu:16.04
2
azvyagintsevec38a1c2018-12-18 16:10:14 +02003LABEL maintainer="dev@mirantis.com"
4
5ENV DEBIAN_FRONTEND=noninteractive \
6 DEBCONF_NONINTERACTIVE_SEEN=true \
7 LANG=C.UTF-8 \
Hanna Arhipova8b887062019-05-28 12:38:24 +03008 LANGUAGE=$LANG \
9 PYTEST_REPORT_DIR=/var/lib/validation_artifacts
azvyagintseve67f7352018-12-20 16:11:40 +020010SHELL ["/bin/bash", "-o", "pipefail", "-c"]
azvyagintsevec38a1c2018-12-18 16:10:14 +020011
Oleksii Zhurba4ccdbf22018-09-04 21:00:19 -050012USER root
azvyagintseve67f7352018-12-20 16:11:40 +020013ARG UBUNTU_MIRROR_URL="http://archive.ubuntu.com/ubuntu"
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030014ARG SL_TEST_REPO='http://gerrit.mcp.mirantis.com/mcp/stacklight-pytest'
Hanna Arhipovafdc75422019-05-27 19:26:23 +030015ARG SL_TEST_BRANCH='release/2019.2.0'
Hanna Arhipova474ba922019-07-04 12:43:16 +030016ENV PYTHONHTTPSVERIFY=0
Oleksii Zhurba4ccdbf22018-09-04 21:00:19 -050017
18WORKDIR /var/lib/
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030019COPY bin/ /usr/local/bin/
20COPY test_set/ ./
21#
azvyagintseve67f7352018-12-20 16:11:40 +020022RUN set -ex; pushd /etc/apt/ && echo > sources.list && \
23 echo 'Acquire::Languages "none";' > apt.conf.d/docker-no-languages && \
24 echo 'Acquire::GzipIndexes "true"; Acquire::CompressionTypes::Order:: "gz";' > apt.conf.d/docker-gzip-indexes && \
25 echo 'APT::Get::Install-Recommends "false"; APT::Get::Install-Suggests "false";' > apt.conf.d/docker-recommends && \
26 echo "deb [arch=amd64] $UBUNTU_MIRROR_URL xenial main restricted universe multiverse" >> sources.list && \
27 echo "deb [arch=amd64] $UBUNTU_MIRROR_URL xenial-updates main restricted universe multiverse" >> sources.list && \
28 echo "deb [arch=amd64] $UBUNTU_MIRROR_URL xenial-backports main restricted universe multiverse" >> sources.list && \
29 popd ; apt-get update && apt-get upgrade -y && \
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030030 apt-get install -y build-essential curl git-core iputils-ping libffi-dev libldap2-dev libsasl2-dev libssl-dev patch python-dev python-pip vim-tiny wget \
31 python-virtualenv \
32# Enable these packages while porting to Python3 => python3-virtualenv python3-dev \
33# Due to upstream bug we should use fixed version of pip
34 && python -m pip install --upgrade 'pip==9.0.3' \
35 # initialize cvp sanity test suite
36 && pushd cvp-sanity \
37 && virtualenv --python=python2 venv \
38 && . venv/bin/activate \
39 && pip install -r requirements.txt \
40 && deactivate \
41 && popd \
42 # initialize cvp spt test suite
43 && pushd cvp-spt \
44 && virtualenv --python=python2 venv \
45 && . venv/bin/activate \
46 && pip install -r requirements.txt \
47 && deactivate \
48 && popd \
49 # initialize cvp stacklight test suite
50 && mkdir cvp-stacklight \
51 && pushd cvp-stacklight \
52 && virtualenv --system-site-packages venv \
53 && . venv/bin/activate \
54 && git clone -b $SL_TEST_BRANCH $SL_TEST_REPO \
Hanna Arhipovaff2e8492019-05-31 16:55:56 +030055 && pushd stacklight-pytest \
56 && git log -n1 \
57 && pip install . \
58 && pip install -r requirements.txt \
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030059 && deactivate \
Hanna Arhipovaff2e8492019-05-31 16:55:56 +030060 && popd && popd \
azvyagintsevec38a1c2018-12-18 16:10:14 +020061# Cleanup
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030062 && apt-get -y purge libx11-data xauth libxmuu1 libxcb1 libx11-6 libxext6 ppp pppconfig pppoeconf popularity-contest cpp gcc g++ libssl-doc && \
azvyagintseve67f7352018-12-20 16:11:40 +020063 apt-get -y autoremove; apt-get -y clean ; rm -rf /root/.cache; rm -rf /var/lib/apt/lists/* && \
Ievgeniia Zadorozhnad26f2452019-11-11 16:26:28 +030064 rm -rf /tmp/* ; rm -rf /var/tmp/* ; rm -rfv /etc/apt/sources.list.d/* ; echo > /etc/apt/sources.list \
65
66# Download iperf package
67 && wget http://ftp.br.debian.org/debian/pool/main/i/iperf/iperf_2.0.5+dfsg1-2_amd64.deb -O /var/lib/iperf_2.0.5+dfsg1-2_amd64.deb
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030068
69ENTRYPOINT ["entrypoint.sh"]
70# docker build --no-cache -t cvp-sanity-checks:test_latest .