ae1343c2d9ced71ce6dcbbdb9ecb865beeaf7d10
[functest.git] / docker / Dockerfile
1 ########################################
2 #   Docker container for FUNCTEST
3 ########################################
4 # Purpose: run all the tests against the POD
5 #          from a pre-installed docker image
6 #
7 # Maintained by Jose Lausuch
8 # Build:
9 #    $ docker build -t opnfv/functest:tag .
10 #
11 # Execution:
12 #    $ docker run -t -i \
13 #      -e "INSTALLER_TYPE=fuel|apex|compass|joid \
14 #      -e "INSTALLER_IP=10.20.0.2" \
15 #      -v $(pwd)/config_functest.yaml:/home/opnfv/repos/functest/ci/config_functest.yaml
16 #      opnfv/functest /bin/bash
17 #
18 # NOTE: providing config_functest.yaml is optional. If not provided, it will
19 #       use the default one located in the repo
20 #
21 # All rights reserved. This program and the accompanying materials
22 # are made available under the terms of the Apache License, Version 2.0
23 # which accompanies this distribution, and is available at
24 # http://www.apache.org/licenses/LICENSE-2.0
25 #
26
27 FROM ubuntu:14.04
28 MAINTAINER Jose Lausuch <jose.lausuch@ericsson.com>
29 LABEL version="0.1" description="OPNFV Functest Docker container"
30
31 ENV HOME /home/opnfv
32 ENV repos_dir /home/opnfv/repos
33 ENV creds /home/opnfv/functest/conf/openstack.creds
34 ENV TERM xterm
35 ENV COLORTERM gnome-terminal
36 ENV PYTHONPATH $PYTHONPATH:/home/opnfv/repos/
37 ENV CONFIG_FUNCTEST_YAML /home/opnfv/repos/functest/ci/config_functest.yaml
38 WORKDIR /home/opnfv
39
40 # Packaged dependencies
41 RUN apt-get update && apt-get install -y \
42 ssh \
43 sshpass \
44 curl \
45 git \
46 gcc \
47 wget \
48 python-dev \
49 python-pip \
50 bundler \
51 postgresql \
52 build-essential \
53 libpq-dev \
54 libxslt-dev \
55 libssl-dev \
56 libgmp3-dev \
57 libxml2-dev \
58 libffi-dev \
59 crudini \
60 ruby1.9.1-dev \
61 --no-install-recommends
62
63
64 RUN mkdir -p ${repos_dir}
65 RUN mkdir -p /home/opnfv/functest/results
66 RUN mkdir -p /root/.ssh
67 RUN chmod 700 /root/.ssh
68
69 RUN git config --global http.sslVerify false
70 RUN git clone https://gerrit.opnfv.org/gerrit/functest ${repos_dir}/functest
71 RUN git clone https://gerrit.opnfv.org/gerrit/releng ${repos_dir}/releng
72 RUN git clone https://gerrit.opnfv.org/gerrit/doctor ${repos_dir}/doctor
73 RUN git clone -b 0.3.3 https://github.com/openstack/rally.git ${repos_dir}/rally
74 RUN git clone https://github.com/openstack/tempest.git ${repos_dir}/tempest
75 RUN git clone https://git.opendaylight.org/gerrit/p/integration/test.git ${repos_dir}/odl_test
76 RUN git clone -b stable https://github.com/boucherv-orange/clearwater-live-test ${repos_dir}/vims-test
77 RUN git clone https://github.com/openstack/networking-bgpvpn ${repos_dir}/bgpvpn
78 RUN git clone https://github.com/wuwenbin2/OnosSystemTest.git ${repos_dir}/onos
79 RUN git clone https://github.com/opnfv/promise ${repos_dir}/promise
80 RUN git clone https://gerrit.opnfv.org/gerrit/ovno ${repos_dir}/ovno
81
82 RUN pip install -r ${repos_dir}/functest/docker/requirements.pip
83 RUN pip install -r ${repos_dir}/rally/requirements.txt
84 RUN pip install -r ${repos_dir}/tempest/requirements.txt
85
86 RUN ${repos_dir}/rally/install_rally.sh --yes
87
88 ADD http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img /home/opnfv/functest/data/
89
90 RUN gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
91 RUN curl -L https://get.rvm.io | bash -s stable
92
93 RUN /bin/bash -c ". /etc/profile.d/rvm.sh \
94     && cd /home/opnfv/repos/vims-test \
95     && rvm autolibs enable"
96 RUN /bin/bash -c ". /etc/profile.d/rvm.sh \
97     && cd /home/opnfv/repos/vims-test \
98     && rvm install 1.9.3"
99 RUN /bin/bash -c ". /etc/profile.d/rvm.sh \
100     && cd /home/opnfv/repos/vims-test \
101     && rvm use 1.9.3"
102 RUN /bin/bash -c ". /etc/profile.d/rvm.sh \
103     && cd /home/opnfv/repos/vims-test \
104     && bundle install"
105
106 RUN sh -c 'curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -'
107 RUN sudo apt-get install -y nodejs
108 RUN cd ${repos_dir}/promise && sudo npm -g install npm@latest
109 RUN cd ${repos_dir}/promise && npm install
110
111 RUN echo "set nocompatible \n\
112 set backspace=2" \
113 >> /home/opnfv/.vimrc
114 RUN echo set nocompatible >> /home/opnfv/.exrc
115 RUN echo "alias ll='ls -lh' \n\
116 . /home/opnfv/repos/functest/cli/functest-complete.sh" \
117 >> /home/opnfv/.bashrc
118 RUN cd ${repos_dir}/functest/cli && pip install .