688b67431ee6bb3e8e62f0aab02b1a5c4d3b94f1
[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_serial'
170   * Components Tier - Test case 'tempest_full_parallel'
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_serial' executes a defined set of tempest smoke
176 tests with a single thread (i.e. serial mode). Test case
177 'tempest_full_parallel' executes all defined Tempest tests using several
178 concurrent threads (i.e. parallel mode). The number of threads activated
179 corresponds to the number of available logical CPUs.
180
181 NOTE: The 'neutron_trunk' test set allows to connect a VM to multiple VLAN
182 separated networks using a single NIC. The feature neutron trunk ports have
183 been supported by Apex, Fuel and Compass, so the tempest testcases have been
184 integrated normally.
185
186 NOTE: Rally is also used to run Openstack Interop testcases `[9]`_, which focus
187 on testing interoperability between OpenStack clouds.
188
189 NOTE: Patrole is a tempest plugin for testing and verifying RBAC policy
190 enforcement. It runs Tempest-based API tests using specified RBAC roles, thus
191 allowing deployments to verify that only intended roles have access to those
192 APIs. Patrole currently offers testing for the following OpenStack services:
193 Nova, Neutron, Glance, Cinder and Keystone. Currently in functest, only neutron
194 and glance are tested.
195
196 The goal of the Tempest test suite is to check the basic functionalities of the
197 different OpenStack components on an OPNFV fresh installation, using the
198 corresponding REST API interfaces.
199
200
201 Rally bench test suites
202 ^^^^^^^^^^^^^^^^^^^^^^^
203
204 Rally `[3]`_ is a benchmarking tool that answers the question:
205
206 *How does OpenStack work at scale?*
207
208 The goal of this test suite is to benchmark all the different OpenStack modules
209 and get significant figures that could help to define Telco Cloud KPIs.
210
211 The OPNFV Rally scenarios are based on the collection of the actual Rally
212 scenarios:
213
214  * authenticate
215  * cinder
216  * glance
217  * heat
218  * keystone
219  * neutron
220  * nova
221  * quotas
222
223 A basic SLA (stop test on errors) has been implemented.
224
225 The Rally testcases are distributed across two Tiers:
226
227   * Smoke Tier - Test Case 'rally_sanity'
228   * Components Tier - Test case 'rally_full'
229
230 NOTE: Test case 'rally_sanity' executes a limited number of Rally smoke test
231 cases. Test case 'rally_full' executes the full defined set of Rally tests.
232
233
234 snaps_smoke
235 ------------
236
237 This test case contains tests that setup and destroy environments with VMs with
238 and without Floating IPs with a newly created user and project. Set the config
239 value snaps.use_floating_ips (True|False) to toggle this functionality.
240 Please note that When the configuration value of snaps.use_keystone is True,
241 Functest must have access the cloud's private network.
242 This suite consists in 120 tests (test duration ~= 50 minutes)
243
244 The flavors for the SNAPS test cases are able to be configured giving new
245 metadata values as well as new values for the basic elements of flavor (i.e.
246 ram, vcpu, disk, ephemeral, swap etc). The snaps.flavor_extra_specs dict in
247 the config_functest.yaml file could be used for this purpose.
248
249 SDN Controllers
250 ---------------
251
252 OpenDaylight
253 ^^^^^^^^^^^^
254
255 The OpenDaylight (ODL) test suite consists of a set of basic tests inherited
256 from the ODL project using the Robot `[11]`_ framework.
257 The suite verifies creation and deletion of networks, subnets and ports with
258 OpenDaylight and Neutron.
259
260 The list of tests can be described as follows:
261
262  * Basic Restconf test cases
263
264    * Connect to Restconf URL
265    * Check the HTTP code status
266
267  * Neutron Reachability test cases
268
269    * Get the complete list of neutron resources (networks, subnets, ports)
270
271  * Neutron Network test cases
272
273    * Check OpenStack networks
274    * Check OpenDaylight networks
275    * Create a new network via OpenStack and check the HTTP status code returned
276      by Neutron
277    * Check that the network has also been successfully created in OpenDaylight
278
279  * Neutron Subnet test cases
280
281    * Check OpenStack subnets
282    * Check OpenDaylight subnets
283    * Create a new subnet via OpenStack and check the HTTP status code returned
284      by Neutron
285    * Check that the subnet has also been successfully created in OpenDaylight
286
287  * Neutron Port test cases
288
289    * Check OpenStack Neutron for known ports
290    * Check OpenDaylight ports
291    * Create a new port via OpenStack and check the HTTP status code returned by
292      Neutron
293    * Check that the new port has also been successfully created in OpenDaylight
294
295  * Delete operations
296
297    * Delete the port previously created via OpenStack
298    * Check that the port has been also successfully deleted in OpenDaylight
299    * Delete previously subnet created via OpenStack
300    * Check that the subnet has also been successfully deleted in OpenDaylight
301    * Delete the network created via OpenStack
302    * Check that the network has also been successfully deleted in OpenDaylight
303
304 Note: the checks in OpenDaylight are based on the returned HTTP status
305 code returned by OpenDaylight.
306
307
308 Features
309 --------
310
311 Functest has been supporting several feature projects since Brahmaputra:
312
313
314 +-----------------+---------+----------+--------+-----------+-----------+
315 | Test            | Brahma  | Colorado | Danube | Euphrates |  Fraser   |
316 +=================+=========+==========+========+===========+===========+
317 | barometer       |         |          |    X   |     X     |     X     |
318 +-----------------+---------+----------+--------+-----------+-----------+
319 | bgpvpn          |         |    X     |    X   |     X     |     X     |
320 +-----------------+---------+----------+--------+-----------+-----------+
321 | copper          |         |    X     |        |           |           |
322 +-----------------+---------+----------+--------+-----------+-----------+
323 | doctor          |    X    |    X     |    X   |     X     |     X     |
324 +-----------------+---------+----------+--------+-----------+-----------+
325 | domino          |         |    X     |    X   |     X     |           |
326 +-----------------+---------+----------+--------+-----------+-----------+
327 | fds             |         |          |    X   |     X     |     X     |
328 +-----------------+---------+----------+--------+-----------+-----------+
329 | moon            |         |    X     |        |           |           |
330 +-----------------+---------+----------+--------+-----------+-----------+
331 | multisite       |         |    X     |    X   |           |           |
332 +-----------------+---------+----------+--------+-----------+-----------+
333 | netready        |         |          |    X   |           |           |
334 +-----------------+---------+----------+--------+-----------+-----------+
335 | odl_sfc         |         |    X     |    X   |     X     |     X     |
336 +-----------------+---------+----------+--------+-----------+-----------+
337 | opera           |         |          |    X   |           |           |
338 +-----------------+---------+----------+--------+-----------+-----------+
339 | orchestra       |         |          |    X   |     X     |     X     |
340 +-----------------+---------+----------+--------+-----------+-----------+
341 | parser          |         |          |    X   |     X     |     X     |
342 +-----------------+---------+----------+--------+-----------+-----------+
343 | promise         |    X    |    X     |    X   |     X     |     X     |
344 +-----------------+---------+----------+--------+-----------+-----------+
345 | security_scan   |         |    X     |    X   |           |           |
346 +-----------------+---------+----------+--------+-----------+-----------+
347 | clover          |         |          |        |           |     X     |
348 +-----------------+---------+----------+--------+-----------+-----------+
349 | stor4nfv        |         |          |        |           |     X     |
350 +-----------------+---------+----------+--------+-----------+-----------+
351
352 Please refer to the dedicated feature user guides for details.
353
354
355 VNF
356 ---
357
358
359 cloudify_ims
360 ^^^^^^^^^^^^
361 The IP Multimedia Subsystem or IP Multimedia Core Network Subsystem (IMS) is an
362 architectural framework for delivering IP multimedia services.
363
364 vIMS has been integrated in Functest to demonstrate the capability to deploy a
365 relatively complex NFV scenario on the OPNFV platform. The deployment of a
366 complete functional VNF allows the test of most of the essential functions
367 needed for a NFV platform.
368
369 The goal of this test suite consists of:
370
371  * deploy a VNF orchestrator (Cloudify)
372  * deploy a Clearwater vIMS (IP Multimedia Subsystem) VNF from this
373    orchestrator based on a TOSCA blueprint defined in `[5]`_
374  * run suite of signaling tests on top of this VNF
375
376 The Clearwater architecture is described as follows:
377
378 .. figure:: ../../../images/clearwater-architecture-v2.png
379    :align: center
380    :alt: vIMS architecture
381
382
383 vyos-vrouter
384 ^^^^^^^^^^^^
385 This test case deals with the deployment and the test of vyos vrouter with
386 Cloudify orchestrator. The test case can do testing for interchangeability of
387 BGP Protocol using vyos.
388
389 The Workflow is as follows:
390  * Deploy
391     Deploy VNF Testing topology by Cloudify using blueprint.
392  * Configuration
393     Setting configuration to Target VNF and reference VNF using ssh
394  * Run
395     Execution of test command for test item written YAML format  file.
396     Check VNF status and behavior.
397  * Reporting
398     Output of report based on result using JSON format.
399
400 The vyos-vrouter architecture is described in `[14]`_
401
402 juju_epc
403 ^^^^^^^^
404 The Evolved Packet Core (EPC) is the main component of the System Architecture
405 Evolution (SAE) which forms the core of the 3GPP LTE specification.
406
407 vEPC has been integrated in Functest to demonstrate the capability to deploy a
408 complex mobility-specific NFV scenario on the OPNFV platform. The OAI EPC
409 supports most of the essential functions defined by the 3GPP Technical Specs;
410 hence the successful execution of functional tests on the OAI EPC provides a
411 good endorsement of the underlying NFV platform.
412
413 This integration also includes ABot, a Test Orchestration system that enables
414 test scenarios to be defined in high-level DSL. ABot is also deployed as a
415 VM on the OPNFV platform; and this provides an example of the automation
416 driver and the Test VNF being both deployed as separate VNFs on the underlying
417 OPNFV platform.
418
419 The Workflow is as follows:
420  * Deploy Orchestrator
421     Deploy Juju controller using Bootstrap command.
422  * Deploy VNF
423     Deploy ABot orchestrator and OAI EPC as Juju charms.
424     Configuration of ABot and OAI EPC components is handled through
425     built-in Juju relations.
426  * Test VNF
427     Execution of ABot feature files triggered by Juju actions.
428     This executes a suite of LTE signalling tests on the OAI EPC.
429  * Reporting
430     ABot test results are parsed accordingly and pushed to Functest Db.
431
432 Details of the ABot test orchestration tool may be found in `[15]`_
433
434 Kubernetes (K8s)
435 ----------------
436
437 Kubernetes testing relies on sets of tests, which are part of the  Kubernetes
438 source tree, such as the Kubernetes End-to-End (e2e) tests `[16]`_.
439
440 The kubernetes testcases are distributed across various Tiers:
441
442  * Healthcheck Tier
443
444    * k8s_smoke Test Case: Creates a Guestbook application that contains redis
445      server, 2 instances of redis slave, frontend application, frontend service
446      and redis master service and redis slave service. Using frontend service,
447      the test will write an entry into the guestbook application which will
448      store the entry into the backend redis database. Application flow MUST
449      work as expected and the data written MUST be available to read.
450
451  * Smoke Tier
452
453    * k8s_conformance Test Case: Runs a series of k8s e2e tests expected to
454      pass on any Kubernetes cluster. It is a subset of tests necessary to
455      demonstrate conformance grows with each release. Conformance is thus
456      considered versioned, with backwards compatibility guarantees and are
457      designed to be run with no cloud provider configured.
458
459
460 .. _`[2]`: http://docs.openstack.org/developer/tempest/overview.html
461 .. _`[3]`: https://rally.readthedocs.org/en/latest/index.html
462 .. _`[5]`: https://github.com/Orange-OpenSource/opnfv-cloudify-clearwater/blob/master/openstack-blueprint.yaml
463 .. _`[8]`: https://github.com/openstack/refstack-client
464 .. _`[9]`: https://github.com/openstack/defcore
465 .. _`[10]`: https://github.com/openstack/interop/blob/master/2016.08/procedure.rst
466 .. _`[11]`: http://robotframework.org/
467 .. _`[12]`: http://docs.opnfv.org/en/latest/submodules/functest/docs/testing/user/userguide/index.html
468 .. _`[13]`: https://wiki.opnfv.org/display/PROJ/SNAPS-OO
469 .. _`[14]`: https://github.com/oolorg/opnfv-functest-vrouter
470 .. _`[15]`: https://www.rebaca.com/abot-test-orchestration-tool/
471 .. _`[16]`: https://github.com/kubernetes/community/blob/master/contributors/devel/e2e-tests.md