Refactor improvements
[functest.git] / docs / configguide / index.rst
index 85954e7..411f68d 100644 (file)
-***********************************************
-OPNFV FUNCTEST configuration/installation guide
-***********************************************
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+
+==================================
+OPNFV FUNCTEST Configuration Guide
+==================================
 
 .. toctree::
    :numbered:
    :maxdepth: 2
 
-============
 Introduction
 ============
 
-** DOCUMENT IS IN PROGRESS FOR BRAHMAPUTRA **
-
 This document describes how to install and configure Functest in OPNFV.
 
-=============
+High level architecture
+-----------------------
+
+The high level architecture of Functest within OPNFV can be described as follows::
+
+ CIMC/Lights+out management                 Admin     Private   Public   Storage
+                                             PXE
+                                                                   +
+ +                                             +     IP_PRIV/24    |        |
+ |                                             |         +         +        |
+ |                                             |         |    IP_PUB/24     |
+ |     +----------------------------+          |         |         +        |
+ |     |                            |          |         |         |        |
+ +-----+       Jumphost             |          |         |         |        |
+ |     |                            +----------+         |         |        |
+ |     |                            |          |         |         |        |
+ |     |   +--------------------+   |          |         |         |        |
+ |     |   |                    |   |          |         |         |        |
+ |     |   | Tools              |   +--------------------+         |        |
+ |     |   | - Rally            |   |          |         |         |        |
+ |     |   | - Robot            |   |          |         |         |        |
+ |     |   | - TestON           |   |          |         |         |        |
+ |     |   |                    |   |          |         |         |        |
+ |     |   | Testcases          |   |          |         |         |        |
+ |     |   | - VIM              |   |          |         |         |        |
+ |     |   |  -- vPing          |   |          |         |         |        |
+ |     |   |  -- vPing_userdata |   |          |         |         |        |
+ |     |   |  -- Tempest        |   |          |         |         |        |
+ |     |   |  -- Rally          |   |          |         |         |        |
+ |     |   | - Controller       |   |          |         |         |        |
+ |     |   |  -- odl            |   |          |         |         |        |
+ |     |   |  -- onos           |   |          |         |         |        |
+ |     |   |  -- opencontrail   |   |          |         |         |        |
+ |     |   |                    |   |          |         |         |        |
+ |     |   | Features           |   |          |         |         |        |
+ |     |   | - vIMS             |   |          |         |         |        |
+ |     |   |                    |   |          |         |         |        |
+ |     |   +--------------------+   |          |         |         |        |
+ |     |                            +------------------------------+        |
+ |     |    Functest Docker         |          |         |         |        |
+ |     |                            +---------------------------------------+
+ |     |                            |          |         |         |        |
+ |     +----------------------------+          |         |         |        |
+ |                                             |         |         |        |
+ |    +----------------+                       |         |         |        |
+ |    |             1  |                       |         |         |        |
+ +----+ +--------------+-+                     |         |         |        |
+ |    | |             2  |                     |         |         |        |
+ |    | | +--------------+-+                   |         |         |        |
+ |    | | |             3  |                   |         |         |        |
+ |    | | | +--------------+-+                 |         |         |        |
+ |    | | | |             4  |                 |         |         |        |
+ |    +-+ | | +--------------+-+               |         |         |        |
+ |      | | | |             5  +---------------+         |         |        |
+ |      +-+ | |  nodes for     |               |         |         |        |
+ |        | | |  deploying     +-------------------------+         |        |
+ |        +-+ |  opnfv         |               |         |         |        |
+ |          | |     SUT        +-----------------------------------+        |
+ |          +-+                |               |         |         |        |
+ |            |                +--------------------------------------------+
+ |            +----------------+               |         |         |        |
+ |                                             |         |         |        |
+ |                                             +         +         +        +
+
+All the libraries and dependencies needed by all the Functest tools are
+pre-installed in the Docker image.
+This allows running Functest on any platform on any Operating System.
+
+The automated mechanisms inside the Functest Docker container will:
+
+  * retrieve OpenStack credentials
+  * prepare the environment according to the SUT
+  * perform the appropriate tests
+  * push the results into the OPNFV test result database
+
+
+This Docker image can be integrated into CI or deployed independently.
+
+Please note that the Functest container has been designed for OPNFV, however, it
+would be possible to adapt it to any VIM+controller environment since most of the
+test cases are integrated from upstream communities.
+
+The test cases are described in the Functest User Guide `[2]`_
+
+
 Prerequisites
 =============
 
