19bea3acd9c7d968eec2a415cbbd9193291a6013
[functest.git] / docker / smoke / Dockerfile
1 FROM opnfv/functest-tempest
2
3 ARG BRANCH=master
4 ARG OPENSTACK_TAG=master
5 ARG REFSTACK_TARGET=2018.02
6 ARG PATROLE_TAG=master
7 ARG NEUTRON_TAG=master
8 ARG BARBICAN_TAG=master
9
10 RUN apk --no-cache add --virtual .build-deps --update \
11         python-dev build-base linux-headers libffi-dev \
12         openssl-dev libjpeg-turbo-dev && \
13     wget -q -O- https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=$OPENSTACK_TAG | \
14         sed -E s/^tempest==+.*$/-e\ git+https:\\/\\/git.openstack.org\\/openstack\\/tempest#egg=tempest/ \
15         > upper-constraints.txt && \
16     wget -q -O- https://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH | \
17         sed -E /#egg=functest/d > upper-constraints.opnfv.txt && \
18     git init /src/patrole && \
19     (cd /src/patrole && \
20         git fetch --tags https://git.openstack.org/openstack/patrole.git $PATROLE_TAG && \
21         git checkout FETCH_HEAD) && \
22     update-requirements -s --source /src/openstack-requirements /src/patrole/ && \
23     git init /src/neutron-tempest-plugin && \
24     (cd /src/neutron-tempest-plugin && \
25         git fetch --tags https://git.openstack.org/openstack/neutron-tempest-plugin.git $NEUTRON_TAG && \
26         git checkout FETCH_HEAD) && \
27     update-requirements -s --source /src/openstack-requirements /src/neutron-tempest-plugin && \
28     git init /src/barbican-tempest-plugin && \
29     (cd /src/barbican-tempest-plugin && \
30         git fetch --tags https://git.openstack.org/openstack/barbican-tempest-plugin.git $BARBICAN_TAG && \
31         git checkout FETCH_HEAD) && \
32     update-requirements -s --source /src/openstack-requirements /src/barbican-tempest-plugin/ && \
33     pip install --no-cache-dir --src /src -cupper-constraints.txt -cupper-constraints.opnfv.txt \
34         /src/patrole /src/barbican-tempest-plugin /src/neutron-tempest-plugin \
35         networking-bgpvpn networking-sfc && \
36     mkdir -p /home/opnfv/functest/data/refstack && \
37     wget "https://refstack.openstack.org/api/v1/guidelines/${REFSTACK_TARGET}/tests?target=compute&type=required&alias=true&flag=false" \
38         -O /home/opnfv/functest/data/refstack/defcore.txt && \
39     mkdir -p /etc/neutron /etc/glance && \
40     wget -q -O /etc/glance/policy.json https://git.openstack.org/cgit/openstack/glance/plain/etc/policy.json?h=$OPENSTACK_TAG && \
41     virtualenv oslo && . oslo/bin/activate && \
42     pip install --no-cache-dir --src /src -cupper-constraints.txt -cupper-constraints.opnfv.txt \
43         oslo.policy -e git+https://git.openstack.org/openstack/neutron.git@$OPENSTACK_TAG#egg=neutron && \
44     oslopolicy-sample-generator  --format json --output-file /etc/neutron/policy.json --namespace neutron && \
45     deactivate && \
46     mkdir -p /home/opnfv/functest/data/rally/neutron && \
47     cp -r /src/neutron/rally-jobs /home/opnfv/functest/data/rally/neutron/rally-jobs && \
48     rm -r oslo upper-constraints.txt upper-constraints.opnfv.txt \
49         /src/neutron /src/patrole /src/barbican-tempest-plugin /src/neutron-tempest-plugin && \
50     apk del .build-deps
51 COPY testcases.yaml /usr/lib/python2.7/site-packages/xtesting/ci/testcases.yaml
52 CMD ["run_tests", "-t", "all"]