1 ########################################
2 # Docker container for FUNCTEST
3 ########################################
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
11 MAINTAINER Jose Lausuch <jose.lausuch@ericsson.com>
12 LABEL version="0.1" description="OPNFV Functest Docker container"
14 # Environment variables
17 ARG TEMPEST_TAG=15.0.0
18 ARG REFSTACK_TAG=15.0.0
19 ARG ODL_TAG=release/beryllium-sr4
20 ARG KINGBIRD_TAG=1.1.0
22 ARG VROUTER_TAG=stable
23 ARG REPOS_DIR=/home/opnfv/repos
24 ARG FUNCTEST_BASE_DIR=/home/opnfv/functest
25 ARG FUNCTEST_CONF_DIR=${FUNCTEST_BASE_DIR}/conf
26 ARG FUNCTEST_DATA_DIR=${FUNCTEST_BASE_DIR}/data
27 ARG FUNCTEST_IMAGES_DIR=${FUNCTEST_BASE_DIR}/images
28 ARG FUNCTEST_RESULTS_DIR=${FUNCTEST_BASE_DIR}/results
29 ARG FUNCTEST_REPO_DIR=${REPOS_DIR}/functest
30 ARG FUNCTEST_TEST_DIR=${FUNCTEST_REPO_DIR}/functest/opnfv_tests
31 ARG REPOS_VNFS_DIR=${REPOS_DIR}/vnfs
32 ARG PIP_OPTS=-chttps://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?stable/ocata
34 # Environment variables
36 ENV CONFIG_FUNCTEST_YAML ${FUNCTEST_REPO_DIR}/functest/ci/config_functest.yaml
37 ENV REPOS_DIR ${HOME}/repos
38 ENV creds ${FUNCTEST_CONF_DIR}/openstack.creds
42 # Packaged dependencies
43 RUN apt-get update && apt-get install -y \
65 --no-install-recommends
67 RUN pip install --upgrade pip && easy_install -U setuptools==30.0.0
69 RUN mkdir -p ${FUNCTEST_REPO_DIR} \
70 && mkdir -p ${REPOS_VNFS_DIR} \
71 && mkdir -p ${FUNCTEST_BASE_DIR}/results \
72 && mkdir -p ${FUNCTEST_CONF_DIR} \
73 && mkdir -p ${FUNCTEST_DATA_DIR} \
74 && mkdir -p ${FUNCTEST_IMAGES_DIR} \
75 && mkdir -p /root/.ssh \
76 && chmod 700 /root/.ssh
78 RUN git config --global http.sslVerify false
80 COPY thirdparty-requirements.txt thirdparty-requirements.txt
81 RUN pip install ${PIP_OPTS} \
82 git+https://gerrit.opnfv.org/gerrit/functest@$BRANCH#egg=functest \
83 git+https://gerrit.opnfv.org/gerrit/releng@$BRANCH#egg=opnfv\&subdirectory=modules \
84 git+https://gerrit.opnfv.org/gerrit/snaps@$BRANCH#egg=snaps \
85 -r thirdparty-requirements.txt \
86 && rm thirdparty-requirements.txt
88 # Hook required by hardcoded paths in Functest
89 RUN ln -s /usr/local/lib/python2.7/dist-packages/functest ${FUNCTEST_REPO_DIR}/functest
92 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/copper ${REPOS_DIR}/copper
93 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/domino ${REPOS_DIR}/domino
94 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/parser ${REPOS_DIR}/parser
95 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/doctor ${REPOS_DIR}/doctor
96 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/promise ${REPOS_DIR}/promise
97 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/netready ${REPOS_DIR}/netready
98 RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/fds ${REPOS_DIR}/fds
101 RUN git clone --depth 1 -b $ODL_TAG https://git.opendaylight.org/gerrit/p/integration/test.git ${REPOS_DIR}/odl_test
102 RUN git clone --depth 1 -b $VIMS_TAG https://github.com/boucherv-orange/clearwater-live-test ${REPOS_VNFS_DIR}/vims-test
103 RUN git clone --depth 1 -b $VROUTER_TAG https://github.com/oolorg/opnfv-functest-vrouter.git ${REPOS_VNFS_DIR}/vrouter
104 RUN git clone --depth 1 https://github.com/wuwenbin2/OnosSystemTest.git ${REPOS_DIR}/onos
106 RUN find -L ${FUNCTEST_REPO_DIR} -name "*.py" \
107 -not -path "*tests/unit*" \
108 -not -path "*functest_venv*" \
109 |xargs grep -L __main__ |cut -d\: -f 1 |xargs chmod -c 644 \
110 && find -L ${FUNCTEST_REPO_DIR} -name "*.sh" \
111 -not -path "*functest_venv*" \
112 |xargs grep -L \#\! |cut -d\: -f 1 |xargs chmod -c 644
114 RUN find -L ${FUNCTEST_REPO_DIR} -name "*.py" \
115 -not -path "*tests/unit*" \
116 -not -path "*functest_venv*" \
117 |xargs grep __main__ |cut -d\: -f 1 |xargs chmod -c 755 \
118 && find -L ${FUNCTEST_REPO_DIR} -name "*.sh" \
119 -not -path "*functest_venv*" \
120 |xargs grep \#\! |cut -d\: -f 1 |xargs chmod -c 755
122 RUN /bin/bash ${REPOS_DIR}/parser/tests/parser_install.sh ${REPOS_DIR}
123 RUN wget -q https://raw.githubusercontent.com/openstack/rally/${RALLY_TAG}/install_rally.sh \
124 && bash install_rally.sh --yes && rm install_rally.sh
128 RUN gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
129 RUN curl -L https://get.rvm.io | bash -s stable
132 RUN /bin/bash -c ". /usr/local/lib/python2.7/dist-packages/sfc/tests/functest/setup_scripts/tacker_client_install.sh"
134 # refstack-client integration
135 RUN wget -q https://raw.githubusercontent.com/openstack/refstack-client/master/setup_env \
136 && bash setup_env -t ${REFSTACK_TAG} && rm setup_env
138 RUN /bin/bash -c ". /etc/profile.d/rvm.sh \
139 && cd ${REPOS_VNFS_DIR}/vims-test \
140 && rvm autolibs enable"
141 RUN /bin/bash -c ". /etc/profile.d/rvm.sh \
142 && cd ${REPOS_VNFS_DIR}/vims-test \
143 && rvm install 1.9.3"
144 RUN /bin/bash -c ". /etc/profile.d/rvm.sh \
145 && cd ${REPOS_VNFS_DIR}/vims-test \
147 RUN /bin/bash -c ". /etc/profile.d/rvm.sh \
148 && cd ${REPOS_VNFS_DIR}/vims-test \
151 RUN sh -c 'curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -' \
152 && sudo apt-get install -y nodejs \
153 && cd ${REPOS_DIR}/promise && sudo npm -g install npm@latest \
154 && cd ${REPOS_DIR}/promise/source && npm install
156 RUN echo ". ${FUNCTEST_REPO_DIR}/functest/cli/functest-complete.sh" >> ${HOME}/.bashrc