Merge "Rally live migration case selection"
[functest.git] / docs / configguide / configguide.rst
1 Functional testing Installation
2 ===============================
3
4 Pull the Functest Docker image from the Docker hub::
5
6   $ docker pull opnfv/functest:brahmaputra.1.0
7
8
9 Check that the image is available::
10
11  $ docker images
12
13 Run the docker container giving the environment variables::
14
15  - INSTALLER_TYPE. Possible values are "apex", "compass", "fuel" or "joid".
16  - INSTALLER_IP. each installer has its installation strategy.
17
18 Functest may need to know the IP of the installer to retrieve the credentials
19 (e.g. usually "10.20.0.2" for fuel, not neede for joid...).
20
21 The minimum command to create the Functest docker file can be described as
22 follows::
23
24   docker run -it -e "INSTALLER_IP=10.20.0.2" -e "INSTALLER_TYPE=fuel" opnfv/functest:brahmaputra.1.0 /bin/bash
25
26 Optionally, it is possible to precise the container name through the option
27 --name::
28
29   docker run --name "CONTAINER_NAME" -it -e "INSTALLER_IP=10.20.0.2" -e "INSTALLER_TYPE=fuel" opnfv/functest:brahmaputra.1.0 /bin/bash
30
31 It is also possible to to indicate the path of the OpenStack creds using -v::
32
33   docker run  -it -e "INSTALLER_IP=10.20.0.2" -e "INSTALLER_TYPE=fuel" -v <path_to_your_local_creds_file>:/home/opnfv/functest/conf/openstack.creds opnfv/functest:brahmaputra.1.0 /bin/bash
34
35 The local file will be mounted in the container under
36 /home/opnfv/functest/conf/openstack.creds
37
38 After the run command the prompt appears which means that we are inside the
39 container and ready to run Functest.
40
41 Inside the container, the following directory structure should be in place::
42
43   `-- home
44       `-- opnfv
45         |-- functest
46         |   |-- conf
47         |   |-- data
48         |   `-- results
49         `-- repos
50             |-- bgpvpn
51             |-- functest
52             |-- odl_integration
53             |-- rally
54             |-- releng
55             `-- vims-test
56
57
58 Basically the container includes:
59
60   * Functest directory to store the configuration (the OpenStack creds are paste
61     in /home/opngb/functest/conf), the data (images neede for test for offline
62     testing), results (some temporary artifacts may be stored here)
63   * Repositories: the functest repository will be used to prepare the
64     environment, run the tests. Other repositories are used for the installation
65     of the tooling (e.g. rally) and/or the retrieval of feature projects
66     scenarios (e.g. bgpvpn)
67
68 The arborescence under the functest repo can be described as follow::
69
70   .
71     |-- INFO
72     |-- LICENSE
73     |-- commons
74     |   |-- ims
75     |   |-- mobile
76     |   `-- traffic-profile-guidelines.rst
77     |-- docker
78     |   |-- Dockerfile
79     |   |-- common.sh
80     |   |-- prepare_env.sh
81     |   |-- requirements.pip
82     |   `-- run_tests.sh
83     |-- docs
84     |   |-- configguide
85     |   |-- functest.rst
86     |   |-- images
87     |   `-- userguide
88     `-- testcases
89         |-- Controllers
90         |-- VIM
91         |-- __init__.py
92         |-- config_functest.py
93         |-- config_functest.yaml
94         |-- functest_utils.py
95         |-- functest_utils.pyc
96         |-- vIMS
97         `-- vPing
98
99 We may distinguish 4 different folders:
100
101   * commons: it is a folder dedicated to store traffic profile or any test
102     inputs that could be reused by any test project
103   * docker: this folder includes the scripts that will be used to setup the
104     environment and run the tests
105   * docs: this folder includes the user and installation/configuration guide
106   * testcases: this folder includes the scripts required by Functest internal
107     test cases
108
109
110 Firstly run the script to install functest environment::
111
112  $ ${repos_dir}/functest/docker/prepare_env.sh
113
114 NOTE: ${repos_dir} is a default environment variable inside the docker
115 container, which points to /home/opnfv/repos
116
117 Run the script to start the tests::
118
119  $ ${repos_dir}/functest/docker/run_tests.sh