992b546f535e788978ec43d09bec9908225b9f98
[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 The flavors for the SNAPS test cases are able to be configured giving new
42 metadata values as well as new values for the basic elements of flavor (i.e.
43 ram, vcpu, disk, ephemeral, swap etc). The snaps.flavor_extra_specs dict in the
44 config_functest.yaml file could be used for this purpose.
45
46 Self-obviously, successful completion of the 'healthcheck' testcase is a
47 necessary pre-requisite for the execution of all other test Tiers.
48
49
50 vPing_ssh
51 ^^^^^^^^^
52
53 Given the script **ping.sh**::
54
55     #!/bin/sh
56     ping -c 1 $1 2>&1 >/dev/null
57     RES=$?
58     if [ "Z$RES" = "Z0" ] ; then
59         echo 'vPing OK'
60     else
61         echo 'vPing KO'
62     fi
63
64
65 The goal of this test is to establish an SSH connection using a floating IP
66 on the Public/External network and verify that 2 instances can talk over a
67 Private Tenant network::
68
69  vPing_ssh test case
70  +-------------+                    +-------------+
71  |             |                    |             |
72  |             | Boot VM1 with IP1  |             |
73  |             +------------------->|             |
74  |   Tester    |                    |   System    |
75  |             | Boot VM2           |    Under    |
76  |             +------------------->|     Test    |
77  |             |                    |             |
78  |             | Create floating IP |             |
79  |             +------------------->|             |
80  |             |                    |             |
81  |             | Assign floating IP |             |
82  |             | to VM2             |             |
83  |             +------------------->|             |
84  |             |                    |             |
85  |             | Establish SSH      |             |
86  |             | connection to VM2  |             |
87  |             | through floating IP|             |
88  |             +------------------->|             |
89  |             |                    |             |
90  |             | SCP ping.sh to VM2 |             |
91  |             +------------------->|             |
92  |             |                    |             |
93  |             | VM2 executes       |             |
94  |             | ping.sh to VM1     |             |
95  |             +------------------->|             |
96  |             |                    |             |
97  |             |    If ping:        |             |
98  |             |      exit OK       |             |
99  |             |    else (timeout): |             |
100  |             |      exit Failed   |             |
101  |             |                    |             |
102  +-------------+                    +-------------+
103
104 This test can be considered as an "Hello World" example.
105 It is the first basic use case which **must** work on any deployment.
106
107 vPing_userdata
108 ^^^^^^^^^^^^^^
109
110 This test case is similar to vPing_ssh but without the use of Floating IPs
111 and the Public/External network to transfer the ping script.
112 Instead, it uses Nova metadata service to pass it to the instance at booting
113 time.
114 As vPing_ssh, it checks that 2 instances can talk to
115 each other on a Private Tenant network::
116
117  vPing_userdata test case
118  +-------------+                     +-------------+
119  |             |                     |             |
120  |             | Boot VM1 with IP1   |             |
121  |             +-------------------->|             |
122  |             |                     |             |
123  |             | Boot VM2 with       |             |
124  |             | ping.sh as userdata |             |
125  |             | with IP1 as $1.     |             |
126  |             +-------------------->|             |
127  |   Tester    |                     |   System    |
128  |             | VM2 executes ping.sh|    Under    |
129  |             | (ping IP1)          |     Test    |
130  |             +-------------------->|             |
131  |             |                     |             |
132  |             | Monitor nova        |             |
133  |             |  console-log VM 2   |             |
134  |             |    If ping:         |             |
135  |             |      exit OK        |             |
136  |             |    else (timeout)   |             |
137  |             |      exit Failed    |             |
138  |             |                     |             |
139  +-------------+                     +-------------+
140
141 When the second VM boots it will execute the script passed as userdata
142 automatically. The ping will be detected by periodically capturing the output
143 in the console-log of the second VM.
144
145
146 Tempest
147 ^^^^^^^
148
149 Tempest `[2]`_ is the reference OpenStack Integration test suite.
150 It is a set of integration tests to be run against a live OpenStack cluster.
151 Tempest has suites of tests for:
152
153   * OpenStack API validation
154   * Scenarios
155   * Other specific tests useful in validating an OpenStack deployment
156
157 Functest uses Rally `[3]`_ to run the Tempest suite.
158 Rally generates automatically the Tempest configuration file **tempest.conf**.
159 Before running the actual test cases,
160 Functest creates the needed resources (user, tenant) and
161 updates the appropriate parameters into the configuration file.
162
163 When the Tempest suite is executed, each test duration is measured and the full
164 console output is stored to a *log* file for further analysis.
165
166 The Tempest testcases are distributed across three
167 Tiers:
168
169   * Smoke Tier - Test Case 'tempest_smoke'
170   * Components Tier - Test case 'tempest_full'
171   * Neutron Trunk Port - Test case 'neutron_trunk'
172   * OpenStack interop testcases - Test case 'refstack_defcore'
173   * Testing and verifying RBAC policy enforcement - Test case 'patrole'
174
175 NOTE: Test case 'tempest_smoke' executes a defined set of tempest smoke
176 tests. Test case 'tempest_full' executes all defined Tempest tests.
177
178 NOTE: The 'neutron_trunk' test set allows to connect a VM to multiple VLAN
179 separated networks using a single NIC. The feature neutron trunk ports have
180 been supported by Apex, Fuel and Compass, so the tempest testcases have been
181 integrated normally.
182
183 NOTE: Rally is also used to run Openstack Interop testcases `[9]`_, which focus
184 on testing interoperability between OpenStack clouds.
185
186 NOTE: Patrole is a tempest plugin for testing and verifying RBAC policy
187 enforcement. It runs Tempest-based API tests using specified RBAC roles, thus
188 allowing deployments to verify that only intended roles have access to those
189 APIs. Patrole currently offers testing for the following OpenStack services:
190 Nova, Neutron, Glance, Cinder and Keystone. Currently in functest, only neutron
191 and glance are tested.
192
193 The goal of the Tempest test suite is to check the basic functionalities of the
194 different OpenStack components on an OPNFV fresh installation, using the
195 corresponding REST API interfaces.
196
197
198 Rally bench test suites
199 ^^^^^^^^^^^^^^^^^^^^^^^
200
201 Rally `[3]`_ is a benchmarking tool that answers the question:
202
203 *How does OpenStack work at scale?*
204
205 The goal of this test suite is to benchmark all the different OpenStack modules
206 and get significant figures that could help to define Telco Cloud KPIs.
207
208 The OPNFV Rally scenarios are based on the collection of the actual Rally
209 scenarios:
210
211  * authenticate
212  * cinder
213  * glance
214  * heat
215  * keystone
216  * neutron
217  * nova
218  * quotas
219
220 A basic SLA (stop test on errors) has been implemented.
221
222 The Rally testcases are distributed across two Tiers:
223
224   * Smoke Tier - Test Case 'rally_sanity'
225   * Components Tier - Test case 'rally_full'
226
227 NOTE: Test case 'rally_sanity' executes a limited number of Rally smoke test
228 cases. Test case 'rally_full' executes the full defined set of Rally tests.
229
230
231 snaps_smoke
232 ------------
233
234 This test case contains tests that setup and destroy environments with VMs with
235 and without Floating IPs with a newly created user and project. Set the config
236 value snaps.use_floating_ips (True|False) to toggle this functionality.
237 Please note that When the configuration value of snaps.use_keystone is True,
238 Functest must have access the cloud's private network.
239 This suite consists in 120 tests (test duration ~= 50 minutes)
240
241 The flavors for the SNAPS test cases are able to be configured giving new
242 metadata values as well as new values for the basic elements of flavor (i.e.
243 ram, vcpu, disk, ephemeral, swap etc). The snaps.flavor_extra_specs dict in
244 the config_functest.yaml file could be used for this purpose.
245
246 SDN Controllers
247 ---------------
248
249 OpenDaylight
250 ^^^^^^^^^^^^
251
252 The OpenDaylight (ODL) test suite consists of a set of basic tests inherited
253 from the ODL project using the Robot `[11]`_ framework.
254 The suite verifies creation and deletion of networks, subnets and ports with
255 OpenDaylight and Neutron.
256
257 The list of tests can be described as follows:
258
259  * Basic Restconf test cases
260
261    * Connect to Restconf URL
262    * Check the HTTP code status
263
264  * Neutron Reachability test cases
265
266    * Get the complete list of neutron resources (networks, subnets, ports)
267
268  * Neutron Network test cases
269
270    * Check OpenStack networks
271    * Check OpenDaylight networks
272    * Create a new network via OpenStack and check the HTTP status code returned
273      by Neutron
274    * Check that the network has also been successfully created in OpenDaylight
275
276  * Neutron Subnet test cases
277
278    * Check OpenStack subnets
279    * Check OpenDaylight subnets
280    * Create a new subnet via OpenStack and check the HTTP status code returned
281      by Neutron
282    * Check that the subnet has also been successfully created in OpenDaylight
283
284  * Neutron Port test cases
285
286    * Check OpenStack Neutron for known ports
287    * Check OpenDaylight ports
288    * Create a new port via OpenStack and check the HTTP status code returned by
289      Neutron
290    * Check that the new port has also been successfully created in OpenDaylight
291
292  * Delete operations
293
294    * Delete the port previously created via OpenStack
295    * Check that the port has been also successfully deleted in OpenDaylight
296    * Delete previously subnet created via OpenStack
297    * Check that the subnet has also been successfully deleted in OpenDaylight
298    * Delete the network created via OpenStack
299    * Check that the network has also been successfully deleted in OpenDaylight
300
301 Note: the checks in OpenDaylight are based on the returned HTTP status
302 code returned by OpenDaylight.
303
304
305 Features
306 --------
307
308 Functest has been supporting several feature projects since Brahmaputra:
309
310
311 +-----------------+---------+----------+--------+-----------+-----------+
312 | Test            | Brahma  | Colorado | Danube | Euphrates |  Fraser   |
313 +=================+=========+==========+========+===========+===========+
314 | barometer       |         |          |    X   |     X     |     X     |
315 +-----------------+---------+----------+--------+-----------+-----------+
316 | bgpvpn          |         |    X     |    X   |     X     |     X     |
317 +-----------------+---------+----------+--------+-----------+-----------+
318 | copper          |         |    X     |        |           |           |
319 +-----------------+---------+----------+--------+-----------+-----------+
320 | doctor          |    X    |    X     |    X   |     X     |     X     |
321 +-----------------+---------+----------+--------+-----------+-----------+
322 | domino          |         |    X     |    X   |     X     |           |
323 +-----------------+---------+----------+--------+-----------+-----------+
324 | fds             |         |          |    X   |     X     |     X     |
325 +-----------------+---------+----------+--------+-----------+-----------+
326 | moon            |         |    X     |        |           |           |
327 +-----------------+---------+----------+--------+-----------+-----------+
328 | multisite       |         |    X     |    X   |           |           |
329 +-----------------+---------+----------+--------+-----------+-----------+
330 | netready        |         |          |    X   |           |           |
331 +-----------------+---------+----------+--------+-----------+-----------+
332 | odl_sfc         |         |    X     |    X   |     X     |     X     |
333 +-----------------+---------+----------+--------+-----------+-----------+
334 | opera           |         |          |    X   |           |           |
335 +-----------------+---------+----------+--------+-----------+-----------+
336 | orchestra       |         |          |    X   |     X     |     X     |
337 +-----------------+---------+----------+--------+-----------+-----------+
338 | parser          |         |          |    X   |     X     |     X     |
339 +-----------------+---------+----------+--------+-----------+-----------+
340 | promise         |    X    |    X     |    X   |     X     |     X     |
341 +-----------------+---------+----------+--------+-----------+-----------+
342 | security_scan   |         |    X     |    X   |           |           |
343 +-----------------+---------+----------+--------+-----------+-----------+
344 | clover          |         |          |        |           |     X     |
345 +-----------------+---------+----------+--------+-----------+-----------+
346 | stor4nfv        |         |          |        |           |     X     |
347 +-----------------+---------+----------+--------+-----------+-----------+
348
349 Please refer to the dedicated feature user guides for details.
350
351
352 VNF
353 ---
354
355
356 cloudify_ims
357 ^^^^^^^^^^^^
358 The IP Multimedia Subsystem or IP Multimedia Core Network Subsystem (IMS) is an
359 architectural framework for delivering IP multimedia services.
360
361 vIMS has been integrated in Functest to demonstrate the capability to deploy a
362 relatively complex NFV scenario on the OPNFV platform. The deployment of a
363 complete functional VNF allows the test of most of the essential functions
364 needed for a NFV platform.
365
366 The goal of this test suite consists of:
367
368  * deploy a VNF orchestrator (Cloudify)
369  * deploy a Clearwater vIMS (IP Multimedia Subsystem) VNF from this
370    orchestrator based on a TOSCA blueprint defined in `[5]`_
371  * run suite of signaling tests on top of this VNF
372
373 The Clearwater architecture is described as follows:
374
375 .. figure:: ../../../images/clearwater-architecture-v2.png
376    :align: center
377    :alt: vIMS architecture
378
379
380 vyos-vrouter
381 ^^^^^^^^^^^^
382 This test case deals with the deployment and the test of vyos vrouter with
383 Cloudify orchestrator. The test case can do testing for interchangeability of
384 BGP Protocol using vyos.
385
386 The Workflow is as follows:
387  * Deploy
388     Deploy VNF Testing topology by Cloudify using blueprint.
389  * Configuration
390     Setting configuration to Target VNF and reference VNF using ssh
391  * Run
392     Execution of test command for test item written YAML format  file.
393     Check VNF status and behavior.
394  * Reporting
395     Output of report based on result using JSON format.
396
397 The vyos-vrouter architecture is described in `[14]`_
398
399 juju_epc
400 ^^^^^^^^
401 The Evolved Packet Core (EPC) is the main component of the System Architecture
402 Evolution (SAE) which forms the core of the 3GPP LTE specification.
403
404 vEPC has been integrated in Functest to demonstrate the capability to deploy a
405 complex mobility-specific NFV scenario on the OPNFV platform. The OAI EPC
406 supports most of the essential functions defined by the 3GPP Technical Specs;
407 hence the successful execution of functional tests on the OAI EPC provides a
408 good endorsement of the underlying NFV platform.
409
410 This integration also includes ABot, a Test Orchestration system that enables
411 test scenarios to be defined in high-level DSL. ABot is also deployed as a
412 VM on the OPNFV platform; and this provides an example of the automation
413 driver and the Test VNF being both deployed as separate VNFs on the underlying
414 OPNFV platform.
415
416 The Workflow is as follows:
417  * Deploy Orchestrator
418     Deploy Juju controller using Bootstrap command.
419  * Deploy VNF
420     Deploy ABot orchestrator and OAI EPC as Juju charms.
421     Configuration of ABot and OAI EPC components is handled through
422     built-in Juju relations.
423  * Test VNF
424     Execution of ABot feature files triggered by Juju actions.
425     This executes a suite of LTE signalling tests on the OAI EPC.
426  * Reporting
427     ABot test results are parsed accordingly and pushed to Functest Db.
428
429 Details of the ABot test orchestration tool may be found in `[15]`_
430
431 Kubernetes (K8s)
432 ----------------
433
434 Kubernetes testing relies on sets of tests, which are part of the  Kubernetes
435 source tree, such as the Kubernetes End-to-End (e2e) tests `[16]`_.
436
437 The kubernetes testcases are distributed across various Tiers:
438
439  * Healthcheck Tier
440
441    * k8s_smoke Test Case: Creates a Guestbook application that contains redis
442      server, 2 instances of redis slave, frontend application, frontend service
443      and redis master service and redis slave service. Using frontend service,
444      the test will write an entry into the guestbook application which will
445      store the entry into the backend redis database. Application flow MUST
446      work as expected and the data written MUST be available to read.
447
448  * Smoke Tier
449
450    * k8s_conformance Test Case: Runs a series of k8s e2e tests expected to
451      pass on any Kubernetes cluster. It is a subset of tests necessary to
452      demonstrate conformance grows with each release. Conformance is thus
453      considered versioned, with backwards compatibility guarantees and are
454      designed to be run with no cloud provider configured.
455
456
457 .. _`[2]`: http://docs.openstack.org/developer/tempest/overview.html
458 .. _`[3]`: https://rally.readthedocs.org/en/latest/index.html
459 .. _`[5]`: https://github.com/Orange-OpenSource/opnfv-cloudify-clearwater/blob/master/openstack-blueprint.yaml
460 .. _`[8]`: https://github.com/openstack/refstack-client
461 .. _`[9]`: https://github.com/openstack/defcore
462 .. _`[10]`: https://github.com/openstack/interop/blob/master/2016.08/procedure.rst
463 .. _`[11]`: http://robotframework.org/
464 .. _`[12]`: http://docs.opnfv.org/en/latest/submodules/functest/docs/testing/user/userguide/index.html
465 .. _`[13]`: https://wiki.opnfv.org/display/PROJ/SNAPS-OO
466 .. _`[14]`: https://github.com/oolorg/opnfv-functest-vrouter
467 .. _`[15]`: https://www.rebaca.com/abot-test-orchestration-tool/
468 .. _`[16]`: https://github.com/kubernetes/community/blob/master/contributors/devel/e2e-tests.md