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