Merge "Add vPing troubleshooting guides"
[functest.git] / docs / userguide / index.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3
4 =========================
5 OPNFV FUNCTEST user guide
6 =========================
7
8 .. toctree::
9    :maxdepth: 2
10
11
12 Introduction
13 ============
14
15 The goal of this documents is to describe the Functest test cases as well as
16 provide a procedure about how to execute them.
17
18 A presentation has been created for the first OPNFV Summit `[4]`_.
19
20 It is assumed that Functest container has been properly installed `[1]`_.
21
22 .. include:: ./introduction.rst
23
24 The different scenarios are described in the section hereafter.
25
26 VIM (Virtualized Infrastructure Manager)
27 ---
28
29 vPing_SSH
30 ^^^^^^^^^
31
32 Given the script 'ping.sh'::
33
34     #!/bin/sh
35     while true; do
36         ping -c 1 $1 2>&1 >/dev/null
37         RES=$?
38         if [ "Z$RES" = "Z0" ] ; then
39             echo 'vPing OK'
40             break
41         else
42             echo 'vPing KO'
43         fi
44     sleep 1
45     done
46
47 The goal of this test is described as follows::
48
49  vPing test case
50  +-------------+                    +-------------+
51  |             |                    |             |
52  |             | Boot VM1 with IP1  |             |
53  |             +------------------->|             |
54  |   Tester    |                    |   System    |
55  |             | Boot VM2           |    Under    |
56  |             +------------------->|     Test    |
57  |             |                    |             |
58  |             | Create floating IP |             |
59  |             +------------------->|             |
60  |             |                    |             |
61  |             | Assign floating IP |             |
62  |             | to VM2             |             |
63  |             +------------------->|             |
64  |             |                    |             |
65  |             | Stablish SSH       |             |
66  |             | connection to VM2  |             |
67  |             | through floating IP|             |
68  |             +------------------->|             |
69  |             |                    |             |
70  |             | SCP ping.sh to VM2 |             |
71  |             +------------------->|             |
72  |             |                    |             |
73  |             | VM2 executes       |             |
74  |             | ping.sh to VM1     |             |
75  |             +------------------->|             |
76  |             |                    |             |
77  |             |    If ping:        |             |
78  |             |      exit OK       |             |
79  |             |    else (timeout)  |             |
80  |             |      exit Failed   |             |
81  |             |                    |             |
82  +-------------+                    +-------------+
83
84 This test can be considered as an "Hello World" example.
85 It is the first basic use case which shall work on any deployment.
86
87 vPing_userdata
88 ^^^^^^^^^^^^^^
89
90 The goal of this test can be described as follows::
91
92  vPing_userdata test case
93  +-------------+                    +-------------+
94  |             |                    |             |
95  |             | Boot VM1 with IP1  |             |
96  |             +------------------->|             |
97  |             |                    |             |
98  |             | Boot VM2 with      |             |
99  |             | ping.sh as userdata|             |
100  |             | with IP1 as $1.    |             |
101  |             +------------------->|             |
102  |   Tester    |                    |   System    |
103  |             | VM2 exeutes ping.sh|    Under    |
104  |             | (ping IP1)         |     Test    |
105  |             +------------------->|             |
106  |             |                    |             |
107  |             | Monitor nova       |             |
108  |             |  console-log VM 2  |             |
109  |             |    If ping:        |             |
110  |             |      exit OK       |             |
111  |             |    else (timeout)  |             |
112  |             |      exit Failed   |             |
113  |             |                    |             |
114  +-------------+                    +-------------+
115
116 This scenario is similar to the previous one but it uses cloud-init (nova
117 metadata service) instead of floating IPs and SSH connection. When the second VM
118 boots it will execute the script automatically and the ping will be detected
119 capturing periodically the output in the console-log of the second VM.
120
121
122 Tempest
123 ^^^^^^^
124
125 Tempest `[2]`_ is the reference OpenStack Integration test suite.
126 It is a set of integration tests to be run against a live OpenStack cluster.
127 Tempest has batteries of tests for:
128
129   * OpenStack API validation
130   * Scenarios
131   * Other specific tests useful in validating an OpenStack deployment
132
133 Functest uses Rally `[3]`_ to run the Tempest suite.
134 Rally generates automatically the Tempest configuration file (tempest.conf).
135 Before running the actual test cases, Functest creates the needed resources and
136 updates the appropriate parameters to the configuration file.
137 When the Tempest suite is executed, each test duration is measured and the full
138 console output is stored in the tempest.log file for further analysis.
139
140 As an addition of Arno, Brahmaputra runs a customized set of Tempest test cases.
141 The list is specificed through *--tests-file* when running Rally.
142 This option has been introduced in Rally in version 0.1.2.
143
144 The customized test list is available in the Functest repo `[4]`_.
145 This list contains more than 200 Tempest test cases and can be divided
146 into two main sections:
147
148   1) Set of tempest smoke test cases
149   2) Set of test cases from DefCore list `[8]`_
150
151 The goal of the Tempest test suite is to check the basic functionalities of
152 different OpenStack components on an OPNFV fresh installation using
153 the corresponding REST API interfaces.
154
155
156 Rally bench test suites
157 ^^^^^^^^^^^^^^^^^^^^^^^
158
159 Rally `[3]`_ is a benchmarking tool that answers the question::
160
161  “How does OpenStack work at scale?”.
162
163 The goal of this test suite is to benchmark the different OpenStack modules and
164 get significant figures that could help to define Telco Cloud KPIs.
165
166 The OPNFV scenarios are based on the collection of the existing Rally scenarios:
167
168  * authenticate
169  * cinder
170  * glance
171  * heat
172  * keystone
173  * neutron
174  * nova
175  * quotas
176  * requests
177
178 A basic SLA (stop test on errors) have been implemented.
179
180
181 SDN Controllers
182 ---------------
183
184 Brahmaputra introduces new SDN controllers.
185 There are currently 3 possible controllers:
186
187  * OpenDaylight (ODL)
188  * ONOS
189  * OpenContrail (OCL)
190
191 OpenDaylight
192 ^^^^^^^^^^^^
193
194 The OpenDaylight (ODL) test suite consists of a set of basic tests inherited
195 from the ODL project using the Robot `[11]`_ framework.
196 The suite verifies creation and deletion of networks, subnets and ports with
197 OpenDaylight and Neutron.
198
199 The list of tests can be described as follows:
200
201  * Restconf.basic: Get the controller modules via Restconf
202  * Neutron.Networks
203
204    * Check OpenStack Networks :: Checking OpenStack Neutron for known networks
205    * Check OpenDaylight Networks :: Checking OpenDaylight Neutron API
206    * Create Network :: Create new network in OpenStack
207    * Check Network :: Check Network created in OpenDaylight
208    * Neutron.Networks :: Checking Network created in OpenStack are pushed
209
210  * Neutron.Subnets
211
212    * Check OpenStack Subnets :: Checking OpenStack Neutron for known Subnets
213    * Check OpenDaylight subnets :: Checking OpenDaylight Neutron API
214    * Create New subnet :: Create new subnet in OpenStack
215    * Check New subnet :: Check new subnet created in OpenDaylight
216    * Neutron.Subnets :: Checking Subnets created in OpenStack are pushed
217
218  * Neutron.Ports
219
220    * Check OpenStack ports :: Checking OpenStack Neutron for known ports
221    * Check OpenDaylight ports :: Checking OpenDaylight Neutron API
222    * Create New Port :: Create new port in OpenStack
223    * Check New Port :: Check new subnet created in OpenDaylight
224    * Neutron.Ports :: Checking Port created in OpenStack are pushed
225
226  * Delete Ports
227
228    * Delete previously created subnet in OpenStack
229    * Check subnet deleted in OpenDaylight
230    * Check subnet deleted in OpenStack
231
232  * Delete network
233
234    * Delete previously created network in OpenStack
235    * Check network deleted in OpenDaylight
236    * Check network deleted in OpenStack
237
238
239 ONOS
240 ^^^^
241
242 TestON Framework is used to test the ONOS SDN controller functions.
243 The test cases deal with L2 and L3 functions.
244 The ONOS test suite can be run on any ONOS compliant scenario.
245
246 The test cases may be described as follows:
247
248  * onosfunctest: The main executable file contains the initialization of
249    the docker environment and functions called by FUNCvirNetNB and
250    FUNCvirNetNBL3
251
252  * FUNCvirNetNB
253
254    * Create Network: Post Network data and check it in ONOS
255    * Update Network: Update the Network and compare it in ONOS
256    * Delete Network: Delete the Network and check if it's NULL in ONOS or
257      not
258    * Create Subnet: Post Subnet data and check it in ONOS
259    * Update Subnet: Update the Subnet and compare it in ONOS
260    * Delete Subnet: Delete the Subnet and check if it's NULL in ONOS or not
261    * Create Port: Post Port data and check it in ONOS
262    * Update Port: Update the Port and compare it in ONOS
263    * Delete Port: Delete the Port and check if it's NULL in ONOS or not
264
265  * FUNCvirNetNBL3
266
267    * Create Router: Post dataes for create Router and check it in ONOS
268    * Update Router: Update the Router and compare it in ONOS
269    * Delete Router: Delete the Router dataes and check it in ONOS
270    * Create RouterInterface: Post RouterInterface data to an exist Router
271      and check it in ONOS
272    * Delete RouterInterface: Delete the RouterInterface and check the Router
273    * Create FloatingIp: Post dataes for create FloatingIp and check it in
274      ONOS
275    * Update FloatingIp: Update the FloatingIp and compare it in ONOS
276    * Delete FloatingIp: Delete the FloatingIp and check if it's NULL in
277      ONOS  or not
278    * Create External Gateway: Post dataes for create External Gateway to an
279      exit Router and check it
280    * Update External Gateway: Update the External Gateway and compare it
281    * Delete External Gateway: Delete the External Gateway and check if it's
282      NULL in ONOS or not
283
284
285 OpenContrail
286 ^^^^^^^^^^^^
287 TODO OVNO
288
289
290
291 Features
292 --------
293
294 vIMS
295 ^^^^
296 The goal of this test suite consists of:
297
298  * deploy a VNF orchestrator (Cloudify)
299  * deploy a Clearwater vIMS (IP Multimedia Subsystem) VNF from this
300    orchestrator based on a TOSCA blueprint defined in `[5]`_
301  * run suite of signaling tests on top of this VNF
302
303 The Clearwater architecture is described as follows:
304
305 .. figure:: ../images/clearwater-architecture.png
306    :align: center
307    :alt: vIMS architecture
308
309 Two types of information are stored in the Test Database:
310
311  * the duration of each step (orchestion deployment, VNF deployment and test)
312  * the test results
313
314 The deployment of a complete functional VNF allows the test of most of the
315 essential functions needed for a NFV platform.
316
317 Promise
318 ^^^^^^^
319
320 Promise provides a basic set of test cases as part of Brahmaputra.
321
322 The available 33 test cases can be grouped into 7 test suites:
323
324     #. Add a new OpenStack provider into resource pool: Registers
325        OpenStack into a new resource pool and adds more capacity associated
326        with this pool.
327
328     #. Allocation without reservation: Creates a new server in OpenStack
329        and adds a new allocation record in Promise shim-layer.
330
331     #. Allocation using reservation for immediate use: Creates a resource
332        reservation record with no start/end time and immediately creates a new
333        server in OpenStack and add a new allocation record in Promise
334        shim-layer.
335
336     #. Reservation for future use: Creates a resource reservation record
337        for a future start time, queries, modifies and cancels the newly created
338        reservation.
339
340     #. Capacity planning: Decreases and increases the available capacity
341        from a provider in the future and queries the available collections and
342        utilizations.
343
344     #. Reservation with conflict: Tries to create reservations for
345        immediate and future use with conflict.
346
347     #. Cleanup test allocations: Destroys all allocations in OpenStack.
348
349
350 The specific parameters for Promise can be found in config_functest.yaml and
351 include::
352
353    promise:
354      general:
355          tenant_name: Name of the OpenStack tenant/project (e.g. promise)
356          tenant_description: Description of the OpenStack tenant (e.g. promise Functionality Testing)
357          user_name: Name of the user tenant (e.g. promiser)
358          user_pwd: Password of the user tenant (e.g. test)
359          image_name: Name of the software image (e.g. promise-img)
360          flavor_name: Name of the flavor (e.g. promise-flavor with 1 vCPU and 512 MB RAM)
361          flavor_vcpus: 1
362          flavor_ram: 512
363          flavor_disk: 0
364
365 However, these parameters must not be changed, as they are the values expected
366 by the Promise test suite.
367
368 .. include:: ./runfunctest.rst
369
370 Test results
371 ============
372
373 For Brahmaputra test results, see the functest results document at:
374 http://artifacts.opnfv.org/functest/brahmaputra/docs/results/index.html
375
376
377 Test Dashboard
378 ==============
379
380 Based on results collected in CI, a test dashboard is dynamically generated.
381 The URL of this dashboard is TODO LF
382
383
384 .. include:: ./troubleshooting.rst
385
386
387 References
388 ==========
389
390 .. _`[1]`: http://artifacts.opnfv.org/functest/docs/configguide/#functional-testing-installation
391 .. _`[2]`: http://docs.openstack.org/developer/tempest/overview.html
392 .. _`[3]`: https://rally.readthedocs.org/en/latest/index.html
393 .. _`[4]`: http://events.linuxfoundation.org/sites/events/files/slides/Functest%20in%20Depth_0.pdf
394 .. _`[5]`: https://github.com/Orange-OpenSource/opnfv-cloudify-clearwater/blob/master/openstack-blueprint.yaml
395 .. _`[6]`: https://wiki.opnfv.org/opnfv_test_dashboard
396 .. _`[7]`: http://testresults.opnfv.org/testapi/test_projects/functest/cases
397 .. _`[8]`: https://wiki.openstack.org/wiki/Governance/DefCoreCommittee
398 .. _`[9]`: https://git.opnfv.org/cgit/functest/tree/testcases/VIM/OpenStack/CI/libraries/os_defaults.yaml
399 .. _`[10]`: https://git.opnfv.org/cgit/functest/tree/testcases/VIM/OpenStack/CI/rally_cert/task.yaml
400 .. _`[11]`: http://robotframework.org/
401
402 OPNFV main site: opnfvmain_.
403
404 OPNFV functional test page: opnfvfunctest_.
405
406 IRC support chan: #opnfv-testperf
407
408 .. _opnfvmain: http://www.opnfv.org
409 .. _opnfvfunctest: https://wiki.opnfv.org/opnfv_functional_testing
410 .. _`OpenRC`: http://docs.openstack.org/user-guide/common/cli_set_environment_variables_using_openstack_rc.html
411 .. _`Rally installation procedure`: https://rally.readthedocs.org/en/latest/tutorial/step_0_installation.html
412 .. _`config_test.py` : https://git.opnfv.org/cgit/functest/tree/testcases/config_functest.py
413 .. _`config_functest.yaml` : https://git.opnfv.org/cgit/functest/tree/testcases/config_functest.yaml