Add patrole in opnfv/functest-restapi
[functest.git] / docker / restapi / Dockerfile
1 FROM opnfv/functest-core
2
3 ARG BRANCH=master
4 ARG OPENSTACK_TAG=stable/pike
5 ARG ODL_TAG=85448c9d97b89989488e675b29b38ac42d8674e4
6 ARG RALLY_TAG=stable/0.10
7 ARG OS_FAULTS_TAG=0.1.16
8 ARG REFSTACK_TAG=a59189eaacda24b787ecb65e6634257beba361ec
9 ARG REFSTACK_TARGET=2017.09
10 ARG FDS_TAG=master
11 ARG VIMS_TAG=stable
12 ARG PATROLE_TAG=0.2.0
13
14 COPY thirdparty-requirements.txt thirdparty-requirements.txt
15 RUN apk --no-cache add --update python3 sshpass \
16         ruby ruby-bundler ruby-irb ruby-rdoc dnsmasq \
17         procps libxslt libxml2 zlib libffi go musl-dev && \
18     apk --no-cache add --virtual .build-deps --update \
19         python-dev python3-dev build-base linux-headers libffi-dev \
20         openssl-dev libjpeg-turbo-dev \
21         ruby-dev g++ make libxslt-dev libxml2-dev zlib-dev libffi-dev && \
22     wget -q -O- https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=$OPENSTACK_TAG | \
23         sed -E s/^tempest==+\(.*\)$/-e\ git+https:\\/\\/github.com\\/openstack\\/tempest@\\1#egg=tempest/ \
24         > upper-constraints.txt && \
25     pip install --no-cache-dir --src /src -cupper-constraints.txt \
26         -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH \
27         -e git+https://github.com/openstack/requirements@$OPENSTACK_TAG#egg=openstack_requirements && \
28     git clone --depth 1 https://github.com/openstack/os-faults.git -b $OS_FAULTS_TAG /src/os-faults && \
29     update-requirements -s --source /src/openstack-requirements /src/os-faults/ && \
30     git clone --depth 1 https://github.com/openstack/rally.git -b $RALLY_TAG /src/rally && \
31     update-requirements -s --source /src/openstack-requirements /src/rally/ && \
32     git clone https://github.com/openstack/refstack-client.git /src/refstack-client && \
33     (cd /src/refstack-client && git checkout $REFSTACK_TAG) && \
34     update-requirements -s --source /src/openstack-requirements /src/refstack-client/ && \
35     git clone https://github.com/openstack/patrole.git /src/patrole && \
36     (cd /src/patrole && git checkout $PATROLE_TAG) && \
37     update-requirements -s --source /src/openstack-requirements /src/patrole/ && \
38     pip install --no-cache-dir --src /src -cupper-constraints.txt \
39         -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH \
40         tempest /src/os-faults && \
41     pip install --no-cache-dir --src /src -cupper-constraints.txt \
42         -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH \
43         -e/src/refstack-client oslotest /src/patrole /src/rally -rthirdparty-requirements.txt && \
44     python3 -m pip install --no-cache-dir --src /src -cupper-constraints.txt \
45         -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH \
46         doctor-tests && \
47     git clone https://git.opendaylight.org/gerrit/p/integration/test.git /src/odl_test && \
48     (cd /src/odl_test && git checkout $ODL_TAG) && \
49     git clone --depth 1 -b $FDS_TAG https://gerrit.opnfv.org/gerrit/fds /src/fds && \
50     git clone --depth 1 -b $VIMS_TAG https://github.com/boucherv-orange/clearwater-live-test /src/vims-test && \
51     ln -s /src/tempest /src/refstack-client/.tempest && \
52     virtualenv --system-site-packages /src/tempest/.venv --python=python2.7 && \
53     git clone https://github.com/RebacaInc/abot_charm.git /src/epc-requirements/abot_charm && \
54     python3 -m pip install --no-cache-dir --src /src -cupper-constraints.txt \
55         -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH \
56         juju-wait && \
57     go get github.com/rogpeppe/godeps && \
58     (cd /src/vims-test && bundle config build.nokogiri --use-system-libraries && bundle install --system) && \
59     mkdir -p /etc/rally && \
60     printf "[database]\nconnection = 'sqlite:////var/lib/rally/database/rally.sqlite'" > /etc/rally/rally.conf && \
61     mkdir -p /var/lib/rally/database && rally db create && \
62     mkdir -p /home/opnfv/functest/data/refstack && \
63     wget "https://refstack.openstack.org/api/v1/guidelines/${REFSTACK_TARGET}/tests?target=compute&type=required&alias=true&flag=false" \
64         -O /home/opnfv/functest/data/refstack/defcore.txt && \
65     mkdir -p /etc/neutron /etc/glance && \
66     wget -q -O /etc/neutron/policy.json https://raw.githubusercontent.com/openstack/neutron/$OPENSTACK_TAG/etc/policy.json && \
67     wget -q -O /etc/glance/policy.json https://raw.githubusercontent.com/openstack/glance/$OPENSTACK_TAG/etc/policy.json && \
68     cp /usr/lib/python2.7/site-packages/functest/ci/testcases.yaml /usr/lib/python2.7/site-packages/xtesting/ci && \
69     rm -r upper-constraints.txt thirdparty-requirements.txt /src/refstack-client/.git /src/odl_test/.git \
70         /src/os-faults /src/rally /src/fds/.git /src/vims-test/.git /src/epc-requirements/abot_charm/.git && \
71     apk del .build-deps
72 EXPOSE 5000
73 CMD ["functest_restapi"]