f5381b8ac6b65e9ec55409eb7af10cf31359308e
[functest.git] / docs / testing / user / userguide / test_details.rst
1 .. SPDX-License-Identifier: CC-BY-4.0
2
3 The different test cases are described in the remaining sections of this
4 document.
5
6 VIM (Virtualized Infrastructure Manager)
7 ----------------------------------------
8
9 Healthcheck tests
10 ^^^^^^^^^^^^^^^^^
11 Since Danube, healthcheck tests have been refactored and rely on SNAPS, an
12 OPNFV middleware project.
13
14 SNAPS stands for "SDN/NFV Application development Platform and Stack".
15 SNAPS is an object-oriented OpenStack library packaged with tests that exercise
16 OpenStack.
17 More information on SNAPS can be found in  `[13]`_
18
19 Three tests are declared as healthcheck tests and can be used for gating by the
20 installer, they cover functionally the tests previously done by healthcheck
21 test case.
22
23 The tests are:
24
25
26  * *connection_check*
27  * *api_check*
28  * *snaps_health_check*
29
30 Connection_check consists in 9 test cases (test duration < 5s) checking the
31 connectivity with Glance, Keystone, Neutron, Nova and the external network.
32
33 Api_check verifies the retrieval of OpenStack clients: Keystone, Glance,
34 Neutron and Nova and may perform some simple queries. When the config value of
35 snaps.use_keystone is True, functest must have access to the cloud's private
36 network. This suite consists in 49 tests (test duration < 2 minutes).
37
38 Snaps_health_check creates a VM with a single port with an IPv4 address that
39 is assigned by DHCP and then validates the expected IP with the actual.
40
41 Self-obviously, successful completion of the 'healthcheck' testcase is a
42 necessary pre-requisite for the execution of all other test Tiers.
43
44
45 vPing_ssh
46 ^^^^^^^^^
47
48 Given the script **ping.sh**::
49
50     #!/bin/sh
51     ping -c 1 $1 2>&1 >/dev/null
52     RES=$?
53     if [ "Z$RES" = "Z0" ] ; then
54         echo 'vPing OK'
55     else
56         echo 'vPing KO'
57     fi
58
59
60 The goal of this test is to establish an SSH connection using a floating IP
61 on the Public/External network and verify that 2 instances can talk over a
62 Private Tenant network::
63
64  vPing_ssh test case
65  +-------------+                    +-------------+
66  |             |                    |             |
67  |             | Boot VM1 with IP1  |             |
68  |             +------------------->|             |
69  |   Tester    |                    |   System    |
70  |             | Boot VM2           |    Under    |
71  |             +------------------->|     Test    |
72  |             |                    |             |
73  |             | Create floating IP |             |
74  |             +------------------->|             |
75  |             |                    |             |
76  |             | Assign floating IP |             |
77  |             | to VM2             |             |
78  |             +------------------->|             |
79  |             |                    |             |
80  |             | Establish SSH      |             |
81  |             | connection to VM2  |             |
82  |             | through floating IP|             |
83  |             +------------------->|             |
84  |             |                    |             |
85  |             | SCP ping.sh to VM2 |             |
86  |             +------------------->|             |
87  |             |                    |             |
88  |             | VM2 executes       |             |
89  |             | ping.sh to VM1     |             |
90  |             +------------------->|             |
91  |             |                    |             |
92  |             |    If ping:        |             |
93  |             |      exit OK       |             |
94  |             |    else (timeout): |             |
95  |             |      exit Failed   |             |
96  |             |                    |             |
97  +-------------+                    +-------------+
98
99 This test can be considered as an "Hello World" example.
100 It is the first basic use case which **must** work on any deployment.
101
102 vPing_userdata
103 ^^^^^^^^^^^^^^
104
105 This test case is similar to vPing_ssh but without the use of Floating IPs
106 and the Public/External network to transfer the ping script.
107 Instead, it uses Nova metadata service to pass it to the instance at booting
108 time.
109 As vPing_ssh, it checks that 2 instances can talk to
110 each other on a Private Tenant network::
111
112  vPing_userdata test case
113  +-------------+                     +-------------+
114  |             |                     |             |
115  |             | Boot VM1 with IP1   |             |
116  |             +-------------------->|             |
117  |             |                     |             |
118  |             | Boot VM2 with       |             |
119  |             | ping.sh as userdata |             |
120  |             | with IP1 as $1.     |             |
121  |             +-------------------->|             |
122  |   Tester    |                     |   System    |
123  |             | VM2 executes ping.sh|    Under    |
124  |             | (ping IP1)          |     Test    |
125  |             +-------------------->|             |
126  |             |                     |             |
127  |             | Monitor nova        |             |
128  |             |  console-log VM 2   |             |
129  |             |    If ping:         |             |
130  |             |      exit OK        |             |
131  |             |    else (timeout)   |             |
132  |             |      exit Failed    |             |
133  |             |                     |             |
134  +-------------+                     +-------------+
135
136 When the second VM boots it will execute the script passed as userdata
137 automatically. The ping will be detected by periodically capturing the output
138 in the console-log of the second VM.
139
140
141 Tempest
142 ^^^^^^^
143
144 Tempest `[2]`_ is the reference OpenStack Integration test suite.
145 It is a set of integration tests to be run against a live OpenStack cluster.
146 Tempest has suites of tests for:
147
148   * OpenStack API validation
149   * Scenarios
150   * Other specific tests useful in validating an OpenStack deployment
151
152 Functest uses Rally `[3]`_ to run the Tempest suite.
153 Rally generates automatically the Tempest configuration file **tempest.conf**.
154 Before running the actual test cases,
155 Functest creates the needed resources (user, tenant) and
156 updates the appropriate parameters into the configuration file.
157
158 When the Tempest suite is executed, each test duration is measured and the full
159 console output is stored to a *log* file for further analysis.
160
161 The Tempest testcases are distributed across three
162 Tiers:
163
164   * Smoke Tier - Test Case 'tempest_smoke_serial'
165   * Components Tier - Test case 'tempest_full_parallel'
166   * Neutron Trunk Port - Test case 'neutron_trunk'
167
168 NOTE: Test case 'tempest_smoke_serial' executes a defined set of tempest smoke
169 tests with a single thread (i.e. serial mode). Test case
170 'tempest_full_parallel' executes all defined Tempest tests using several
171 concurrent threads (i.e. parallel mode). The number of threads activated
172 corresponds to the number of available logical CPUs.
173
174 NOTE: The 'neutron_trunk' test set allows to connect a VM to multiple VLAN
175 separated networks using a single NIC. The feature neutron trunk ports have
176 been supported by Apex, Fuel and Compass, so the tempest testcases have been
177 integrated normally.
178
179 The goal of the Tempest test suite is to check the basic functionalities of the
180 different OpenStack components on an OPNFV fresh installation, using the
181 corresponding REST API interfaces.
182
183
184 Rally bench test suites
185 ^^^^^^^^^^^^^^^^^^^^^^^
186
187 Rally `[3]`_ is a benchmarking tool that answers the question:
188
189 *How does OpenStack work at scale?*
190
191 The goal of this test suite is to benchmark all the different OpenStack modules
192 and get significant figures that could help to define Telco Cloud KPIs.
193
194 The OPNFV Rally scenarios are based on the collection of the actual Rally
195 scenarios:
196
197  * authenticate
198  * cinder
199  * glance
200  * heat
201  * keystone
202  * neutron
203  * nova
204  * quotas
205  * ceilometer
206
207 A basic SLA (stop test on errors) has been implemented.
208
209 The Rally testcases are distributed across two Tiers:
210
211   * Smoke Tier - Test Case 'rally_sanity'
212   * Components Tier - Test case 'rally_full'
213
214 NOTE: Test case 'rally_sanity' executes a limited number of Rally smoke test
215 cases. Test case 'rally_full' executes the full defined set of Rally tests.
216
217
218 Refstack-client to run OpenStack interop testcases
219 --------------------------------------------------
220
221 Refstack-client `[8]`_ is a command line utility that allows you to
222 execute Tempest test runs based on configurations you specify.
223 It is the official tool to run Openstack Interop (previously known as Defcore)
224 testcases `[9]`_, which focus on testing interoperability between OpenStack
225 clouds.
226
227 Refstack-client is integrated in Functest, consumed by Dovetail, which
228 intends to define and provide a set of OPNFV related validation criteria
229 that will provide input for the evaluation of the use of OPNFV trademarks.
230 This progress is under the guideline of Compliance Verification Program(CVP).
231
232 Running methods
233 ^^^^^^^^^^^^^^^
234
235 Two running methods are provided after refstack-client integrated into
236 Functest, Functest command line and manually, respectively.
237
238 By default, for Defcore test cases run by Functest command line,
239 are run followed with automatically generated
240 configuration file, i.e., refstack_tempest.conf. In some circumstances,
241 the automatic configuration file may not quite satisfied with the SUT,
242 Functest also inherits the refstack-client command line and provides a way
243 for users to set its configuration file according to its own SUT manually.
244
245 *command line*
246
247 Inside the Functest container, first to prepare Functest environment:
248
249 ::
250
251   functest env prepare
252
253 then to run default defcore testcases by using refstack-client:
254
255 ::
256
257   functest testcase run refstack_defcore
258
259 In OPNFV Continuous Integration(CI) system, the command line method is used.
260
261 *manually*
262
263 Prepare the tempest configuration file and the testcases want to run with the
264 SUT, run the testcases with:
265
266 ::
267
268   ./refstack-client test -c <Path of the tempest configuration file to use> -v --test-list <Path or URL of test list>
269
270 using help for more information:
271
272 ::
273
274   ./refstack-client --help
275   ./refstack-client test --help
276
277 Reference tempest configuration
278 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
279
280 *command line method*
281
282 When command line method is used, the default tempest configuration file
283 is generated by Rally.
284
285 *manually*
286
287 When running manually is used, recommended way to generate tempest
288 configuration file is:
289
290 ::
291
292   cd /usr/lib/python2.7/site-packages/functest/opnfv_tests/openstack/refstack_client
293   python tempest_conf.py
294
295 a file called tempest.conf is stored in the current path by default, users can
296 do some adjustment according to the SUT:
297
298 ::
299
300   vim refstack_tempest.conf
301
302 a reference article can be used `[15]`_.
303
304
305 snaps_smoke
306 ------------
307
308 This test case contains tests that setup and destroy environments with VMs with
309 and without Floating IPs with a newly created user and project. Set the config
310 value snaps.use_floating_ips (True|False) to toggle this functionality.
311 Please note that when the configuration value of snaps.use_keystone is True,
312 Functest must have access the cloud's private network.
313 This suite consists in 38 tests (test duration < 10 minutes)
314
315
316 SDN Controllers
317 ---------------
318
319 OpenDaylight
320 ^^^^^^^^^^^^
321
322 The OpenDaylight (ODL) test suite consists of a set of basic tests inherited
323 from the ODL project using the Robot `[11]`_ framework.
324 The suite verifies creation and deletion of networks, subnets and ports with
325 OpenDaylight and Neutron.
326
327 The list of tests can be described as follows:
328
329  * Basic Restconf test cases
330
331    * Connect to Restconf URL
332    * Check the HTTP code status
333
334  * Neutron Reachability test cases
335
336    * Get the complete list of neutron resources (networks, subnets, ports)
337
338  * Neutron Network test cases
339
340    * Check OpenStack networks
341    * Check OpenDaylight networks
342    * Create a new network via OpenStack and check the HTTP status code returned
343      by Neutron
344    * Check that the network has also been successfully created in OpenDaylight
345
346  * Neutron Subnet test cases
347
348    * Check OpenStack subnets
349    * Check OpenDaylight subnets
350    * Create a new subnet via OpenStack and check the HTTP status code returned
351      by Neutron
352    * Check that the subnet has also been successfully created in OpenDaylight
353
354  * Neutron Port test cases
355
356    * Check OpenStack Neutron for known ports
357    * Check OpenDaylight ports
358    * Create a new port via OpenStack and check the HTTP status code returned by
359      Neutron
360    * Check that the new port has also been successfully created in OpenDaylight
361
362  * Delete operations
363
364    * Delete the port previously created via OpenStack
365    * Check that the port has been also successfully deleted in OpenDaylight
366    * Delete previously subnet created via OpenStack
367    * Check that the subnet has also been successfully deleted in OpenDaylight
368    * Delete the network created via OpenStack
369    * Check that the network has also been successfully deleted in OpenDaylight
370
371 Note: the checks in OpenDaylight are based on the returned HTTP status
372 code returned by OpenDaylight.
373
374
375 Features
376 --------
377
378 Functest has been supporting several feature projects since Brahmaputra:
379
380
381 +-----------------+---------+----------+--------+-----------+
382 | Test            | Brahma  | Colorado | Danube | Euphrates |
383 +=================+=========+==========+========+===========+
384 | barometer       |         |          |    X   |     X     |
385 +-----------------+---------+----------+--------+-----------+
386 | bgpvpn          |         |    X     |    X   |     X     |
387 +-----------------+---------+----------+--------+-----------+
388 | copper          |         |    X     |        |           |
389 +-----------------+---------+----------+--------+-----------+
390 | doctor          |    X    |    X     |    X   |     X     |
391 +-----------------+---------+----------+--------+-----------+
392 | domino          |         |    X     |    X   |     X     |
393 +-----------------+---------+----------+--------+-----------+
394 | fds             |         |          |    X   |     X     |
395 +-----------------+---------+----------+--------+-----------+
396 | moon            |         |    X     |        |           |
397 +-----------------+---------+----------+--------+-----------+
398 | multisite       |         |    X     |    X   |           |
399 +-----------------+---------+----------+--------+-----------+
400 | netready        |         |          |    X   |           |
401 +-----------------+---------+----------+--------+-----------+
402 | odl_sfc         |         |    X     |    X   |     X     |
403 +-----------------+---------+----------+--------+-----------+
404 | opera           |         |          |    X   |           |
405 +-----------------+---------+----------+--------+-----------+
406 | orchestra       |         |          |    X   |     X     |
407 +-----------------+---------+----------+--------+-----------+
408 | parser          |         |          |    X   |     X     |
409 +-----------------+---------+----------+--------+-----------+
410 | promise         |    X    |    X     |    X   |     X     |
411 +-----------------+---------+----------+--------+-----------+
412 | security_scan   |         |    X     |    X   |           |
413 +-----------------+---------+----------+--------+-----------+
414
415 Please refer to the dedicated feature user guides for details.
416
417
418 VNF
419 ---
420
421
422 cloudify_ims
423 ^^^^^^^^^^^^
424 The IP Multimedia Subsystem or IP Multimedia Core Network Subsystem (IMS) is an
425 architectural framework for delivering IP multimedia services.
426
427 vIMS has been integrated in Functest to demonstrate the capability to deploy a
428 relatively complex NFV scenario on the OPNFV platform. The deployment of a
429 complete functional VNF allows the test of most of the essential functions
430 needed for a NFV platform.
431
432 The goal of this test suite consists of:
433
434  * deploy a VNF orchestrator (Cloudify)
435  * deploy a Clearwater vIMS (IP Multimedia Subsystem) VNF from this
436    orchestrator based on a TOSCA blueprint defined in `[5]`_
437  * run suite of signaling tests on top of this VNF
438
439 The Clearwater architecture is described as follows:
440
441 .. figure:: ../../../images/clearwater-architecture.png
442    :align: center
443    :alt: vIMS architecture
444
445
446 cloudify_ims_perf
447 ^^^^^^^^^^^^^^^^^
448 This testcase extends the cloudify_ims test case.
449 The first part is similar but the testing part is different.
450 The testing part consists in automating a realistic signaling load on the vIMS
451 using an Ixia loader (proprietary tools)
452
453  - You need to have access to an Ixia licence server defined in the
454    configuration file and have ixia image locally.
455
456 This test case is available but not declared in testcases.yaml. The declaration
457 of the testcase is simple, connect to your functest-vnf docker, add the
458 following section in
459 /usr/lib/python2.7/site-packacges/functest/ci/testcases.yaml::
460
461   -
462       case_name: cloudify_ims_perf
463       project_name: functest
464       criteria: 80
465       blocking: false
466       description: >-
467           Stress tests based on Cloudify. Ixia loader images and access to Ixia
468           server license.
469       dependencies:
470           installer: ''
471           scenario: 'os-nosdn-nofeature-ha'
472       run:
473           module: 'functest.opnfv_tests.vnf.ims.cloudify_ims_perf'
474           class: 'CloudifyImsPerf'
475
476 orchestra_openims
477 ^^^^^^^^^^^^^^^^^
478 Orchestra test case deals with the deployment of OpenIMS with OpenBaton
479 orchestrator.
480
481 orchestra_clearwaterims
482 ^^^^^^^^^^^^^^^^^^^^^^^
483 Orchestra test case deals with the deployment of Clearwater vIMS with OpenBaton
484 orchestrator.
485
486 vyos-vrouter
487 ^^^^^^^^^^^^
488 This test case deals with the deployment and the test of vyos vrouter with
489 Cloudify orchestrator. The test case can do testing for interchangeability of
490 BGP Protocol using vyos.
491
492 The Workflow is as follows:
493  * Deploy
494     Deploy VNF Testing topology by Cloudify using blueprint.
495  * Configuration
496     Setting configuration to Target VNF and reference VNF using ssh
497  * Run
498     Execution of test command for test item written YAML format  file.
499     Check VNF status and behavior.
500  * Reporting
501     Output of report based on result using JSON format.
502
503 The vyos-vrouter architecture is described in `[14]`_
504
505
506 .. _`[2]`: http://docs.openstack.org/developer/tempest/overview.html
507 .. _`[3]`: https://rally.readthedocs.org/en/latest/index.html
508 .. _`[5]`: https://github.com/Orange-OpenSource/opnfv-cloudify-clearwater/blob/master/openstack-blueprint.yaml
509 .. _`[8]`: https://github.com/openstack/refstack-client
510 .. _`[9]`: https://github.com/openstack/defcore
511 .. _`[10]`: https://github.com/openstack/interop/blob/master/2016.08/procedure.rst
512 .. _`[11]`: http://robotframework.org/
513 .. _`[12]`: http://docs.opnfv.org/en/latest/submodules/functest/docs/testing/user/userguide/index.html
514 .. _`[13]`: https://wiki.opnfv.org/display/PROJ/SNAPS-OO
515 .. _`[14]`: https://github.com/oolorg/opnfv-functest-vrouter
516 .. _`[15]`: https://aptira.com/testing-openstack-tempest-part-1/