-The installation of the OPNFV solution is out of scope of this document but can be found in XXX.
-In the rest of the document the OPNFV solution would be considered as the System Under Test (SUT).
+The OPNFV deployment is out of the scope of this document but it can be found in
+`[4]`_. The OPNFV platform is considered as the System Under Test (SUT) in this
+document.
+
+Several prerequisites are needed for Functest:
 
-Several prerequisites are needed for functest:
- 1) docker must be installed on the Jumphost
- 2) a connectivity from the jumphost to the SUT management network is needed
- 3) an external network must be configured
+    #. A Jumphost to run Functest on
+    #. Docker daemon shall be installed on the Jumphost
+    #. A public/external network created on the SUT
+    #. Connectivity from the Jumphost to the SUT public/external network
+    #. Connectivity from the Jumphost to the SUT management network
+
+NOTE: “Jumphost” refers to any server which meets the previous requirements.
+Normally it is the same server from where the OPNFV deployment has been
+triggered previously.
 
 Docker installation
-===================
+-------------------
 
 .. _Ubuntu: https://docs.docker.com/installation/ubuntulinux/
 .. _RHEL: https://docs.docker.com/installation/rhel/
 
-Log on your jumphost then install docker (e.g. for Ubuntu)::
+Log on your Jumphost and install docker (e.g. for Ubuntu)::
 
  curl -sSL https://get.docker.com/ | sh
 
@@ -40,244 +132,59 @@ Add your user to docker group to be able to run commands without sudo::
 
  sudo usermod -aG docker <your_user>
 
+A reconnect is needed. There are 2 ways for this:
+    #. Re-login to your account
+    #. su - <username>
 
 References:
+
   * Ubuntu_
   * RHEL_
 
-Connectivy to OPNFV management network
-======================================
-
-Some of the Functest tools need to have access to the OpenStack management network of the controllers `[1]`_.
-
-For this reason and besides the public network, you need to configure an interface on the management network as well in your jumphost (or wherever you want to deploy the Functest docker to run the tests).
-
-Example::
-
- The OPNFV Fuel installation uses VLAN tagged 300 and subnet 192.168.1.0/24 as Openstack Management network.
- Supposing that eth1 is the physical interface with access to that subnet:
- $ ip link add name eth1.300 link eth1 type vlan id 300
- $ ip link set eth1.300 up
- $ ip addr add 192.168.1.66/24 dev eth1.300
-
-
 External network on SUT
