1 ===========================
2 OPNFV functional test guide
3 ===========================
5 Testing is a key challenge of OPNFV.
6 It shall be possible to run functional tests on any OPNFV solution.
8 The goal of this document consists in
9 * a description of functional tests for OPNFV
10 * a description of the tools needed to perform these tests
11 * the procedure to configure the tools and the scenarios associated with these tests
13 Functional tests shall be automated (as much as possible) and collected results shall be used to improve the robustness and the reliability of the overall system.
15 Function tests may cover any domain that could lead to improve the OPNFV solution and define "Telco Cloud" KPI.
17 The last section also describes how to automate these tests within the OPNFV continuous integration project.
19 .. _ETSI: http://docbox.etsi.org/ISG/NFV/Open/Published/gs_NFV001v010101p%20-%20Use%20Cases.pdf
21 ETSI NFV defined 9 use cases (ref ETSI_):
24 * VNF Forwarding graphs
25 * Virtual Network Platform as a Service
26 * Virtualisation of Mobile Core and IMS
27 * Virtualisation of Mobile station
29 * Virtualization of CDNs (vCDN)
30 * Virtualization of the Home environment
32 .. _`Openstack Telco Working Group`: https://wiki.openstack.org/wiki/TelcoWorkingGroup
34 Most of the use cases are also discussed in upstream projects (e.g. `Openstack Telco Working Group`_ )
36 For release 1 (Arno), 4 test suites have been selected:
37 * Rally Bench test suite for Openstack
38 * Openstack Tempest test suite
39 * OpenDaylight test suite
42 The 3 first suites are directly inherited from upstream projects.
43 vPing, that is already present in Tempest suite, has been developped to provided a basic "hello world" functional test example.
45 .. _`Continuous Integration`: https://build.opnfv.org/ci/view/functest/
47 vIMS, vEPC, vPE, vHGW, vCDN use cases are not considered for first release.
48 It does not mean that such use cases cannot be tested on OPNFV Arno.
49 It means that these testcases have not been integrated in the `Continuous Integration`_ and no specific work (integration or developpment) have been done for R1.
50 We may expect that new VNFs and new scenarios will be created and integrated in the future releases.
57 We assume that an OPNFV Arno solution has been installed.
59 .. _here: https://wiki.opnfv.org/documentation/Arno
61 The installation of the OPNFV solution is out of scope of this document but can be found [here_].
62 In the rest of the document the OPNFV solution would be considered as the System Under Test (SUT).
64 The installation and configuration of the tools needed to perform the tests will be described in the following sections.
66 For release 1, the tools are not fully automatically installed, more details will be provided in the configuration section.
68 .. _pharos: https://wiki.opnfv.org/pharos
70 It is recommended to install the different tools on the jump host server as defined in the pharos_ project.
71 The high level architecture can be described as follow::
73 CIMC/Lights+out management Admin Private Public Storage
79 | +-----------------+ | | + |
81 +-----+ Jumpserver | | | | |
82 | | +---------------------+ | | |
84 | | +----------+ | | | | |
85 | | | Rally | +---- --------------------------+ | |
87 | | | Robot | | | | | |
89 | | | vPing | | | | | |
91 | | | Tempest | | | | | |
92 | | +----------+ | | | | |
93 | | FuncTests +-----------------------------------------+ |
95 | | +--------------------------------------------------+
97 | +-----------------+ | | | |
99 | +----------------+ | | | |
101 +----+ +--------------+-+ | | | |
103 | | | +--------------+-+ | | | |
105 | | | | +--------------+-+ | | | |
106 | | | | | 4 | | | | |
107 | +-+ | | +--------------+-+ | | | |
108 | | | | | 5 +---------------+ | | |
109 | +-+ | | nodes for | | | | |
110 | | | | deploying +-------------------------+ | |
111 | +-+ | opnfv | | | | |
112 | | | SUT +-----------------------------------+ |
114 | | +--------------------------------------------+
115 | +----------------+ | | | |
121 -----------------------------
122 Description of the test cases
123 -----------------------------
125 Rally bench test suite
126 ======================
128 .. _Rally: https://wiki.openstack.org/wiki/Rally
130 The OPNFV scenarios are based on the collection of Rally_ scenarios:
140 The goal of this test suite is to test the different modules of OpenStack and get significant figures that could help us to define telco Cloud KPI.
142 This test suite provides performance information on VIM (OpenStack) part.
144 No SLA were defined for release 1, we just consider whether the tests are passed or failed.
146 In the future SLA shall be considered (e.g. accepting booting time for a given image with a given flavour).
148 Through its integration in Continuous Integration, the evolution of the performance of these tests shall also be considered.
153 .. _Tempest: http://docs.openstack.org/developer/tempest/overview.html
155 Tempest_ is the OpenStack Integration Test Suite. We use Rally to run Tempest suite.
157 The goal of this test is to check the OpenStack installation (sanity checks).
163 The ODL suite consists in a set of basic tests inherited from ODL project. The list of tests can be described as follow:
164 * Restconf.basic: Get the controller modules via Restconf
166 * Check OpenStack Networks :: Checking OpenStack Neutron for known networks
167 * Check OpenDaylight Networks :: Checking OpenDaylight Neutron API
168 * Create Network :: Create new network in OpenStack
169 * Check Network :: Check Network created in OpenDaylight
170 * Neutron.Networks :: Checking Network created in OpenStack are pushed
172 * Check OpenStack Subnets :: Checking OpenStack Neutron for known Subnets
173 * Check OpenDaylight subnets :: Checking OpenDaylight Neutron API
174 * Create New subnet :: Create new subnet in OpenStack
175 * Check New subnet :: Check new subnet created in OpenDaylight
176 * Neutron.Subnets :: Checking Subnets created in OpenStack are pushed
178 * Check OpenStack ports :: Checking OpenStack Neutron for known ports
179 * Check OpenDaylight ports :: Checking OpenDaylight Neutron API
180 * Create New Port :: Create new port in OpenStack
181 * Check New Port :: Check new subnet created in OpenDaylight
182 * Neutron.Ports :: Checking Port created in OpenStack are pushed
184 * Delete previously created subnet in OpenStack
185 * Check subnet deleted in OpenDaylight
186 * Check subnet deleted in OpenStack
188 * Delete previously created network in OpenStack
189 * Check network deleted in OpenDaylight
190 * Check network deleted in OpenStack
195 The goal of this test can be described as follow::
198 +-------------+ +-------------+
202 | +------------------>| |
205 | +------------------>| |
206 | Tester | | System |
207 | | Boot VM2 | Under |
208 | +------------------>| Test |
209 | | VM2 pings VM1 | |
211 | | Check console log | |
214 | | else (timeout) | |
218 +-------------+ +-------------+
221 This example, using OpenStack Python clients can be considered as an "Hello World" example and may be modified for future use.
223 .. _tooling_installation:
225 ----------------------
227 ----------------------
229 2 external tools are needed for the functional tests on Arno:
233 Rally is used for benchmarking and running Tempest. Robot is used for OpenDaylight.
235 A script (config_test.py) has been created to simplify as much as possible the installation of the different suites of tests.
237 This script config_test.py_ is hosted in OPNFV repository and uses the configuration file config_functest.yaml_::
239 usage: config_functest.py [-h] [-d] [-f] path action
241 positional arguments:
242 repo_path path to the repository
243 action Possible actions are: 'start|check|clean'
246 -h, --help show this help message and exit
247 -d, --debug Debug mode
248 -f, --force used to avoid prompting the user for confirmation when cleaning functest environment.
251 * start: will prepare the functional testing environment
252 * check: will check the configuration (scenarios available, environment variables properly set, networks,..)
253 * clean: will clean the functional test environement if existing
256 * Install Rally environment
258 * Retrieve test scenarios
259 * Setup ODL environment
260 * Create temporary neutron private network
261 * Create router to connect both
262 * Create Glance images
267 .. _`OpenRC`: http://docs.openstack.org/user-guide/common/cli_set_environment_variables_using_openstack_rc.html
269 .. _`Rally installation procedure`: https://rally.readthedocs.org/en/latest/tutorial/step_0_installation.html
271 .. _`config_test.py` : https://git.opnfv.org/cgit/functest/tree/testcases/config_functest.py
273 .. _`config_functest.yaml` : https://git.opnfv.org/cgit/functest/tree/testcases/config_functest.yaml
276 When integrated in CI, the only prerequisite consists in retrieving the OpenStack credentials (rc file).
277 This file shall be saved as $HOME/functest/opnfv-openrc.shn on the jumphost server.
278 In this case, the script will clone the functest repository, execute environment checks and install tools.
281 The procedure to set up functional testing environment can be described as follow::
283 Log on the Jumphost server
284 Be sure you are no root
285 Modify and adapt needed parameters in the config_functest.yaml. Follow the instructions below.
286 Retrieve OpenStack source file (configure your `OpenRC`_ file to let Rally access to your OpenStack, you can either export it from Horizon or build it manually (OpenStack credentials are required)
287 $ source Your_OpenRC_file
288 $ python <functest_repo_directory>/config_functest.py -d <Your_functest_directory> start
290 At the end of the executing, a new directory will be created <functest_repo_directory> with the following structure::
292 <functest_repo_directory>/ODL
293 <functest_repo_directory>/Rally_repo
294 <functest_repo_directory>/Rally_test
295 <functest_repo_directory>/vPing
296 <functest_repo_directory>/config_functest.yaml
297 <functest_repo_directory>/functest-img.img
299 NOTE: the Rally environment will be installed under ~/.rally/ the default Tempest configuration (automatically generated by Rally based on OpenStack credentials) can be found une .rally/tempest/for-deployment-<deployment_id>/tempest.conf
302 HOWTO configure config_functest.yaml:
304 Do not change the directories structure
305 * image_name: name of the image that will be created in Glance
306 * image_url: URL of the image to be downloaded
307 * image_disk_format: glance image disk format (raw, qcow2, ...)
309 * neutron_private_net_name: name of an OpenStack private network. If not existing, it will be created
310 * neutron_private_subnet_name: private subnet network to be created if not existing
311 * neutron_private_subnet_cidr: range of the private subnet.
312 * neutron_private_subnet_start: start IP
313 * neutron_private_subnet_end: end IP
314 * neutron_router_name: name of the router between the private and the public networks
316 * ping_timeout: time out of the vPing test case
317 * vm_flavor: name of the flavor used to create the VMs
318 * vm_name_1: name of the first VM
319 * vm_name_2: name of the second VM
322 Please note that you need to install this environment only once. Until the credentials of the System Under Test are not changing, the testing environment shall be fine.
324 If you need more details on Rally installation, see `Rally installation procedure`_.
326 You can check if the configuration of rally is fine by typing 'rally deployment check', you shall see the list of available services as follow::
328 # rally deployment check
329 keystone endpoints are valid and following service are available:
330 +-------------+-----------+------------+
331 | Services | Type | Status |
332 +-----------+-------------+------------+
333 | cinder | volume | Available |
334 | cinderv2 | volumev2 | Available |
335 | glance | image | Available |
336 | keystone | identity | Available |
337 | neutron | network | Available |
338 | nova | compute | Available |
339 | nova_ec2 | compute_ec2 | Available |
340 | novav3 | computev3 | Available |
341 +-----------+-------------+------------+
344 +--------------------------------------+----------------------------------------------+------------+
345 | UUID | Name | Size (B) |
346 +--------------------------------------+----------------------------------------------+------------+
347 | 0a15951f-6388-4d5d-8531-79e7205eb140 | cirros_2015_04_10_13_13_18 | 13167616 |
348 | b1504066-045a-4f8f-8919-8c665ef3f400 | Ubuntu 14.04 64b | 253297152 |
349 +--------------------------------------+----------------------------------------------+------------+
352 +--------------------------------------+---------------------+-------+----------+-----------+-----------+
353 | ID | Name | vCPUs | RAM (MB) | Swap (MB) | Disk (GB) |
354 +--------------------------------------+---------------------+-------+----------+-----------+-----------+
355 | 110e6375-a058-4af6-b21e-b765187904d2 | m1.medium | 2 | 1024 | | 20 |
356 | 7084d7e7-415a-455d-a55a-2ad286ddf7c9 | m1.large | 4 | 4096 | | 80 |
357 | a0345ba7-c667-4fd2-964f-7e98f8cda279 | m1.xlarge | 4 | 8192 | | 200 |
358 | accdc28c-5e20-4859-a5cc-61cf9009e56d | m1.small | 1 | 512 | | 10 |
359 +--------------------------------------+---------------------+-------+----------+-----------+-----------+
361 # rally show networks
362 Networks for user `admin` in tenant `admin`:
363 +--------------------------------------+------------------------------+------+
364 | ID | Label | CIDR |
365 +--------------------------------------+------------------------------+------+
366 | 4f43c349-956f-4073-9ef6-75bf4e62a0e7 | functest-net | None |
367 | faefaab1-e503-41fc-875b-5e3112be49ed | provider_network | None |
368 +--------------------------------------+------------------------------+------+
378 $ python <functest_repo_directory>/vPing/vPing.py -d <Your_functest_directory>
384 You can run ODL suite as follow:
385 $ python <functest_repo_directory>testcases/Controllers/ODL/CI/start_tests.sh
387 ODL wiki page describes system preparation and running tests. See `Integration Group CSIT`_.
389 .. _`Integration Group CSIT`: https://wiki.opendaylight.org/view/CrossProject:Integration_Group:CSIT
395 Several scenarios are available (mainly based on native Rally scenarios):
405 * all (every module except tempest and smoke)
407 You can run the script as follow::
409 # python <functest_repo_directory>/testcases/VIM/OpenStack/CI/libraries/run_rally.py <functest_repo_directory> keystone
412 * get the json scenario (if not already available) and put it into the scenario folder
414 * generate the html result page into <result_folder>/<timestamp>/opnfv-[module name].html
415 * generate the json result page into <result_folder>/<timestamp>/opnfv-[module name].json
421 It is possible to use Rally to perform Tempest tests (ref: `tempest installation guide using Rally`_)
422 You just need to run::
426 The different modes available are smoke, baremetal, compute, data_processing, identity, image, network, object_storage, orchestration, telemetry, and volume. By default if you do not precise anything then smoke tests be selected by default. For Arno, it was decided to focus on smoke tests.
428 .. _`tempest installation guide using Rally`: https://www.mirantis.com/blog/rally-openstack-tempest-testing-made-simpler/
439 vPing results are automatically displayed in the console.
444 ODL tests are executed in the console, and 3 result files are generated
450 Results are available in the result folder through a html page and a json file.
455 You can get the results of tempest by typing::
459 You shall see the results as follow::
461 Total results of verification:
463 +--------------------------------------+--------------------------------------+----------+-------+----------+----------------------------+----------+
464 | UUID | Deployment UUID | Set name | Tests | Failures | Created at | Status |
465 +--------------------------------------+--------------------------------------+----------+-------+----------+----------------------------+----------+
466 | 0144c50f-ab03-45fb-9c36-242ad6440b46 | d9e1bb21-8e36-4d89-b137-0c852dbb308e | smoke | 87 | 32 | 2015-05-05 16:36:00.986003 | finished |
467 +--------------------------------------+--------------------------------------+----------+-------+----------+----------------------------+----------+
469 If you run this test several times, you will see as many lines as test attempts.
471 You can get more details on the test by typing::
473 # rally verify show --uuid <UUID of the test>
474 # rally verify detailed --uuid <UUID of the test>
476 "show" will show you all the restults including the time needed to execute the test.
477 "detailed" will display additional elements (errors)
479 Example of test result display::
481 +------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------+--------+
482 | name | time | status |
483 +------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------+--------+
484 | tempest.api.network.test_routers.RoutersTest.test_create_show_list_update_delete_router[id-f64403e2-8483-4b34-8ccd-b09a87bcc68c,smoke] | 0.011466 | FAIL |
485 | tempest.api.network.test_security_groups.SecGroupIPv6Test.test_create_list_update_show_delete_security_group[id-bfd128e5-3c92-44b6-9d66-7fe29d22c802,smoke]| 1.234566 | OK |
486 | tempest.api.network.test_security_groups.SecGroupIPv6Test.test_create_show_delete_security_group_rule[id-cfb99e0e-7410-4a3d-8a0c-959a63ee77e9,smoke] | 1.060221 | OK |
487 | tempest.api.network.test_security_groups.SecGroupIPv6Test.test_list_security_groups[id-e30abd17-fef9-4739-8617-dc26da88e686,smoke] | 0.060797 | OK |
488 | tempest.api.network.test_security_groups.SecGroupTest.test_create_list_update_show_delete_security_group[id-bfd128e5-3c92-44b6-9d66-7fe29d22c802,smoke] | 0.685149 | OK |
489 | tempest.api.network.test_security_groups.SecGroupTest.test_create_show_delete_security_group_rule[id-cfb99e0e-7410-4a3d-8a0c-959a63ee77e9,smoke] | 0.730561 | OK |
490 | tempest.api.network.test_security_groups.SecGroupTest.test_list_security_groups[id-e30abd17-fef9-4739-8617-dc26da88e686,smoke] | 0.116862 | OK |
491 | tempest.api.object_storage.test_account_quotas.AccountQuotasTest | 0.0 | SKIP |
502 For Arno, the CI job performs the following actions:
503 * clean and prepare functest environment
509 * clean functest environment
511 Connection of your platform
512 ===========================
514 .. _`Octopus procedure`: https://wiki.opnfv.org/octopus/jenkins_slave_connection/
516 If you want to add your platform to the community automation, please follow the `Octopus procedure`_.
518 Integrating into CI Pipeline
519 ============================
521 .. _`pipeline document`: https://wiki.opnfv.org/octopus/pipelines
523 Contact Octopus Team (#opnfv-octopus) and see `pipeline document`_ for more details.
531 OPNFV main site: opnfvmain_.
533 OPNFV functional test page: opnfvfunctest_.
535 IRC support chan: #opnfv-testperf
537 .. _opnfvmain: http://www.opnfv.org
538 .. _opnfvfunctest: https://wiki.opnfv.org/opnfv_functional_testing