1 Executing the functest suites
2 =============================
7 Once the Functest docker container is running and Functest environment ready
8 (through /home/opnfv/repos/functest/docker/prepare_env.sh script), the system is
9 ready to run the tests.
11 The script *run_tests.sh* is located in $repos_dir/functest/docker and it has
15 Script to trigger the tests automatically.
18 bash run_tests.sh [--offline] [-h|--help] [-t <test_name>]
21 -h|--help show this help text
22 -r|--report push results to database (false by default)
23 -n|--no-clean do not clean up OpenStack resources after test run
24 -t|--test run specific set of tests
25 <test_name> one or more of the following: vping,vping_userdata,odl,rally,tempest,vims,onos,promise. Separated by comma.
29 run_tests.sh --test vping,odl
30 run_tests.sh -t tempest,rally --no-clean
32 The *-r* option is used by the Continuous Integration in order to push the test
33 results into a test collection database, see in next section for details.
34 In manual mode, you must not use it, your try will be anyway probably rejected
35 as your POD must be declared in the database to collect the data.
37 The *-n* option is used for preserving all the existing OpenStack resources after
40 The *-t* option can be used to specify the list of test you want to launch, by
41 default Functest will try to launch all its test suites in the following order
42 vPing, odl, Tempest, vIMS, Rally.
43 You may launch only one single test by using *-t <the test you want to launch>*.
45 Within Tempest test suite you can define which test cases you want to execute in
46 your environment by editing test_list.txt file before executing *run_tests.sh*
49 Please note that Functest includes cleaning mechanism in order to remove
50 everything except what was present after a fresh install.
51 If you create your own VMs, tenants, networks etc. and then launch Functest,
52 they all will be deleted after executing the tests. Use the *--no-clean* option with
53 run_test.sh in order to preserve all the existing resources.
54 However, be aware that Tempest and Rally create of lot of resources (users,
55 tenants, networks, volumes etc.) that are not always properly cleaned, so this
56 cleaning function has been set to keep the system as clean as possible after a
59 You may also add you own test by adding a section into the function run_test().
65 As mentioned in `[1]`, the *prepare-env.sh* and *run_test.sh* can be executed within
66 the container from jenkins.
67 2 jobs have been created, one to run all the test and one that allows testing
68 test suite by test suite.
69 You thus just have to launch the acurate jenkins job on the target lab, all the
70 tests shall be automatically run.
72 When the tests are automatically started from CI, a basic algorithm has been
73 created in order to detect whether the test is runnable or not on the given
75 In fact, one of the most challenging task in Brahmaputra consists in dealing
76 with lots of scenario and installers.
77 Functest test suites cannot be systematically run (e.g. run the ODL suite on an
80 CI provides several information:
82 * The installer (apex|compass|fuel|joid)
83 * The scenario [controller]-[feature]-[mode] with
85 * controller = (odl|onos|ocl|nosdn)
86 * feature = (ovs(dpdk)|kvm)
89 Constraints per test case are defined in the Functest configuration file
90 /home/opnfv/functest/config/config_functest.yaml::
95 scenario: '(ocl)|(odl)|(nosdn)'
98 scenario: '(ocl)|(odl)|(nosdn)'
107 At the end of the Functest environment creation (prepare_env.sh see `[1]`_), a
108 file (/home/opnfv/functest/conf/testcase-list.txt) is created with the list of
109 all the runnable tests.
110 We consider the static constraints as regex and compare them with the scenario.
111 For instance, odl can be run only on scenario including odl in its name.
113 The order of execution is also described in the Functest configuration file::
127 11: openstack-neutron-bgpvpn-api-extension-tests
131 The tests are executed in the following order:
133 * Basic scenario (vPing, vPing_userdata, Tempest)
134 * Controller suites: ODL or ONOS or OpenContrail
135 * Feature projects (promise, vIMS)
136 * Rally (benchmark scenario)
138 At the end of an automated execution, everything is cleaned.
139 Before running Functest, a snapshot of the OpenStack configuration (users,
140 tenants, networks, ....) is performed. After Functest, a clean mechanism is
141 launched to delete everything that would not have been properly deleted in order
142 to restitute the system as it was prior to the tests.