-=======================
-
-Some of the tests on VIM need an external network. You may perform functest without an external network but some of the tests will fail.
-A default floating ip pool must be configured in nova.conf.
-
-
-
-=======================
-High level architecture
-=======================
-
-The high level architecture of Functest within OPNFV can be described as follow::
-
- CIMC/Lights+out management                         Admin     Private   Public   Storage
-                                                     PXE
-                                                                           +
- +                                                     +     IP_PRIV/24    |        |
- |                                                     |         +         +        |
- |                                                     |         |    IP_PUB/24     |
- |     +--------------------------+                    |         |         +        |
- |     |                          |                    |         |         |        |
- +-----+       Jumphost           |                    |         |         |        |
- |     |                          +--------------------+         |         |        |
- |     |                          |                    |         |         |        |
- |     |   +------------------+   |                    |         |         |        |
- |     |   |                  |   |                    |         |         |        |
- |     |   | Tools            |   +------------------------------+         |        |
- |     |   | - Rally          |   |                    |         |         |        |
- |     |   | - Robot          |   |                    |         |         |        |
- |     |   | - TestON         |   |                    |         |         |        |
- |     |   |                  |   |                    |         |         |        |
- |     |   | Testcases        |   |                    |         |         |        |
- |     |   | - VIM            |   |                    |         |         |        |
- |     |   |  -- vPing        |   |                    |         |         |        |
- |     |   |  -- Tempest      |   |                    |         |         |        |
- |     |   |  -- Rally        |   |                    |         |         |        |
- |     |   | - Controller     |   |                    |         |         |        |
- |     |   |  -- odl          |   |                    |         |         |        |
- |     |   |  -- onos         |   |                    |         |         |        |
- |     |   |  -- opencontrail |   |                    |         |         |        |
- |     |   |                  |   |                    |         |         |        |
- |     |   | Features         |   |                    |         |         |        |
- |     |   | - vIMS           |   |                    |         |         |        |
- |     |   |                  |   |                    |         |         |        |
- |     |   +------------------+   |                    |         |         |        |
- |     |                          +----------------------------------------+        |
- |     |    Functest Docker       |                    |         |         |        |
- |     |                          +-------------------------------------------------+
- |     |                          |                    |         |         |        |
- |     +--------------------------+                    |         |         |        |
- |                                                     |         |         |        |
- |    +----------------+                               |         |         |        |
- |    |             1  |                               |         |         |        |
- +----+ +--------------+-+                             |         |         |        |
- |    | |             2  |                             |         |         |        |
- |    | | +--------------+-+                           |         |         |        |
- |    | | |             3  |                           |         |         |        |
- |    | | | +--------------+-+                         |         |         |        |
- |    | | | |             4  |                         |         |         |        |
- |    +-+ | | +--------------+-+                       |         |         |        |
- |      | | | |             5  +-----------------------+         |         |        |
- |      +-+ | |  nodes for     |                       |         |         |        |
- |        | | |  deploying     +---------------------------------+         |        |
- |        +-+ |  opnfv         |                       |         |         |        |
- |          | |     SUT        +-------------------------------------------+        |
- |          +-+                |                       |         |         |        |
- |            |                +----------------------------------------------------+
- |            +----------------+                       |         |         |        |
- |                                                     |         |         |        |
- |                                                     +         +         +        +
-
-All the components needed by Functest are in the docker file.
-Thanks to docker, there is no more library issues.
-
-This docker file will:
-  * prepare the environment for functional testing
-  * retrieve SUT credentials
-  * perform the tests
-  * push the results into the OPNFV test result database
-
-This docker file can be integrated into CI or deployed independantly of the CI.
-A description of the Brahmaputra testcases can be retrieved in the Functest user guide `[2]`_
-
-Please note that the Functest container has been designed for OPNFV, however, it would be possible to adapt it to any VIM+controller environment as most of the testcases are upstream testcases.
-
-===================
-Manual Installation
-===================
-
-Pull the Functest Docker image from the hub::
+-----------------------
 
- $ docker pull opnfv/functest
+Some of the tests against the VIM (Virtual Infrastructure Manager) need an
+existing public network to succeed. This is needed, for example, to create
+floating IPs to access instances from the public network (i.e. Docker container).
 
-Check that the image is available::
+By default, the four OPNFV installers provide a fresh installation with
+an external network created along with a router. Make sure that subnet
+is reachable from the Jumphost
 
- $ docker images
 
-Run the docker container giving the environment variables
- - INSTALLER_TYPE. Possible values are "apex", "compass", "fuel", "joid" or "foreman" (Arno).
- - 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, "172.30.10.73" foreman...)
+Connectivity to OPNFV management network
+----------------------------------------
 
-The minimum command to create the Functest docker file can be described as follow::
+Some of the Functest tools need to have access to the OpenStack management
+network of the controllers `[1]`_.
 
- docker run -it -e "INSTALLER_IP=10.20.0.2" -e "INSTALLER_TYPE=fuel" opnfv/functest:latest_stable /bin/bash
+For this reason, an interface shall be configured in the Jumphost in the
+OpenStack management network range.
 
