Merge "Add script to generate the OpenStack defaults"
[functest.git] / docs / userguide / index.rst
1 =========================
2 OPNFV FUNCTEST user guide
3 =========================
4
5 .. toctree::
6    :numbered:
7    :maxdepth: 2
8
9
10 Introduction
11 ============
12
13 The goal of this documents is to describe the Functest test cases as well as
14 provide a procedure about how to execute (or launch) them.
15
16 A presentation has been created for the first OPNFV Summit `[4]`_.
17
18 It is assumed that Functest container has been properly installed `[1]`_.
19
20 .. include:: ./description.rst
21
22 The different scenarios are described in the section hereafter.
23
24 VIM
25 ---
26
27 vPing
28 ^^^^^
29
30 The goal of this test can be described as follows::
31
32  vPing test case
33  +-------------+                   +-------------+
34  |             |                   |             |
35  |             |     Boot VM1      |             |
36  |             +------------------>|             |
37  |             |                   |             |
38  |             |     Get IP VM1    |             |
39  |             +------------------>|             |
40  |   Tester    |                   |   System    |
41  |             |     Boot VM2      |    Under    |
42  |             +------------------>|     Test    |
43  |             |                   |             |
44  |             |   Create (VM2)    |             |
45  |             |   floating IP     |             |
46  |             +------------------>|             |
47  |             |                   |             |
48  |             | SCP vPing script  |             |
49  |             |      to VM2       |             |
50  |             +------------------>|             |
51  |             |                   |             |
52  |             |   SSH to VM2      |             |
53  |             +------------------>|             |
54  |             |                   |             |
55  |             |    Ping VM1       |             |
56  |             |    private IP     |             |
57  |             +------------------>|             |
58  |             |                   |             |
59  |             |    If ping:       |             |
60  |             |      exit OK      |             |
61  |             |    else (timeout) |             |
62  |             |      exit KO      |             |
63  |             |                   |             |
64  +-------------+                   +-------------+
65
66
67 vPing_userdata
68 ^^^^^^^^^^^^^^
69
70 The goal of this test can be described as follow::
71
72  vPing_userdata test case
73  +-------------+                   +-------------+
74  |             |                   |             |
75  |             |     Boot VM1      |             |
76  |             +------------------>|             |
77  |             |                   |             |
78  |             |     Get IP VM1    |             |
79  |             +------------------>|             |
80  |   Tester    |                   |   System    |
81  |             |     Boot VM2      |    Under    |
82  |             +------------------>|     Test    |
83  |             | VM2 pings VM1     |             |
84  |             |   (cloud-init)    |             |
85  |             | Check console log |             |
86  |             |    If ping:       |             |
87  |             |      exit OK      |             |
88  |             |    else (timeout) |             |
89  |             |      exit KO      |             |
90  |             |                   |             |
91  +-------------+                   +-------------+
92
93
94 This example can be considered as an "Hello World" example.
95 It is the first basic example, it must work on any configuration.
96
97 Tempest
98 ^^^^^^^
99
100 Tempest `[2]`_ is the reference OpenStack Integration test suite.
101 It is a set of integration tests to be run against a live OpenStack cluster.
102 Tempest has batteries of tests for:
103
104   * OpenStack API validation
105   * Scenarios
106   * Other specific tests useful in validating an OpenStack deployment
107
108 We use Rally `[3]`_ to run Tempest suite.
109 Rally generates automatically tempest.conf configuration file.
110 Before running actual test cases Functest creates needed resources.
111 Needed parameters are updated in the configuration file.
112 When the Tempest suite is run, each test duration is measured.
113 The full console output is stored in the tempest.log file.
114
115 As an addition of Arno, Brahmaputra runs a customized set of Tempest test cases.
116 The list is specificed through *--tests-file* when running Rally.
117 This option has been introduced in Rally in version 0.1.2.
118
119 The customized test list is available in the Functest repo `[4]`_.
120 This list contains more than 200 Tempest test cases.
121 The list can be divied into two main parts:
122
123   1) Set of tempest smoke test cases
124   2) Set of test cases from DefCore list `[8]`_
125
126 The goal of Tempest test suite is to check the basic functionalities of
127 different OpenStack components on an OPNFV fresh installation using
128 corresponding REST API interfaces.
129
130
131 Rally bench test suites
132 ^^^^^^^^^^^^^^^^^^^^^^^
133
134 Rally `[3]`_ is a benchmarking tool that answers the question::
135
136  “How does OpenStack work at scale?”.
137
138 The goal of this test suite is to test the different modules of OpenStack and
139 get significant figures that could help us to define telco Cloud KPI.
140
141 The OPNFV scenarios are based on the collection of the existing Rally scenarios:
142
143  * authenticate
144  * cinder
145  * glance
146  * heat
147  * keystone
148  * neutron
149  * nova
150  * quotas
151  * requests
152  * vm
153
154 Basic SLA (stop test on errors) have been implemented.
155
156
157 SDN Controllers
158 ---------------
159
160 Brahmaputra introduces new SDN controllers.
161 There are currently 3 possible controllers:
162
163  * OpenDaylight (ODL)
164  * ONOS
165  * OpenContrail (OCL)
166
167 OpenDaylight
168 ^^^^^^^^^^^^
169
170 The OpenDaylight (ODL) test suite consists of a set of basic tests inherited
171 from ODL project.
172 The suite verifies creation and deletion of networks, subnets and ports with
173 OpenDaylight and Neutron.
174
175 The list of tests can be described as follow:
176
177  * Restconf.basic: Get the controller modules via Restconf
178  * Neutron.Networks
179
180    * Check OpenStack Networks :: Checking OpenStack Neutron for known networks
181    * Check OpenDaylight Networks :: Checking OpenDaylight Neutron API
182    * Create Network :: Create new network in OpenStack
183    * Check Network :: Check Network created in OpenDaylight
184    * Neutron.Networks :: Checking Network created in OpenStack are pushed
185
186  * Neutron.Subnets
187
188    * Check OpenStack Subnets :: Checking OpenStack Neutron for known Subnets
189    * Check OpenDaylight subnets :: Checking OpenDaylight Neutron API
190    * Create New subnet :: Create new subnet in OpenStack
191    * Check New subnet :: Check new subnet created in OpenDaylight
192    * Neutron.Subnets :: Checking Subnets created in OpenStack are pushed
193
194  * Neutron.Ports
195
196    * Check OpenStack ports :: Checking OpenStack Neutron for known ports
197    * Check OpenDaylight ports :: Checking OpenDaylight Neutron API
198    * Create New Port :: Create new port in OpenStack
199    * Check New Port :: Check new subnet created in OpenDaylight
200    * Neutron.Ports :: Checking Port created in OpenStack are pushed
201
202  * Delete Ports
203
204    * Delete previously created subnet in OpenStack
205    * Check subnet deleted in OpenDaylight
206    * Check subnet deleted in OpenStack
207
208  * Delete network
209
210    * Delete previously created network in OpenStack
211    * Check network deleted in OpenDaylight
212    * Check network deleted in OpenStack
213
214
215 ONOS
216 ^^^^
217
218 TestON Framework is used to test ONOS function.
219 The test cases deal with L2 and L3 functions.
220 ONOS is configured through OPNFV scenario.
221 The ONOS test suite can be run on any ONOS compliant scenario.
222
223 The test cases may be described as follow:
224
225  * onosfunctest: The mainly executable file contains the initialization of
226    the docker environment and functions called by FUNCvirNetNB and
227    FUNCvirNetNBL3
228
229  * FUNCvirNetNB
230
231    * Create Network: Post Network data and check it in ONOS
232    * Update Network: Update the Network and compare it in ONOS
233    * Delete Network: Delete the Network and check if it's NULL in ONOS or
234      not
235    * Create Subnet: Post Subnet data and check it in ONOS
236    * Update Subnet: Update the Subnet and compare it in ONOS
237    * Delete Subnet: Delete the Subnet and check if it's NULL in ONOS or not
238    * Create Port: Post Port data and check it in ONOS
239    * Update Port: Update the Port and compare it in ONOS
240    * Delete Port: Delete the Port and check if it's NULL in ONOS or not
241
242  * FUNCvirNetNBL3
243
244    * Create Router: Post dataes for create Router and check it in ONOS
245    * Update Router: Update the Router and compare it in ONOS
246    * Delete Router: Delete the Router dataes and check it in ONOS
247    * Create RouterInterface: Post RouterInterface data to an exist Router
248      and check it in ONOS
249    * Delete RouterInterface: Delete the RouterInterface and check the Router
250    * Create FloatingIp: Post dataes for create FloatingIp and check it in
251      ONOS
252    * Update FloatingIp: Update the FloatingIp and compare it in ONOS
253    * Delete FloatingIp: Delete the FloatingIp and check if it's NULL in
254      ONOS  or not
255    * Create External Gateway: Post dataes for create External Gateway to an
256      exit Router and check it
257    * Update External Gateway: Update the External Gateway and compare it
258    * Delete External Gateway: Delete the External Gateway and check if it's
259      NULL in ONOS or not
260
261
262 OpenContrail
263 ^^^^^^^^^^^^
264 TODO OVNO
265
266
267
268 Features
269 --------
270
271 vIMS
272 ^^^^
273 The goal of this test suite consists of:
274
275  * deploying a VNF orchestrator (cloudify)
276  * deploy a Clearwater vIMS (IP Multimedia Subsystem) VNF from this
277    orchestrator based on a TOSCA blueprint defined in `[5]`_
278  * run suite of signaling tests on top of this VNF
279
280 The Clearwater architecture is described as follows:
281
282 .. figure:: ../images/clearwater-architecture.png
283    :align: center
284    :alt: vIMS architecture
285
286 Two types of information are stored in the Test Database:
287
288  * the duration of each step (orchestion deployment, VNF deployment and test)
289  * the test results
290
291 The deployment of a complete functional VNF allows the test of most of the
292 essential functions needed for a NFV system.
293
294 Promise
295 ^^^^^^^
296
297 Promise provides a basic set of test cases as part of Brahmaputra.
298
299 The available 33 test cases can be grouped into 7 test suites:
300
301     #. Add a new OpenStack provider into resource pool: Registers
302        OpenStack into a new resource pool and adds more capacity associated
303        with this pool.
304
305     #. Allocation without reservation: Creates a new server in OpenStack
306        and adds a new allocation record in Promise shim-layer.
307
308     #. Allocation using reservation for immediate use: Creates a resource
309        reservation record with no start/end time and immediately creates a new
310        server in OpenStack and add a new allocation record in Promise
311        shim-layer.
312
313     #. Reservation for future use: Creates a resource reservation record
314        for a future start time, queries, modifies and cancels the newly created
315        reservation.
316
317     #. Capacity planning: Decreases and increases the available capacity
318        from a provider in the future and queries the available collections and
319        utilizations.
320
321     #. Reservation with conflict: Tries to create reservations for
322        immediate and future use with conflict.
323
324     #. Cleanup test allocations: Destroys all allocations in OpenStack.
325
326 The test results are pushed into the LF test DB:
327   * Duration of the Promise test case
328   * Number of tests / failures
329
330 The specific parameters for Promise can be found in config_functest.yaml and
331 include::
332
333    promise:
334      general:
335          tenant_name: Name of the OpenStack tenant/project (e.g. promise)
336          tenant_description: Description of the OpenStack tenant (e.g. promise Functionality Testing)
337          user_name: Name of the user tenant (e.g. promiser)
338          user_pwd: Password of the user tenant (e.g. test)
339          image_name: Name of the software image (e.g. promise-img)
340          flavor_name: Name of the flavor (e.g. promise-flavor with 1 vCPU and 512 MB RAM)
341          flavor_vcpus: 1
342          flavor_ram: 512
343          flavor_disk: 0
344
345 .. include:: ./runfunctest.rst
346
347 Test results
348 ============
349
350 VIM
351 ---
352
353 vPing
354 ^^^^^
355
356 vPing results are displayed in the console::
357
358   FUNCTEST.info: Running vPing test...
359   2016-01-23 03:18:20,153 - vPing- INFO - Creating neutron network vping-net...
360   2016-01-23 03:18:35,476 - vPing- INFO - Flavor found 'm1.small'
361   2016-01-23 03:18:36,350 - vPing- INFO - vPing Start Time:'2016-01-23 03:18:36'
362   2016-01-23 03:18:38,571 - vPing- INFO - Creating instance 'opnfv-vping-1' with IP 192.168.130.30...
363   2016-01-23 03:18:53,716 - vPing- INFO - Instance 'opnfv-vping-1' is ACTIVE.
364   2016-01-23 03:18:55,239 - vPing- INFO - Creating instance 'opnfv-vping-2' with IP 192.168.130.40...
365   2016-01-23 03:19:15,593 - vPing- INFO - Instance 'opnfv-vping-2' is ACTIVE.
366   2016-01-23 03:19:15,593 - vPing- INFO - Creating floating IP for the second VM...
367   2016-01-23 03:19:18,017 - vPing- INFO - Floating IP created: '10.2.65.6'
368   2016-01-23 03:19:18,017 - vPing- INFO - Associating floating ip: '10.2.65.6' to VM2
369   2016-01-23 03:19:37,839 - vPing- INFO - SCP ping script to VM2...
370   2016-01-23 03:19:37,839 - vPing- INFO - Waiting for ping...
371   2016-01-23 03:19:40,130 - vPing- INFO - vPing detected!
372   2016-01-23 03:19:40,130 - vPing- INFO - vPing duration:'63.8'
373   2016-01-23 03:19:40,130 - vPing- INFO - Cleaning up...
374   2016-01-23 03:20:06,574 - vPing- INFO - Deleting network 'vping-net'...
375   2016-01-23 03:20:13,587 - vPing- INFO - vPing OK
376
377
378
379
380 vPing_userdata
381 ^^^^^^^^^^^^^^
382
383 vPing_userdata results are displayed in the console::
384
385     2016-01-06 16:06:20,550 - vPing- INFO - Creating neutron network vping-net...
386     2016-01-06 16:06:23,867 - vPing- INFO - Flavor found 'm1.small'
387     2016-01-06 16:06:24,457 - vPing- INFO - vPing Start Time:'2016-01-06 16:06:24'
388     2016-01-06 16:06:24,626 - vPing- INFO - Creating instance 'opnfv-vping-1' with IP 192.168.130.30...
389     2016-01-06 16:06:39,351 - vPing- INFO - Instance 'opnfv-vping-1' is ACTIVE.
390     2016-01-06 16:06:39,650 - vPing- INFO - Creating instance 'opnfv-vping-2' with IP 192.168.130.40...
391     2016-01-06 16:06:53,330 - vPing- INFO - Instance 'opnfv-vping-2' is ACTIVE.
392     2016-01-06 16:06:53,330 - vPing- INFO - Waiting for ping...
393     2016-01-06 16:06:58,669 - vPing- INFO - vPing detected!
394     2016-01-06 16:06:58,669 - vPing- INFO - vPing duration:'34.2'
395     2016-01-06 16:06:58,670 - vPing- INFO - Cleaning up...
396     2016-01-06 16:07:12,661 - vPing- INFO - Deleting network 'vping-net'...
397     2016-01-06 16:07:14,748 - vPing- INFO - vPing OK
398
399 A json file is produced and pushed into the test result database.
400
401
402 Tempest
403 ^^^^^^^
404
405 The Tempest results are displayed in the console::
406
407   FUNCTEST.info: Running Tempest tests...
408   2016-01-28 07:56:55,380 - run_tempest - INFO - Creating tenant and user for Tempest suite
409   2016-01-28 07:56:56.127 23795 INFO rally.verification.tempest.tempest [-] Starting: Creating configuration file for Tempest.
410   2016-01-28 07:56:59.512 23795 INFO rally.verification.tempest.tempest [-] Completed: Creating configuration file for Tempest.
411   16-01-28 07:57:00,597 - run_tempest - INFO - Starting Tempest test suite: '--tests-file /home/opnfv/repos/functest/testcases/VIM/OpenStack/CI/custom_tests/test_list.txt'.
412   Total results of verification:
413   .
414   +--------------------------------------+--------------------------------------+----------+-------+----------+----------------------------+----------+
415   | UUID                                 | Deployment UUID                      | Set name | Tests | Failures | Created at                 | Status   |
416   +--------------------------------------+--------------------------------------+----------+-------+----------+----------------------------+----------+
417   | e0bf7770-2c0f-4c63-913c-cd51a6edd96d | 16582e1e-7b01-4d5d-9c13-a26db8567b7b |          | 144   | 30       | 2016-01-28 07:57:01.044856 | finished |
418   +--------------------------------------+--------------------------------------+----------+-------+----------+----------------------------+----------+
419   .
420   Tests:
421   .
422   +------------------------------------------------------------------------------------------------------------------------------------------+-----------+---------+
423   | name                                                                                                                                     | time      | status  |
424   +------------------------------------------------------------------------------------------------------------------------------------------+-----------+---------+
425   | tempest.api.compute.flavors.test_flavors.FlavorsV2TestJSON.test_get_flavor                                                               | 0.29804   | success |
426   | tempest.api.compute.flavors.test_flavors.FlavorsV2TestJSON.test_list_flavors                                                             | 0.06289   | success |
427   | tempest.api.compute.images.test_images.ImagesTestJSON.test_delete_saving_image                                                           | 9.21756   | success |
428   | tempest.api.compute.images.test_images_oneserver.ImagesOneServerTestJSON.test_create_delete_image                                        | 8.65376   | success |
429   | tempest.api.compute.images.test_images_oneserver.ImagesOneServerTestJSON.test_create_image_specify_multibyte_character_image_name        | 9.10993   | success |
430   | tempest.api.compute.images.test_list_image_filters.ListImageFiltersTestJSON.test_list_images_filter_by_changes_since                     | 0.19585   | success |
431   ...........................................
432   2016-01-28 08:19:32,132 - run_tempest - INFO - Results: {'timestart': '2016-01-2807:57:01.044856', 'duration': 1350, 'tests': 144, 'failures': 30}
433   2016-01-28 08:19:32,133 - run_tempest - INFO - Pushing results to DB: 'http://testresults.opnfv.org/testapi/results'.
434   2016-01-28 08:19:32,278 - run_tempest - INFO - Deleting tenant and user for Tempest suite)
435
436 In order to check all the available test case related debug information, please
437 inspect tempest.log file stored into related Rally deployment folder.
438
439 The Tempest results are pushed to the Test Database.
440
441 Rally
442 ^^^^^
443
444 The Rally results are displayed in the console, each module is run one after the
445 other. Tables are displayed::
446
447   +-------------------------------------------------------------------------------------------+
448   |                                   Response Times (sec)                                    |
449   +----------------------+-------+--------+--------+--------+-------+-------+---------+-------+
450   | action               | min   | median | 90%ile | 95%ile | max   | avg   | success | count |
451   +----------------------+-------+--------+--------+--------+-------+-------+---------+-------+
452   | keystone.create_role | 0.358 | 0.572  | 0.772  | 0.811  | 1.106 | 0.603 | 100.0%  | 20    |
453   | keystone.add_role    | 0.32  | 0.436  | 0.846  | 0.903  | 1.018 | 0.51  | 100.0%  | 20    |
454   | keystone.list_roles  | 0.102 | 0.185  | 0.253  | 0.275  | 0.347 | 0.188 | 100.0%  | 20    |
455   | total                | 0.845 | 1.223  | 1.821  | 1.822  | 1.823 | 1.302 | 100.0%  | 20    |
456   +----------------------+-------+--------+--------+--------+-------+-------+---------+-------+
457   Load duration: 7.13633608818
458   Full duration: 36.7863121033
459   ..............
460   +------------------------------------------------------------------------------------------+
461   |                                   Response Times (sec)                                   |
462   +---------------------+-------+--------+--------+--------+-------+-------+---------+-------+
463   | action              | min   | median | 90%ile | 95%ile | max   | avg   | success | count |
464   +---------------------+-------+--------+--------+--------+-------+-------+---------+-------+
465   | nova.create_keypair | 1.005 | 1.784  | 3.025  | 3.636  | 4.373 | 2.004 | 100.0%  | 20    |
466   | nova.delete_keypair | 0.199 | 0.699  | 1.007  | 1.244  | 3.014 | 0.79  | 100.0%  | 20    |
467   | total               | 1.249 | 2.625  | 4.259  | 4.845  | 5.131 | 2.794 | 100.0%  | 20    |
468   +---------------------+-------+--------+--------+--------+-------+-------+---------+-------+
469   Load duration: 14.9231169224
470   Full duration: 71.4614388943
471
472
473 At the end of the module test, a message is displayed to provide a global
474 summary (Test OK or test failed). The raw results are pushed into the Test
475 Database.
476
477
478 Controllers
479 -----------
480
481 OpenDaylight
482 ^^^^^^^^^^^^
483
484 The results of ODL tests can be seen in the console::
485
486  ==============================================================================
487  Basic
488  ==============================================================================
489  Basic.010 Restconf OK :: Test suite to verify Restconf is OK
490  ==============================================================================
491  Get Controller Modules :: Get the controller modules via Restconf     | PASS |
492  ------------------------------------------------------------------------------
493  Basic.010 Restconf OK :: Test suite to verify Restconf is OK          | PASS |
494  1 critical test, 1 passed, 0 failed
495  1 test total, 1 passed, 0 failed
496  ==============================================================================
497  Basic                                                                 | PASS |
498  1 critical test, 1 passed, 0 failed
499  1 test total, 1 passed, 0 failed
500  ==============================================================================
501  Output:  /home/jenkins-ci/workspace/functest-opnfv-jump-2/output.xml
502  Log:     /home/jenkins-ci/workspace/functest-opnfv-jump-2/log.html
503  Report:  /home/jenkins-ci/workspace/functest-opnfv-jump-2/report.html
504
505  ..............................................................................
506
507  Neutron.Delete Networks :: Checking Network deleted in OpenStack a... | PASS |
508  2 critical tests, 2 passed, 0 failed
509  2 tests total, 2 passed, 0 failed
510  ==============================================================================
511  Neutron :: Test suite for Neutron Plugin                              | PASS |
512  18 critical tests, 18 passed, 0 failed
513  18 tests total, 18 passed, 0 failed
514  ==============================================================================
515  Output:  /home/jenkins-ci/workspace/functest-opnfv-jump-2/output.xml
516  Log:     /home/jenkins-ci/workspace/functest-opnfv-jump-2/log.html
517  Report:  /home/jenkins-ci/workspace/functest-opnfv-jump-2/report.html
518
519 3 result files are generated:
520  * output.xml
521  * log.html
522  * report.html
523
524 **ODL result page**
525
526 .. figure:: ../images/functestODL.png
527    :width: 170mm
528    :align: center
529    :alt: ODL suite result page
530
531
532 ONOS
533 ^^^^
534
535 The ONOS test logs can be found in OnosSystemTest/, and TestON/, and logs/
536 (ONOSCI_PATH to be added), and can also be seen in the console::
537
538  ******************************
539  Result summary for Testcase4
540  ******************************
541
542  2016-01-14 05:25:40,529 - FUNCvirNetNBL3 - INFO - ONOS Router Delete test Start
543
544  [2016-01-14 05:25:40.529644] [FUNCvirNetNBL3] [CASE]  Virtual Network NBI Test - Router
545  2016-01-14 05:25:40,530 - FUNCvirNetNBL3 - INFO - Generate Post Data
546
547  [2016-01-14 05:25:40.530825] [FUNCvirNetNBL3] [STEP]  4.1: Post Network Data via HTTP(Post Router need post network)
548  2016-01-14 05:25:40,531 - FUNCvirNetNBL3 - INFO - Sending request http://192.168.122.56:8181/onos/vtn/networks/ using POST method.
549  2016-01-14 05:25:40,539 - FUNCvirNetNBL3 - INFO - Verifying the Expected is equal to the actual or not using assert_equal
550  2016-01-14 05:25:40,539 - FUNCvirNetNBL3 - INFO - Post Network Success
551  2016-01-14 05:25:40,539 - FUNCvirNetNBL3 - INFO - Assertion Passed
552
553  [2016-01-14 05:25:40.539687] [FUNCvirNetNBL3] [STEP]  4.2: Post Router Data via HTTP
554  2016-01-14 05:25:40,540 - FUNCvirNetNBL3 - INFO - Sending request http://192.168.122.56:8181/onos/vtn/routers/ using POST method.
555  2016-01-14 05:25:40,543 - FUNCvirNetNBL3 - INFO - Verifying the Expected is equal to the actual or not using assert_equal
556  2016-01-14 05:25:40,543 - FUNCvirNetNBL3 - INFO - Post Router Success
557  2016-01-14 05:25:40,543 - FUNCvirNetNBL3 - INFO - Assertion Passed
558
559  [2016-01-14 05:25:40.543489] [FUNCvirNetNBL3] [STEP]  4.3: Delete Router Data via HTTP
560  2016-01-14 05:25:40,543 - FUNCvirNetNBL3 - INFO - Sending request http://192.168.122.56:8181/onos/vtn/routers/e44bd655-e22c-4aeb-b1e9-ea1606875178 using DELETE method.
561  2016-01-14 05:25:40,546 - FUNCvirNetNBL3 - INFO - Verifying the Expected is equal to the actual or not using assert_equal
562  2016-01-14 05:25:40,546 - FUNCvirNetNBL3 - INFO - Delete Router Success
563  2016-01-14 05:25:40,546 - FUNCvirNetNBL3 - INFO - Assertion Passed
564
565  [2016-01-14 05:25:40.546774] [FUNCvirNetNBL3] [STEP]  4.4: Get Router Data is NULL
566  2016-01-14 05:25:40,547 - FUNCvirNetNBL3 - INFO - Sending request http://192.168.122.56:8181/onos/vtn/routers/e44bd655-e22c-4aeb-b1e9-ea1606875178 using GET method.
567  2016-01-14 05:25:40,550 - FUNCvirNetNBL3 - INFO - Verifying the Expected is equal to the actual or not using assert_equal
568  2016-01-14 05:25:40,550 - FUNCvirNetNBL3 - INFO - Get Router Success
569  2016-01-14 05:25:40,550 - FUNCvirNetNBL3 - INFO - Assertion Passed
570
571
572  *****************************
573   Result: Pass
574  *****************************
575
576  .......................................................................................
577
578  ******************************
579   Result summary for Testcase9
580  ******************************
581  .......................................................................................
582
583
584  [2016-01-14 05:26:42.543489] [FUNCvirNetNBL3] [STEP]  9.6: FloatingIp Clean Data via HTTP
585  2016-01-14 05:26:42,543 - FUNCvirNetNBL3 - INFO - Sending request http://192.168.122.56:8181/onos/vtn/floatingips/e44bd655-e22c-4aeb-b1e9-ea1606875178 using DELETE method.
586  2016-01-14 05:26:42,546 - FUNCvirNetNBL3 - INFO - Verifying the Expected is equal to the actual or not using assert_equal
587  2016-01-14 05:26:42,546 - FUNCvirNetNBL3 - ERROR - Delete Floatingip failed
588
589  .......................................................................................
590
591  *****************************
592   Result: Failed
593  *****************************
594
595 There is a result summary for each testcase, and a global summary for the whole test.
596 If any problem occurs during the test, a ERROR message will be provided in the test and the the global summary::
597
598  *************************************
599          Test Execution Summary
600  *************************************
601
602   Test Start           : 14 Jan 2016 05:25:37
603   Test End             : 14 Jan 2016 05:25:41
604   Execution Time       : 0:00:03.349087
605   Total tests planned  : 11
606   Total tests RUN      : 11
607   Total Pass           : 8
608   Total Fail           : 3
609   Total No Result      : 0
610   Success Percentage   : 72%
611   Execution Result     : 100%
612
613
614 OpenContrail
615 ^^^^^^^^^^^^
616
617 TODO OVNO
618
619
620 Feature
621 -------
622
623 vIMS
624 ^^^^
625
626 The results in the console are very verbose::
627
628     FUNCTEST.info: Running vIMS test...
629     2016-01-07 12:30:24,107 - vIMS - INFO - Prepare OpenStack plateform (create tenant and user)
630     2016-01-07 12:30:24,484 - vIMS - INFO - Update OpenStack creds informations
631     2016-01-07 12:30:24,484 - vIMS - INFO - Upload some OS images if it doesn't exist
632     2016-01-07 12:30:24,917 - vIMS - INFO - centos_7 image doesn't exist on glance repository.
633                                 Try downloading this image and upload on glance !
634     2016-01-07 12:31:01,268 - vIMS - INFO - ubuntu_14.04 image doesn't exist on glance repository.
635                                 Try downloading this image and upload on glance !
636     2016-01-07 12:31:28,670 - vIMS - INFO - Update security group quota for this tenant
637     2016-01-07 12:31:28,903 - vIMS - INFO - Update cinder quota for this tenant
638     2016-01-07 12:31:29,355 - vIMS - INFO - Collect flavor id for cloudify manager server
639     2016-01-07 12:31:30,453 - vIMS - INFO - Prepare virtualenv for cloudify-cli
640     2016-01-07 12:31:30,453 - vIMS - DEBUG - Executing command : chmod +x /home/opnfv/repos/functest/testcases/vIMS/CI/create_venv.sh
641     2016-01-07 12:31:30,460 - vIMS - DEBUG - Executing command : /home/opnfv/repos/functest/testcases/vIMS/CI/create_venv.sh /home/opnfv/functest/data/vIMS/
642     2016-01-07 12:31:30,469 - vIMS - INFO - Downloading the cloudify manager server blueprint
643     2016-01-07 12:31:46,028 - vIMS - INFO - Cloudify deployment Start Time:'2016-01-07 12:31:46'
644     2016-01-07 12:31:46,029 - vIMS - INFO - Writing the inputs file
645     2016-01-07 12:31:46,032 - vIMS - INFO - Launching the cloudify-manager deployment
646     .........................................
647     2016-01-07 12:36:51 LOG <manager> [rabbitmq_3c04e.create] INFO: preparing fabric environment...
648     2016-01-07 12:36:51 LOG <manager> [rabbitmq_3c04e.create] INFO: environment prepared successfully
649     .........................................
650     2016-01-07 12:42:51,982 - vIMS - INFO - Cloudify-manager server is UP !
651     2016-01-07 12:42:51,983 - vIMS - INFO - Cloudify deployment duration:'666.0'
652     2016-01-07 12:42:51,983 - vIMS - INFO - Collect flavor id for all clearwater vm
653     2016-01-07 12:42:53,330 - vIMS - INFO - vIMS VNF deployment Start Time:'2016-01-07 12:42:53'
654     2016-01-07 12:42:53,330 - vIMS - INFO - Downloading the openstack-blueprint.yaml blueprint
655     2016-01-07 12:43:05,798 - vIMS - INFO - Writing the inputs file
656     2016-01-07 12:43:05,801 - vIMS - INFO - Launching the clearwater deployment
657     2016-01-07 12:43:05,801 - vIMS - DEBUG - Executing command : /bin/bash -c 'source /home/opnfv/functest/data/vIMS/venv_cloudify/bin/activate; cd /home/opnfv/functest/data/vIMS/opnfv-cloudify-clearwater; cfy blueprints upload -b clearwater -p openstack-blueprint.yaml; cfy deployments create -b clearwater -d clearwater-opnfv --inputs inputs.yaml; cfy executions start -w install -d clearwater-opnfv --timeout 1800; '
658     2016-01-07 13:01:50,577 - vIMS - DEBUG - Validating openstack-blueprint.yaml
659     Blueprint validated successfully
660     Uploading blueprint openstack-blueprint.yaml to management server 172.30.10.165
661     Uploaded blueprint, blueprint's id is: clearwater
662     Creating new deployment from blueprint clearwater at management server 172.30.10.165
663     Deployment created, deployment's id is: clearwater-opnfv
664     .........................................
665     2016-01-07 13:01:50,578 - vIMS - INFO - The deployment of clearwater-opnfv is ended
666     2016-01-07 13:01:50,578 - vIMS - INFO - vIMS VNF deployment duration:'1137.2'
667     2016-01-07 13:04:50,591 - vIMS - DEBUG - Trying to get clearwater nameserver IP ...
668     2016-01-07 13:04:55,176 - vIMS - INFO - vIMS functional test Start Time:'2016-01-07 13:04:55'
669     2016-01-07 13:14:20,694 - vIMS - INFO - vIMS functional test duration:'565.5'
670     .........................................
671     Basic Call - Rejected by remote endpoint (TCP) - (6505550603, 6505550969) Passed
672     Basic Call - Rejected by remote endpoint (UDP) - (6505550095, 6505550084) Passed
673     Basic Call - Messages - Pager model (TCP) - (6505550000, 6505550520) Passed
674     Basic Call - Messages - Pager model (UDP) - (6505550742, 6505550077) Passed
675     Basic Call - Pracks (TCP) - (6505550670, 6505550304) Passed
676     Basic Call - Pracks (UDP) - (6505550990, 6505550391) Passed
677     Basic Registration (TCP) - (6505550744) Passed
678     Basic Registration (UDP) - (6505550616) Passed
679     Multiple Identities (TCP) - (6505550957, 6505550949) Passed
680     Multiple Identities (UDP) - (6505550771, 6505550675) Passed
681     .........................................
682     2016-01-07 13:14:20,695 - vIMS - DEBUG - Trying to load test results
683     2016-01-07 13:14:20,702 - vIMS - DEBUG - Push result into DB
684     2016-01-07 13:14:20,702 - vIMS - DEBUG - Pushing results to DB....
685     2016-01-07 13:14:21,396 - vIMS - DEBUG - <Response [200]>
686     2016-01-07 13:14:21,396 - vIMS - INFO - Launching the clearwater-opnfv undeployment
687
688 Please note that vIMS traces are very verbose but can bee summarized in several
689 steps:
690
691  * INFO: environment prepared successfully => environment OK
692  * INFO - Cloudify-manager server is UP ! => orchestrator deployed
693  * INFO - The deployment of clearwater-opnfv is ended => VNF deployed
694  * Multiple Identities (UDP) - (6505550771, 6505550675) Passed => tests run
695  * DEBUG - Pushing results to DB.... => tests saved
696
697
698 Promise
699 ^^^^^^^
700
701 TODO Promise
702
703
704 Functest in test Dashboard
705 ==========================
706
707 The OPNFV testing group created a test collection database to collect the test
708 results from CI.
709 Any test project running on any lab integrated in CI can push the results to
710 this database.
711 This databse can be used afterwards to see the evolution of the tests and
712 compare the results versus the installers, the scenario or the labs.
713
714 You can find more information about the dashboard from Testing Dashboard wiki
715 page `[6]`_.
716
717
718 Overall Architecture
719 --------------------
720
721 The Test result management in Brahmaputra can be summarized as follow::
722
723   +-------------+    +-------------+    +-------------+
724   |             |    |             |    |             |
725   |   Test      |    |   Test      |    |   Test      |
726   | Project #1  |    | Project #2  |    | Project #N  |
727   |             |    |             |    |             |
728   +-------------+    +-------------+    +-------------+
729            |               |               |
730            V               V               V
731        +-----------------------------------------+
732        |                                         |
733        |         Test Rest API front end         |
734        |  http://testresults.opnfv.org/testapi   |
735        |                                         |
736        +-----------------------------------------+
737            A                |
738            |                V
739            |     +-------------------------+
740            |     |                         |
741            |     |    Test Results DB      |
742            |     |         Mongo DB        |
743            |     |                         |
744            |     +-------------------------+
745            |
746            |
747      +----------------------+
748      |                      |
749      |    test Dashboard    |
750      |                      |
751      +----------------------+
752
753 The Test dashboard URL is: TODO LF
754 A proto Test dashboard has been realized: http://testresults.opnfv.org/proto/
755
756 Test API description
757 --------------------
758
759 The Test API is used to declare pods, projects, test cases and test results. An
760 additional method dashboard has been added to post-process the raw results. The
761 data model is very basic, 4 objects are created:
762
763   * Pods
764   * Test projects
765   * Test cases
766   * Test results
767
768 Pods::
769
770   {
771     "id": <ID>,
772     "details": <URL description of the POD>,
773     "creation_date": YYYY-MM-DD HH:MM:SS ,
774     "name": <The POD Name>,
775     "mode": <metal or virtual>
776   },
777
778 Test project::
779
780   {
781     "id": <ID>,
782     "name": <Name of the Project>,
783     "creation_date": "YYYY-MM-DD HH:MM:SS",
784     "description": <Short description>
785   },
786
787 Test case::
788
789   {
790     "id": <ID>,
791     "name":<Name of the test case>,
792     "creation_date": "YYYY-MM-DD HH:MM:SS",
793     "description": <short description>,
794     "url":<URL for longer description>
795   },
796
797 Test results::
798
799   {
800     "_id": <ID,
801     "project_name": <Reference to project>,
802     "pod_name": <Reference to POD where the test was executed>,
803     "version": <Scenario on which the test was executed>,
804     "installer": <Installer Apex or Compass or Fuel or Joid>,
805     "description": <Short description>,
806     "creation_date": "YYYY-MM-DD HH:MM:SS",
807     "case_name": <Reference to the test case>
808     "details":{
809        <- the results to be put here ->
810     }
811
812
813 For Brahmaputra, we got:
814
815  * 16 pods
816  * 18 projects
817  * 101 test cases
818
819 The projects and the test cases have been frozen in December.
820 But all were not ready for Brahmaputra.
821
822
823
824 The API can described as follow:
825
826 Version:
827
828  +--------+--------------------------+------------------------------------------+
829  | Method | Path                     | Description                              |
830  +========+==========================+==========================================+
831  | GET    | /version                 | Get API version                          |
832  +--------+--------------------------+------------------------------------------+
833
834
835 Pods:
836
837  +--------+--------------------------+------------------------------------------+
838  | Method | Path                     | Description                              |
839  +========+==========================+==========================================+
840  | GET    | /pods                    | Get the list of declared Labs (PODs)     |
841  +--------+--------------------------+------------------------------------------+
842  | POST   | /pods                    | Declare a new POD                        |
843  |        |                          | Content-Type: application/json           |
844  |        |                          | {                                        |
845  |        |                          |    "name": "pod_foo",                    |
846  |        |                          |    "creation_date": "YYYY-MM-DD HH:MM:SS"|
847  |        |                          | }                                        |
848  +--------+--------------------------+------------------------------------------+
849
850 Projects:
851
852  +--------+--------------------------+------------------------------------------+
853  | Method | Path                     | Description                              |
854  +========+==========================+==========================================+
855  | GET    | /test_projects           | Get the list of test projects            |
856  +--------+--------------------------+------------------------------------------+
857  | GET    |/test_projects/{project}  | Get details on {project}                 |
858  |        |                          |                                          |
859  +--------+--------------------------+------------------------------------------+
860  | POST   | /test_projects           | Add a new test project                   |
861  |        |                          | Content-Type: application/json           |
862  |        |                          | {                                        |
863  |        |                          |    "name": "project_foo",                |
864  |        |                          |    "description": "whatever you want"    |
865  |        |                          | }                                        |
866  +--------+--------------------------+------------------------------------------+
867  | PUT    | /test_projects/{project} | Update a test project                    |
868  |        |                          |                                          |
869  |        |                          | Content-Type: application/json           |
870  |        |                          | {                                        |
871  |        |                          |    <the field(s) you want to modify>     |
872  |        |                          | }                                        |
873  +--------+--------------------------+------------------------------------------+
874  | DELETE | /test_projects/{project} | Delete a test project                    |
875  +--------+--------------------------+------------------------------------------+
876
877
878 Test cases:
879
880  +--------+--------------------------+------------------------------------------+
881  | Method | Path                     | Description                              |
882  +========+==========================+==========================================+
883  | GET    | /test_projects/{project}/| Get the list of test cases of {project}  |
884  |        | cases                    |                                          |
885  +--------+--------------------------+------------------------------------------+
886  | POST   | /test_projects/{project}/| Add a new test case to {project}         |
887  |        | cases                    | Content-Type: application/json           |
888  |        |                          | {                                        |
889  |        |                          |    "name": "case_foo",                   |
890  |        |                          |    "description": "whatever you want"    |
891  |        |                          |    "creation_date": "YYYY-MM-DD HH:MM:SS"|
892  |        |                          |    "url": "whatever you want"            |
893  |        |                          | }                                        |
894  +--------+--------------------------+------------------------------------------+
895  | PUT    | /test_projects/{project}?| Modify a test case of {project}          |
896  |        | case_name={case}         |                                          |
897  |        |                          | Content-Type: application/json           |
898  |        |                          | {                                        |
899  |        |                          |    <the field(s) you want to modify>     |
900  |        |                          | }                                        |
901  +--------+--------------------------+------------------------------------------+
902  | DELETE | /test_projects/{project}/| Delete a test case                       |
903  |        | case_name={case}         |                                          |
904  +--------+--------------------------+------------------------------------------+
905
906 Test Results:
907
908  +--------+--------------------------+------------------------------------------+
909  | Method | Path                     | Description                              |
910  +========+==========================+==========================================+
911  | GET    |/results/project={project}| Get the test results of {project}        |
912  +--------+--------------------------+------------------------------------------+
913  | GET    |/results/case={case}      | Get the test results of {case}           |
914  +--------+--------------------------+------------------------------------------+
915  | GET    |/results?pod={pod}        | get the results on pod {pod}             |
916  +--------+--------------------------+------------------------------------------+
917  | GET    |/results?installer={inst} | Get the test results of installer {inst} |
918  +--------+--------------------------+------------------------------------------+
919  | GET    |/results?version={version}| Get the test results of scenario         |
920  |        |                          | {version}. Initially the version param   |
921  |        |                          | was reflecting git version, in Functest  |
922  |        |                          | it was decided to move to scenario       |
923  +--------+--------------------------+------------------------------------------+
924  | GET    |/results?project={project}| Get all the results of the test case     |
925  |        |&case={case}              | {case} of the project {project} with     |
926  |        |&version={scenario}       | version {scenario} installed by installer|
927  |        |&installer={installer}    | {installer} on POD {pod} stored since    |
928  |        |&pod={pod}                | {days} days                              |
929  |        |                          | {project_name} and {case_name} are       |
930  |        |&period={days}            | mandatory, the other parameters are      |
931  |        |                          | optional.                                |
932  +--------+--------------------------+------------------------------------------+
933  | POST   | /results                 | Add a new test results                   |
934  |        |                          | Content-Type: application/json           |
935  |        |                          | {                                        |
936  |        |                          |    "project_name": "project_foo",        |
937  |        |                          |    "case_name": "case_foo",              |
938  |        |                          |    "pod_name": "pod_foo",                |
939  |        |                          |    "installer": "installer_foo",         |
940  |        |                          |    "version": "scenario_foo",            |
941  |        |                          |    "details": <your results>             |
942  |        |                          | }                                        |
943  +--------+--------------------------+------------------------------------------+
944
945
946 Dashboard:
947
948  +--------+--------------------------+------------------------------------------+
949  | Method | Path                     | Description                              |
950  +========+==========================+==========================================+
951  | GET    |/dashboard?               | Get all the dashboard ready results of   |
952  |        |&project={project}        | {case} of the project {project}          |
953  |        |&case={case}              | version {scenario} installed by installer|
954  |        |&version={scenario}       | {installer} on POD {pod} stored since    |
955  |        |&installer={installer}    | {days} days                              |
956  |        |&pod={pod}                |                                          |
957  |        |&period={days}            | {project_name} and {case_name} are       |
958  |        |                          | mandatory, the other parameters are      |
959  |        |                          | optional.                                |
960  +--------+--------------------------+------------------------------------------+
961
962
963 The results with dashboard method are post-processed from raw results.
964 Please note that dashboard results are not stored. Only raw results are stored.
965
966
967
968 Test Dashboard
969 --------------
970
971 Based on dashboard post-porcessed results, a Test dashboard is automatically
972 generated.
973
974 TODO LF
975 or http://testresults.opnfv.org/proto/
976
977
978 Troubleshooting
979 ===============
980
981 VIM
982 ---
983
984 vPing
985 ^^^^^
986
987
988 vPing_userdata
989 ^^^^^^^^^^^^^^
990
991
992 Tempest
993 ^^^^^^^
994
995 In the upstream OpenStack CI all the Tempest test cases are supposed to pass.
996 If some test cases fail in an OPNFV deployment, the reason is very probably one
997 of the following::
998
999  +-----------------------------+------------------------------------------------+
1000  | Error                       | Details                                        |
1001  +=============================+================================================+
1002  | Resources required for test | Such resources could be e.g. an external       |
1003  | case execution are missing  | network and access to the management subnet    |
1004  |                             | (adminURL) from the Functest docker container. |
1005  +-----------------------------+------------------------------------------------+
1006  | OpenStack components or     | Check running services in the controller and   |
1007  | services are missing or not | compute nodes (e.g. with "systemctl" or        |
1008  | configured properly         | "service" commands). Configuration parameters  |
1009  |                             | can be verified from related .conf files       |
1010  |                             | located under /etc/<component> directories.    |
1011  +-----------------------------+------------------------------------------------+
1012  | Some resources required for | The tempest.conf file, automatically generated |
1013  | execution test cases are    | by Rally in Functest, does not contain all the |
1014  | missing                     | needed parameters or some parameters are not   |
1015  |                             | set properly.                                  |
1016  |                             | The tempest.conf file is located in /home/opnfv|
1017  |                             | /.rally/tempest/for-deployment-<UUID> in       |
1018  |                             | Functest container                             |
1019  |                             | Use "rally deployment list" command in order to|
1020  |                             | check UUID of current deployment.              |
1021  +-----------------------------+------------------------------------------------+
1022
1023
1024 When some Tempest test case fails, captured traceback and possibly also related
1025 REST API requests/responses are output to the console.
1026 More detailed debug information can be found from tempest.log file stored into
1027 related Rally deployment folder.
1028
1029
1030 Rally
1031 ^^^^^
1032
1033 Same error causes than for Tempest mentioned above may lead to error in Rally.
1034
1035 Controllers
1036 -----------
1037
1038 ODL
1039 ^^^
1040
1041
1042 ONOS
1043 ^^^^
1044
1045
1046 OpenContrail
1047 ^^^^^^^^^^^^
1048
1049
1050 Feature
1051 -------
1052
1053 vIMS
1054 ^^^^
1055
1056
1057 References
1058 ==========
1059
1060 .. _`[1]`: Functest configuration guide URL
1061 .. _`[2]`: http://docs.openstack.org/developer/tempest/overview.html
1062 .. _`[3]`: https://rally.readthedocs.org/en/latest/index.html
1063 .. _`[4]`: http://events.linuxfoundation.org/sites/events/files/slides/Functest%20in%20Depth_0.pdf
1064 .. _`[5]`: https://github.com/Orange-OpenSource/opnfv-cloudify-clearwater/blob/master/openstack-blueprint.yaml
1065 .. _`[6]`: https://wiki.opnfv.org/opnfv_test_dashboard
1066 .. _`[7]`: http://testresults.opnfv.org/testapi/test_projects/functest/cases
1067 .. _`[8]`: https://wiki.openstack.org/wiki/Governance/DefCoreCommittee
1068 .. _`[9]`: https://git.opnfv.org/cgit/functest/tree/testcases/VIM/OpenStack/CI/libraries/os_defaults.yaml
1069 .. _`[10]`: https://git.opnfv.org/cgit/functest/tree/testcases/VIM/OpenStack/CI/rally_cert/task.yaml
1070
1071 OPNFV main site: opnfvmain_.
1072
1073 OPNFV functional test page: opnfvfunctest_.
1074
1075 IRC support chan: #opnfv-testperf
1076
1077 .. _opnfvmain: http://www.opnfv.org
1078 .. _opnfvfunctest: https://wiki.opnfv.org/opnfv_functional_testing
1079 .. _`OpenRC`: http://docs.openstack.org/user-guide/common/cli_set_environment_variables_using_openstack_rc.html
1080 .. _`Rally installation procedure`: https://rally.readthedocs.org/en/latest/tutorial/step_0_installation.html
1081 .. _`config_test.py` : https://git.opnfv.org/cgit/functest/tree/testcases/config_functest.py
1082 .. _`config_functest.yaml` : https://git.opnfv.org/cgit/functest/tree/testcases/config_functest.yaml