aboutsummaryrefslogtreecommitdiffstats
path: root/docs/configguide/configguide.rst
blob: 1908b543e2745027671484b83d8248c9d0f62f13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
Functional testing Installation
===============================

Pull the Functest Docker image from the Docker hub::

  $ docker pull opnfv/functest:brahmaputra.1.0


Check that the image is available::

 $ docker images

Run the docker container giving the environment variables::

 - INSTALLER_TYPE. Possible values are "apex", "compass", "fuel" or "joid".
 - INSTALLER_IP. each installer has its installation strategy.

Functest may need to know the IP of the installer to retrieve the credentials
(e.g. usually "10.20.0.2" for fuel, not neede for joid...).

The minimum command to create the Functest docker file can be described as
follows::

  docker run -it -e "INSTALLER_IP=10.20.0.2" -e "INSTALLER_TYPE=fuel" opnfv/functest:brahmaputra.1.0 /bin/bash

Optionally, it is possible to precise the container name through the option
--name::

  docker run --name "CONTAINER_NAME" -it -e "INSTALLER_IP=10.20.0.2" -e "INSTALLER_TYPE=fuel" opnfv/functest:brahmaputra.1.0 /bin/bash

It is also possible to to indicate the path of the OpenStack creds using -v::

  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

The local file will be mounted in the container under
/home/opnfv/functest/conf/openstack.creds

After the run command the prompt appears which means that we are inside the
container and ready to run Functest.

Inside the container, the following directory structure should be in place::

  `-- home
      `-- opnfv
        |-- functest
        |   |-- conf
        |   |-- data
        |   `-- results
        `-- repos
            |-- bgpvpn
            |-- functest
            |-- odl_integration
            |-- rally
            |-- releng
            `-- vims-test


Basically the container includes:

  * Functest directory to store the configuration (the OpenStack creds are paste
    in /home/opngb/functest/conf), the data (images neede for test for offline
    testing), results (some temporary artifacts may be stored here)
  * Repositories: the functest repository will be used to prepare the
    environment, run the tests. Other repositories are used for the installation
    of the tooling (e.g. rally) and/or the retrieval of feature projects
    scenarios (e.g. bgpvpn)

The arborescence under the functest repo can be described as follow::

  .
    |-- INFO
    |-- LICENSE
    |-- commons
    |   |-- ims
    |   |-- mobile
    |   `-- traffic-profile-guidelines.rst
    |-- docker
    |   |-- Dockerfile
    |   |-- common.sh
    |   |-- prepare_env.sh
    |   |-- requirements.pip
    |   `-- run_tests.sh
    |-- docs
    |   |-- configguide
    |   |-- functest.rst
    |   |-- images
    |   `-- userguide
    `-- testcases
        |-- Controllers
        |-- VIM
        |-- __init__.py
        |-- config_functest.py
        |-- config_functest.yaml
        |-- functest_utils.py
        |-- functest_utils.pyc
        |-- vIMS
        `-- vPing

We may distinguish 4 different folders:

  * commons: it is a folder dedicated to store traffic profile or any test
    inputs that could be reused by any test project
  * docker: this folder includes the scripts that will be used to setup the
    environment and run the tests
  * docs: this folder includes the user and installation/configuration guide
  * testcases: this folder includes the scripts required by Functest internal
    test cases


Firstly run the script to install functest environment::

 $ ${repos_dir}/functest/docker/prepare_env.sh

NOTE: ${repos_dir} is a default environment variable inside the docker
container, which points to /home/opnfv/repos

Run the script to start the tests::

 $ ${repos_dir}/functest/docker/run_tests.sh