-Optionnaly, it is possible to precise the container name through the option --name::
+For example, if the management network is on VLAN 300 and subnet 192.168.1.0/24
+and assuming that eth1 is the physical interface with access to that subnet::
 
- docker run --name "CONTAINER_NAME" -it -e "INSTALLER_IP=10.20.0.2" -e "INSTALLER_TYPE=fuel" opnfv/functest:latest_stable /bin/bash
+    ip link add name eth1.300 link eth1 type vlan id 300
+    ip link set eth1.300 up
+    ip addr add 192.168.1.66/24 dev eth1.300
 
-It is also possible to to indicate the path of the OpenStack creds using -v::
+This is just an example about how to configure an interface with vlan, but it might
+differ depending on the deployment settings on each installer. Check the
+corresponding installer instructions for more info.
 
- 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:latest_stable /bin/bash
 
-Your local file will be paste within the container under /home/opnfv/functest/conf/openstack.creds and used by the different test suites.
+Installation and configuration
+==============================
 
-Once run you shall be inside the docker container and ready to run Functest.
+.. include:: ./configguide.rst
 
-Inside the container, you must have the following arborescence::
 
-  `-- 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 environement, 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
-
-NOTE: This will run ALL the tests by default, see `[2]`_ for details
-
-Focus on the OpenStack credentials
-==================================
-
-The OpenStack creds are needed to test the VIM. They can be retrieved in several ways:
-  * using the -v option when creating
-  * sourcing them manually once connected on the docker, once log perform a source <openstack_creds>
-  * automatically retrieved via a script (CI)
-
-If not source you will get an error during the test environnement preparation.
-
-Additional Options
-==================
-
-In case you need to provide different configuration parameters to Functest (e.g. commit IDs or branches for the repositories, …) copy the config_functest.yaml from the repository to your current directory and run docker with a volume::
-
- $ wget https://git.opnfv.org/cgit/functest/plain/testcases/config_functest.yaml
- $ cmd1 = "/home/opnfv/repos/functest/docker/prepare_env.sh"
- $ cmd2 = "/home/opnfv/repos/functest/docker/run_tests.sh"
- $ docker run -t -e "INSTALLER_TYPE=fuel" -e "INSTALLER_IP=10.20.0.2" opnfv/functest \
-   -v $(pwd)/config_functest.yaml:/home/opnfv/functest/conf/config_functest.yaml \
-   "${cmd1} && ${cmd2}"
-
-=================
 Integration in CI
 =================
-In CI we use the docker file and execute commande within the container from Jenkins.
+
+In CI we use the Docker image and execute the appropriate commands within the
+container from Jenkins.
 
 Docker creation in set-functest-env builder `[3]`_::
 
@@ -338,33 +245,20 @@ Docker clean in functest-cleanup builder `[3]`_::
     fi
 
 
-=============
-Configuration
-=============
-
-Everything is preconfigured in the docker file. So except the credentials, there is no specific configuration needed. it is possible to customize the list of tests, see `[2]` for details.
-
-======
-Errors
-======
-
 
-
-
-
-==========
 References
 ==========
 .. _`[1]`: https://ask.openstack.org/en/question/68144/keystone-unable-to-use-the-public-endpoint/
-.. _`[2]`: url functest user guide
+.. _`[2]`: http://artifacts.opnfv.org/functest/docs/userguide/index.html
 .. _`[3]`: https://git.opnfv.org/cgit/releng/tree/jjb/functest/functest-ci-jobs.yml
+.. _`[4]`: http://artifacts.opnfv.org/opnfvdocs/brahmaputra/docs/configguide/index.html
 
 
 OPNFV main site: opnfvmain_.
 
 OPNFV functional test page: opnfvfunctest_.
 
-IRC support chan: #opnfv-testperf
+IRC support channel: #opnfv-testperf
 
 .. _opnfvmain: http://www.opnfv.org
 .. _opnfvfunctest: https://wiki.opnfv.org/opnfv_functional_testing