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