User Tools

Site Tools


Functest within a Docker

This is the unofficial procedure to run Functest within a docker.


Some of the Functest tools need to have access to the OpenStack management network of the controllers.

For more info:

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).


The OPNFV Fuel installation uses VLAN tagged 300 and subnet 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 dev eth1.300

After doing this, try to ping one of the controllers and make sure it works, otherwise the Rally installation will fail.

Docker Installation

  • Install Docker on the server you want the tests from (example for Ubuntu):
$ curl -sSL | sh



  • Add your user to docker group to be able to run commands without sudo:
$ sudo usermod -aG docker <your_user>

Manual procedure

  • Pull the Functest Docker image from the hub:
$ docker pull opnfv/functest

  • Check that the image is available:
$ docker images

  • Run the docker container giving the environment variables
    • INSTALLER_TYPE. Possible values are "fuel" or "foreman".
    • INSTALLER_IP. Usually "" for fuel and "" foreman.
$ docker run -ti -e "INSTALLER_TYPE=fuel" -e "INSTALLER_IP=" -e "NODE_NAME=opnfv-jump-2" opnfv/functest

note: for the dev labs, it is also possible to precise the path of your openstack creds, see Docker Options below

Now, you are inside the docker container.

  • Run the script to install functest environment
$ ${repos_dir}/functest/docker/

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/

NOTE: This will run ALL the tests we have for SR1:

  • vPing test case
  • ODL suite
  • Rally benchmark (this will take long) ← in case you need, change a line to run only 1 set of tests and not all (see options below)
  • Tempest

Automated procedure

# Remove any docker containers leftovers
$ docker ps | grep opnfv/functest | awk '{print $1}' | xargs docker stop &>/dev/null
$ docker ps -a | grep opnfv/functest | awk '{print $1}' | xargs docker rm &>/dev/null
$ docker images | grep opnfv/functest | awk '{print $3}' | xargs docker rmi &>/dev/null

# Pull and store fresh image from Dockerhub
$ docker pull opnfv/functest

# Run Functest (example for Fuel)
$ cmd1 = "/home/opnfv/repos/functest/docker/"
$ cmd2 = "/home/opnfv/repos/functest/docker/"
$ docker run -t -e "INSTALLER_TYPE=fuel" -e "INSTALLER_IP=" opnfv/functest \
 "${cmd1} && ${cmd2}"

NOTE: the output will be shown on the screen until you press ^C. To attach to the docker output again type:

$ docker ps
$ docker attach <ID_of_the_container>

Docker options

I need to change some parameters in config_functest.yaml

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
$ cmd1 = "/home/opnfv/repos/functest/docker/"
$ cmd2 = "/home/opnfv/repos/functest/docker/"
$ docker run -t -e "INSTALLER_TYPE=fuel" -e "INSTALLER_IP=" opnfv/functest \
  -v $(pwd)/config_functest.yaml:/home/opnfv/functest/conf/config_functest.yaml \
  "${cmd1} && ${cmd2}"

I don't use the default OpenStack credentials

You can also provide your own OpenStack credentials to the container. This way, it will not try to fetch the credentials automatically contacting the OS controller.

If you do this, you don't need to specify any more the environment variables INSTALLER_TYPE and INSTALLER_IP, since they are used only by the script that gets the credentials automatically (a script called

$ docker run -t opnfv/functest \
  -v $(pwd)/<your_local_creds_file>:/home/opnfv/functest/conf/openstack.creds \
  "${cmd1} && ${cmd2}"

For more info:

This is recommended if you don't install OPNFV with the default OpenStack credentials. options

give test name as input

You can tell to run only the tests you desire. To do that, add the flag "-t or –test" plus the name of the available tests separated by comas.


$ ${repos_dir}/functest/docker/ --test vping,odl
Possible options are:

Rally suites

In order to run only 1 suite of Rally bench, you need to modify the call to rally within script:

$ vi ${repos_dir}/functest/docker/
(go to line 68 or search the following line)
python ${FUNCTEST_REPO_DIR}/testcases/VIM/OpenStack/CI/libraries/ --debug ${FUNCTEST_REPO_DIR}/ all
Change "all" to "keystone" for example:
python ${FUNCTEST_REPO_DIR}/testcases/VIM/OpenStack/CI/libraries/ --debug ${FUNCTEST_REPO_DIR}/ glance
Other options are: 
['authenticate', 'glance', 'cinder', 'ceilometer', 'heat', 'keystone', 'neutron', 'nova', 'quotas', 'requests', 'vm', 'all']

Offline Functest

Follow the steps described previously, but when running the scripts within the docker, add the flag - -offline.

 $ cmd1 = "/home/opnfv/repos/functest/docker/ --offline"
 $ cmd2 = "/home/opnfv/repos/functest/docker/ --offline"
 $ docker run -t -e "INSTALLER_TYPE=fuel" -e "INSTALLER_IP=" opnfv/functest \
 "${cmd1} && ${cmd2}"

IMPORTANT: This is still under test! And probably some things need to be updated to be completely offline.

functest_docker.txt · Last modified: 2015/11/27 13:42 by Morgan Richomme