Add OPNFV Verified VNF Badge test instructions
[vnfrqts/requirements.git] / docs / Chapter8 / OPNFV-Verified-Badging.rst
1 .. Modifications Copyright © 2017-2018 AT&T Intellectual Property.
2
3 .. Licensed under the Creative Commons License, Attribution 4.0 Intl.
4    (the "License"); you may not use this documentation except in compliance
5    with the License. You may obtain a copy of the License at
6
7 .. https://creativecommons.org/licenses/by/4.0/
8
9 .. Unless required by applicable law or agreed to in writing, software
10    distributed under the License is distributed on an "AS IS" BASIS,
11    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12    See the License for the specific language governing permissions and
13    limitations under the License.
14
15
16 OPNFV Verfied Program Badging for VNFs
17 --------------------------------------
18
19 OPNFV Verified Program Overview
20 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21
22 The `OPNFV Verified Program (OVP) <https://www.lfnetworking.org/OVP/>`__ is
23
24     an open source, community-led compliance and verification program to
25     demonstrate the readiness and availability of commercial NFV products and
26     services, including NFVI and VNFs, using OPNFV and ONAP components.
27
28     -- Source: OVP
29
30 The program currently offers verification badges for NFVI, VNFs, and Labs. The
31 VNF badge aims to verify that a given VNF is compatible and interoperable with
32 a given release of ONAP and an ONAP-compatible NFVI.
33
34 Relationship to ONAP
35 ^^^^^^^^^^^^^^^^^^^^
36
37 The ONAP VNF Requirements project defines the mandatory and recommended
38 requirements for a VNF to be successfully orchestrated by ONAP.  At this time,
39 the OPNFV VNF badge automates the verification of a subset of these
40 requirements with plans to expand the scope over verified requirements over
41 time.
42
43 Currently, the `OPNFV VNF badge <https://vnf-verified.lfnetworking.org/#/>`__
44 covers the following:
45
46 * Compliance checks of the contents of a VNF onboarding package for :ref:`Heat-based <heat_requirements>`
47   or :ref:`TOSCA-based <tosca_requirements>` VNFs.
48
49   * Validation of the packages are, respectively, performed by the ONAP VVP
50     and ONAP VNFSDK projects.
51
52 * Validation that the package can be onboarded, modeled, configured, deployed,
53   and instantiated on an ONAP-compatible NFVI (currently OpenStack)
54
55
56 How to Receive a ONPFV VNF Badge
57 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
58
59 The ONAP platform includes a set of automated tests that can be setup and
60 executed for a given VNF to verify its compliance with the in-scope VNF
61 Requirements.  This test suite will produce a result file that is compatible
62 for submission to the OPNFV Verified Program.  Please refer to the
63 `OPNFV VNF Portal <https://vnf-verified.lfnetworking.org/#/>`__ for more details
64 on registering for the program and submitting your results.
65
66 The following section will describe how to setup and execute the tests.
67
68 Executing the OPNFV Verified Compliance and Validation Tests
69 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
70
71 The instructions related to setting up and executing the tests vary based on
72 whether the VNF is modeled in OpenStack Heat or in TOSCA.  Please refer
73 to the appropriate section based on your VNF.
74
75 * :ref:`heat_vnf_validation`
76 * :ref:`tosca_vnf_validation`
77
78
79 .. _heat_vnf_validation:
80
81 Heat-based VNF Validation
82 ~~~~~~~~~~~~~~~~~~~~~~~~~
83
84 This section describes how to setup and execute the validation tests against
85 a VNF that is described using OpenStack Heat.
86
87 Prerequisites
88 +++++++++++++
89
90 - ONAP El Alto Release deployed via :doc:`OOM <../../../../oom.git/docs/oom_quickstart_guide>`
91 - An OpenStack deployment is available and privisioned as ONAP's Cloud Site
92 - `kubectl <https://kubernetes.io/docs/tasks/tools/install-kubectl/>`__ is
93   installed on the system used to start the testing
94 - bash
95 - VNF Heat Templates
96 - Preload JSON files
97
98 After deploying ONAP, you need to configure ONAP with:
99
100 - A cloud owner
101 - A cloud region
102 - A subscriber
103 - A service type
104 - A project name
105 - An owning entity
106 - A platform
107 - A line of business
108 - A cloud site
109
110 If you're not familiar with how to configure ONAP, there are guides that use
111 :doc:`Robot <../../../../integration.git/docs/docs_robot>` or
112 `REST API calls <https://wiki.onap.org/pages/viewpage.action?pageId=25431491>`__
113 to handle the setup (including adding a new OpenStack site to ONAP).
114
115 Validation Setup
116 ++++++++++++++++
117
118 On your local machine, or the system from which you will run the tests, you will need to clone the
119 ONAP OOM project repo:
120
121 .. code-block:: bash
122
123     git clone --branch 5.0.1-ONAP ssh://<username>@gerrit.onap.org:29418/oom --recurse-submodules
124
125 VNF Preparation
126 +++++++++++++++
127
128 The VNF lifecycle validation test suite requires the VNF to be packaged into a
129 specific directory hierarchy, shown below.
130
131 .. code-block::
132
133     vnf_folder
134     ├── /templates
135     |   └── base.yaml
136     |   └── base.env
137     |   └── incremental_0.yaml
138     |   └── incremental_0.env
139     |   └── ...
140     ├── /preloads
141     |   └── base_preload.json
142     |   └── incremental_0_preload.json
143     |   └── ...
144     └── vnf-details.json
145
146 - The name for ``vnf_folder`` is free-form, and can be located anywhere on your
147   computer. The path to this folder will be passed to the test suite as an
148   argument.
149 - ``/templates`` should contain your VVP-compliant VNF heat templates.
150 - ``/preloads`` should contain a preload file for each VNF module
151
152     - For a VNF-API preload: ``vnf-name``, ``vnf-type``, ``generic-vnf-type``,
153       and ``generic-vnf-name`` should be empty strings.
154     - For a GR-API preload: ``vnf-name``, ``vnf-type``, ``vf-module-type``,
155       and ``vf-module-name`` should be empty strings.
156     - This information will be populated at runtime by the test suite.
157
158 - ``vnf-details`` should be a JSON file with the information that will be used
159   by ONAP to instantiate the VNF. The structure of ``vnf-details`` is shown below.
160 - VNF disk image must be uploaded and available in the OpenStack project being
161   managed by ONAP
162 - ``modules`` must contain an entry for each module of the VNF. Only one module
163   can be a base module.
164 - ``api_type`` should match the format of the preloads (``vnf_api``
165   or ``gr_api``) that are provided in the package.
166 - The other information should match what was used to configure ONAP during the
167   pre-requisite section of this guide.
168
169 .. code-block:: json
170
171     {
172         "vnf_name": "The Vnf Name",
173         "description": "Description of the VNF",
174         "modules": [
175             {
176             "filename": "base.yaml",
177             "isBase": "true",
178             "preload": "base_preload.json"
179             },
180             {
181             "filename": "incremental_0.yaml",
182             "isBase": "false",
183             "preload": "incremental_0.json"
184             },
185         ],
186         "api_type": "[gr_api] or [vnf_api]",
187         "subscriber": "<subscriber name>",
188         "service_type": "<service type>",
189         "tenant_name": "<name of tenant>",
190         "region_id": "<name of region>",
191         "cloud_owner": "<name of cloud owner>",
192         "project_name": "<name of project>",
193         "owning_entity": "<name of owning entity>",
194         "platform": "<name of platform>",
195         "line_of_business": "<name of line of business>",
196         "os_password": "<openstack password>"
197     }
198
199 Running the HEAT VNF Test
200 +++++++++++++++++++++++++
201
202 The ONAP OOM Robot framework will run the test, using ``kubectl`` to manage the
203 execution.  The framework will copy your VNF template files to the Robot
204 container required to execute the test.
205
206 .. code-block:: bash
207
208      cd oom/kubernetes/robot
209     $ ./instantiate-k8s.sh --help
210     ./instantiate-k8s.sh [options]
211
212     required:
213     -n, --namespace <namespace>       namespace that robot pod is running under.
214     -f, --folder <folder>             path to folder containing heat templates, preloads, and vnf-details.json.
215
216     additional options:
217     -p, --poll                        some cloud environments (like azure) have a short time out value when executing
218                                       kubectl. If your shell exits before the test suite finishes, using this option
219                                       will poll the test suite logs every 30 seconds until the test finishes.
220     -t, --tag <tag>                   robot testcase tag to execute (default is instantiate_vnf).
221
222     This script executes the VNF instantiation robot test suite.
223     - It copies the VNF folder to the robot container that is part of the ONAP deployment.
224     - It models, distributes, and instantiates a heat-based VNF.
225     - It copies the logs to an output directory, and creates a tarball for upload to the OVP portal.
226
227
228 **Sample execution:**
229
230 .. code-block:: bash
231
232     $ ./instantiate-k8s.sh --namespace onap --folder /tmp/vnf-instantiation/examples/VNF_API/pass/multi_module/ --poll
233     ...
234     ...
235     ...
236     ...
237     ------------------------------------------------------------------------------
238     test suites.Vnf Instantiation :: The main driver for instantiating ... | PASS |
239     1 critical test, 1 passed, 0 failed
240     1 test total, 1 passed, 0 failed
241     ==============================================================================
242     test suites                                                            | PASS |
243     1 critical test, 1 passed, 0 failed
244     1 test total, 1 passed, 0 failed
245     ==============================================================================
246     Output:  /share/logs/0003_ete_instantiate_vnf/output.xml
247     + set +x
248     test suite has finished
249     Copying Results from pod...
250     /tmp/vnf-instantiation /tmp/vnf-instantiation
251     a log.html
252     a results.json
253     a stack_report.json
254     a validation-scripts.json
255     /tmp/vnf-instantiation
256     VNF test results: /tmp/vnfdata.46749/vnf_heat_results.tar.gz
257
258 The test suite takes about 10-15 minutes for a simple VNF, and will take longer
259 for a more complicated VNF.
260
261 Reporting Results
262 +++++++++++++++++
263
264 Once the test suite is finished, it will create a directory and tarball in
265 ``/tmp`` (the name of the directory and file is shown at the end of the stdout
266 of the script). There will be a ``results.json`` file in that directory
267 that has the ultimate outcome of the test, in the structure shown below.
268
269 **Log Files**
270
271 The output tar file will have 4 log files in it.
272
273 - ``results.json``: This is high-level results file of all of the test steps,
274   and is consumed by the OVP portal.
275 - ``report.json``: This is the output of the VVP validation scripts.
276 - ``stack_report.json``: This is the output from querying OpenStack to validate
277   the Heat modules.
278 - ``log.html``: This is the Robot test log, and contains each execution step of
279   the test case.
280
281 If the result is ``"PASS"``, that means the test suite was successful and the
282 tarball is ready for submission to the OVP portal.
283
284 **results.json**
285
286 .. code-block:: json
287
288     {
289         "vnf_checksum": "afc57604a3b3b7401d5b8648328807b594d7711355a2315095ac57db4c334a50",
290         "build_tag": "vnf-validation-7055d30b-9a2e-4ca2-9409-499131cc86db",
291         "version": "2019.12",
292         "test_date": "2019-09-04 17:50:10.575",
293         "duration": 437.002,
294         "vnf_type": "heat",
295         "testcases_list": [
296             {
297                 "mandatory": "true",
298                 "name": "onap-vvp.validate.heat",
299                 "result": "PASS",
300                 "objective": "onap heat template validation",
301                 "sub_testcase": [],
302                 "portal_key_file": "report.json"
303             },
304             {
305                 "mandatory": "true",
306                 "name": "onap-vvp.lifecycle_validate.heat",
307                 "result": "PASS",
308                 "objective": "onap vnf lifecycle validation",
309                 "sub_testcase": [
310                     {
311                         "name": "model-and-distribute",
312                         "result": "PASS"
313                     },
314                     {
315                         "name": "instantiation",
316                         "result": "PASS"
317                     }
318                 ],
319                 "portal_key_file": "log.html"
320             },
321             {
322                 "mandatory": "true",
323                 "name": "stack_validation",
324                 "result": "PASS",
325                 "objective": "onap vnf openstack validation",
326                 "sub_testcase": [],
327                 "portal_key_file": "stack_report.json"
328             }
329         ]
330     }
331
332 Examples
333 ++++++++
334
335 Example VNFs and setup files have been created as a starting point for your
336 validation.
337
338 * :download:`Passing Single Volume VNF using VNF API <input-VNF-API-pass-single_module.zip>`
339 * :download:`Failing Single Volume VNF using VNF API <input-VNF-API-fail-single_module.zip>`
340
341 Additional Resources
342 ++++++++++++++++++++
343
344 - `ONAP VVP Project <https://wiki.onap.org/display/DW/VNF+Validation+Program+Project>`_
345
346
347 .. _tosca_vnf_validation:
348
349 TOSCA-based VNF Testing
350 ~~~~~~~~~~~~~~~~~~~~~~~
351
352 VNF Test Platform (VTP) provides an platform to on-board different test cases
353 required for OVP for various VNF testing provided by VNFSDK (for TOSCA) projects
354 in ONAP. And it generates the test case outputs which would be uploaded into
355 OVP portal for VNF badging.
356
357 TOSCA VNF Test Environment
358 ++++++++++++++++++++++++++
359
360 As pre-requestsite steps, it is assumed that, successful ONAP, Vendor VNFM and
361 OpenStack cloud are already available. Below installation steps help to setup
362 VTP components and CLI.
363
364 .. image:: tosca_vnf_test_environment.png
365     :align: center
366
367 Installation
368 ++++++++++++
369
370 Clone the VNFSDK repo.
371
372 .. code-block:: bash
373
374     git clone --branch elalto https://git.onap.org/vnfsdk/refrepo
375
376 Install the VTP by using script
377 ``refrepo/vnfmarket-be/deployment/install/vtp_install.sh``
378
379 Follow the steps as below (in sequence):
380
381 - ``vtp_install.sh --download``: It will download all required artifacts into
382   ``/opt/vtp_stage``
383 - ``vtp_install.sh --install``: It will install VTP (``/opt/controller``) and
384   CLI (``/opt/oclip``)
385 - ``vtp_install.sh --start``: It will start VTP controller as Tomcat service
386   and CLI as ``oclip`` service
387 - ``vtp_install.sh --verify``: It will verify the setup is done properly by
388   running some test cases.
389
390 Last step (verify) would check the health of VTP components and TOSCA VNF
391 compliance and validation test cases.
392
393 Check Available Test Cases
394 ++++++++++++++++++++++++++
395
396 VTP supports to check the compliance of VNF and PNF based on ONAP VNFRQTS.
397
398 To check:
399
400 - Go to command console
401 - Run command ``oclip``
402 - Now it will provide a command prompt:
403
404 ``oclip:open-cli>``
405
406 Now run command as below and check the supported compliance test cases for
407 VNFRQTS.
408
409 - ``csar-validate`` - Helps to validate given VNF CSAR for all configured
410   VNFRQTS.
411 - ``csar-validate-rxxx`` - Helps to validate given VNF CSAR for a given
412   VNFRQTS requirement number.
413
414 .. code-block:: bash
415
416     oclip:open-cli>schema-list --product onap-dublin --service vnf-compliance
417     +--------------+----------------+------------------------+--------------+----------+------+
418     |product       |service         |command                 |ocs-version   |enabled   |rpc   |
419     +--------------+----------------+------------------------+--------------+----------+------+
420     |onap-dublin   |vnf-compliance  |csar-validate-r10087    |1.0           |true      |      |
421     +--------------+----------------+------------------------+--------------+----------+------+
422     |onap-dublin   |vnf-compliance  |csar-validate           |1.0           |true      |      |
423     +--------------+----------------+------------------------+--------------+----------+------+
424     |onap-dublin   |vnf-compliance  |csar-validate-r26885    |1.0           |true      |      |
425     +--------------+----------------+------------------------+--------------+----------+------+
426     |onap-dublin   |vnf-compliance  |csar-validate-r54356    |1.0           |true      |      |
427     ...
428
429 To know the details of each VNFRQTS, run as below.
430
431 .. code-block:: bash
432
433     oclip:open-cli>use onap-dublin
434     oclip:onap-dublin>csar-validate-r54356 --help
435     usage: oclip csar-validate-r54356
436
437     Data types used by NFV node and is based on TOSCA/YAML constructs specified in draft GS NFV-SOL 001.
438     The node data definitions/attributes used in VNFD MUST comply.
439
440 Now run command as below and check the supported validation testcases
441
442 .. code-block:: bash
443
444     oclip:onap-dublin>use open-cli
445     oclip:open-cli>schema-list --product onap-dublin --service vnf-validation
446     +--------------+----------------+----------------------+--------------+----------+------+
447     |product       |service         |command               |ocs-version   |enabled   |rpc   |
448     +--------------+----------------+----------------------+--------------+----------+------+
449     |onap-dublin   |vnf-validation  |vnf-tosca-provision   |1.0           |true      |      |
450     +--------------+----------------+----------------------+--------------+----------+------+
451
452 Configure ONAP with required VNFM and cloud details
453 +++++++++++++++++++++++++++++++++++++++++++++++++++
454
455 **1. Setup the OCOMP profile onap-dublin**
456
457 Run following command to configure the ONAP service URL and credentials as
458 given below, which will be used by VTP while executing the test cases
459
460 .. code-block:: bash
461
462     oclip:open-cli>use onap-dublin
463     oclip:onap-dublin>profile onap-dublin
464     oclip:onap-dublin>set sdc.onboarding:host-url=http://159.138.8.8:30280
465     oclip:onap-dublin>set sdc.onboarding:host-username=cs0008
466     oclip:onap-dublin>set sdc.onboarding:host-password=demo123456!
467     oclip:onap-dublin>set sdc.catalog:host-url=http://159.138.8.8:30205
468     oclip:onap-dublin>set sdc.catalog:host-password=demo123456\!
469     oclip:onap-dublin>set sdc.catalog:host-username=cs0008
470     oclip:onap-dublin>set sdc.catalog:service-model-approve:host-username=gv0001
471     oclip:onap-dublin>set sdc.catalog:service-model-distribute:host-username=op0001
472     oclip:onap-dublin>set sdc.catalog:service-model-test-start:host-username=jm0007
473     oclip:onap-dublin>set sdc.catalog:service-model-test-accept:host-username=jm0007
474     oclip:onap-dublin>set sdc.catalog:service-model-add-artifact:host-username=ocomp
475     oclip:onap-dublin>set sdc.catalog:vf-model-add-artifact:host-username=ocomp
476     oclip:onap-dublin>set aai:host-url=https://159.138.8.8:30233
477     oclip:onap-dublin>set aai:host-username=AAI
478     oclip:onap-dublin>set aai:host-password=AAI
479     oclip:onap-dublin>set vfc:host-url=http://159.138.8.8:30280
480     oclip:onap-dublin>set multicloud:host-url=http://159.138.8.8:30280
481
482 NOTE: Mostly all above entries value would be same except the IP address used
483 in the URL, which would be ONAP Kubernetes cluster IP.
484
485 By default, SDC onboarding service does not provide node port, which is
486 available to access from external ONAP network. To enable for external access,
487 register the SDC onboarding service into MSB and use MSB url for
488 sdc.onboarding:host-url.
489
490 .. code-block:: bash
491
492     oclip:onap-dublin> microservice-create --service-name sdcob --service-version v1.0 --service-url /onboarding-api/v1.0 --path /onboarding-api/v1.0 --node-ip 172.16.1.0 --node-port 8081
493
494 NOTE: To find the node-ip and node-port, use the following steps.
495
496 Find out SDC onboarding service IP and port details as given here:
497
498 .. code-block:: bash
499
500     [root@onap-dublin-vfw-93996-50c1z ~]# kubectl get pods -n onap -o wide | grep sdc-onboarding-be
501     dev-sdc-sdc-onboarding-be-5564b877c8-vpwr5 2/2 Running 0 29d 172.16.1.0 192.168.2.163 <none> <none>
502     dev-sdc-sdc-onboarding-be-cassandra-init-mtvz6 0/1 Completed 0 29d 172.16.0.220 192.168.2.163 <none> <none>
503     [root@onap-dublin-vfw-93996-50c1z ~]#
504
505 Note down the IP address for sdc-onboarding-be 172.16.1.0
506
507 .. code-block:: bash
508
509     [root@onap-dublin-vfw-93996-50c1z ~]# kubectl get services -n onap -o wide | grep sdc-onboarding-be
510     sdc-onboarding-be ClusterIP 10.247.198.92 <none> 8445/TCP,8081/TCP 29d app=sdc-onboarding-be,release=dev-sdc
511     [root@onap-dublin-vfw-93996-50c1z ~]#
512
513 Note down the port for sdc-onboarding-be 8445 8081
514
515 Similarly, other service IP and Port could be discovered like above, in case not
516 know earlier :)
517
518 Verify these details once by typing 'set'
519
520 .. code-block:: bash
521
522     oclip:onap-dublin> set
523
524 This profile would be used by user while running the test cases with ONAP setup
525 configured in it, as below oclip --profile onap-dublin vnf-tosca-provision ....
526
527 **2. Setup SDC consumer**
528
529 SDC uses consumer concept to configure required VN model and service model
530 artifacts. So following commands required to run, which will create consumer
531 named ocomp, which is already configured in onap-dublin profile created in above
532 steps.
533
534 .. code-block:: bash
535
536     oclip --product onap-dublin --profile onap-dublin sdc-consumer-create --consumer-name ocomp
537
538 NOTE: command oclip could be used in scripting mode as above or in interactive
539 mode as used in earlier steps
540
541 **3. Update the cloud and vnfm driver details**
542
543 In the configuration file /opt/oclip/conf/vnf-tosca-provision.json, update the
544 cloud and VNFM details.
545
546 .. code-block:: json
547
548     { "cloud": {
549             "identity-url": "http://10.12.11.1:5000/v3",
550             "username": "admin",
551             "password": "password",
552             "region": "RegionOVP",
553             "version": "ocata",
554             "tenant": "ocomp"
555         },
556         "vnfm":{
557             "hwvnfmdriver":{
558                 "version": "v1.0",
559                 "url": "http://159.138.8.8:38088",
560                 "username": "admin",
561                 "password": "xxxx"
562             },
563             "gvnfmdriver":{
564                 "version": "v1.0",
565                 "url": "http://159.138.8.8:30280"
566             }
567         }
568     }
569
570 **4.Configure the decided VNFRES (optional)**
571 VTP allows to configure the set of VNFRQTS to be considered while running the
572 VNF compliance test cases in the configuration file
573 ``/opt/oclip/conf/VNFRQTS.properties.``
574
575 If not available, please create this file with following entries:
576
577 .. code-block:: bash
578
579     VNFRQTS.enabled=r02454,r04298,r07879,r09467,r13390,r23823,r26881,r27310,r35851,r40293,r43958,r66070,r77707,r77786,r87234,r10087,r21322,r26885,r40820,r35854,r65486,r17852,r46527,r15837,r54356,r67895,r95321,r32155,r01123,r51347,r787965,r130206
580     pnfreqs.enabled=r10087,r87234,r35854,r15837,r17852,r293901,r146092,r57019,r787965,r130206
581     # ignored all chef and ansible related tests
582     vnferrors.ignored=
583     pnferrors.ignored=
584
585 Running the TOSCA VNF Test
586 ++++++++++++++++++++++++++
587
588 Every test provided in VTP is given with guidelines on how to use it. On every
589 execution of test cases, use the following additional arguments based on
590 requirements
591
592 - ``--product onap-dublin`` - It helps VTP choose the test cases written for
593   onap-dublin version
594 - ``--profile onap-dublin`` - It helps VTP to use the profile settings provided
595   by admin (optional)
596 - ``--request-id`` - It helps VTP to  track the progress of the test cases
597   execution and user could use this id for same. (optional)
598
599 So, final test case execution would be as below.  To find the test case
600 arguments details, run second command below.
601
602 .. code-block:: bash
603
604     oclip --product onap-dublin --profile onap-dublin --request-id req-1 <test case name> <test case arguments>
605     oclip --product onap-dublin <test case name> --help
606
607 Running TOSCA VNF Compliance Testing
608 ++++++++++++++++++++++++++++++++++++
609
610 To run compliance test as below with given CSAR file
611
612 .. clode-block:: bash
613
614     oclip --product onap-dublin csar-validate --csar <csar file complete path>
615
616 It will produce the result format as below:
617
618 .. code-block:: json
619
620     {
621         "date": "Fri Sep 20 17:34:24 CST 2019",
622         "criteria": "PASS",
623         "contact": "ONAP VTP Team onap-discuss@lists.onap.org",
624         "results": [
625         {
626             "description": "V2.4.1 (2018-02)",
627             "passed": true,
628             "vnfreqName": "SOL004",
629             "errors": []
630         },
631         {
632             "description": "If the VNF or PNF CSAR Package utilizes Option 2 for package security, then the complete CSAR file MUST be digitally signed with the VNF or PNF provider private key. The VNF or PNF provider delivers one zip file consisting of the CSAR file, a signature file and a certificate file that includes the VNF or PNF provider public key. The certificate may also be included in the signature container, if the signature format allows that. The VNF or PNF provider creates a zip file consisting of the CSAR file with .csar extension, signature and certificate files. The signature and certificate files must be siblings of the CSAR file with extensions .cms and .cert respectively.\n",
633             "passed": true,
634             "vnfreqName": "r787965",
635             "errors": []
636         }
637         ],
638         "platform": "VNFSDK - VNF Test Platform (VTP) 1.0",
639         "vnf": {
640         "mode": "WITH_TOSCA_META_DIR",
641         "vendor": "ONAP",
642         "name": null,
643         "type": "TOSCA",
644         "version": null
645         }
646     }
647
648 In case of errors, the errors section will have list of details as below.  Each
649 error block, will be given with error code and error details. Error code would
650 be very useful to provide the troubleshooting guide in future. Note, to
651 generate the test result in OVP archieve format, its recommended to run this
652 compliance test with request-id similar to running validation test as below.
653
654 .. code-block:: bash
655
656     [
657     {
658         "vnfreqNo": "R66070",
659         "code": "0x1000",
660         "message": "MissinEntry-Definitions file",
661         "lineNumber": -1
662     }
663     ]
664
665 Running TOSCA VNF Validation Testing
666 ++++++++++++++++++++++++++++++++++++
667
668 VTP provides validation test case with following modes:
669
670 .. image:: tosca_vnf_test_flow.png
671     :align: center
672
673
674 * **setup**: Create requires Vendor, Service Subscription and VNF cloud in
675   ONAP
676 * **standup**: From the given VSP csar, VNF csar and NS csar, it creates VF
677   Model, NS Model and NS service
678 * **cleanup**: Remove those entries created during provision
679 * **provision**: Runs setup -> standup
680 * **validate**: Runs setup -> standup -> cleanup
681 * **checkup**: mode helps to verify automation is deployed properly.
682
683 For OVP badging, validate mode would be used as below:
684
685 .. code-block:: bash
686
687     oclip --request-id WkVVu9fD--product onap-dublin --profile onap-dublin vnf-tosca-provision --vsp <vsp csar> --vnf-csar <v
688
689 Validation testing would take for a while to complete the test execution, so
690 user could use the above given ``request-id``, to tracking the progress as
691 below:
692
693 .. code-block:: bash
694
695     oclip execution-list --request-id WkVVu9fD
696     +------------+------------------------+--------------+------------------+------------------------------+--------------+------------+--------------------------+--------------------------+
697     |request-id  |execution-id            |product       |service           |command                       |profile       |status      |start-time                |end-time                  |
698     +------------+------------------------+--------------+------------------+------------------------------+--------------+------------+--------------------------+--------------------------+
699     |WkVVu9fD    |WkVVu9fD-1568731678753  |onap-dublin   |vnf-validation    |vnf-tosca-provision           |              |in-progress |2019-09-17T14:47:58.000   |                        |
700     +------------+------------------------+--------------+------------------+------------------------------+--------------+------------+--------------------------+--------------------------+
701     |WkVVu9fD    |WkVVu9fD-1568731876397  |onap-dublin   |sdc.catalog       |service-model-test-request    |onap-dublin   |in-progress |2019-09-17T14:51:16.000   |                          |
702     +------------+------------------------+--------------+------------------+------------------------------+--------------+------------+--------------------------+--------------------------+
703     |WkVVu9fD    |WkVVu9fD-1568731966966  |onap-dublin   |sdc.onboarding    |vsp-archive                   |onap-dublin   |completed   |2019-09-17T14:52:46.000   |2019-09-17T14:52:47.000   |
704     +------------+------------------------+--------------+------------------+------------------------------+--------------+------------+--------------------------+--------------------------+
705     |WkVVu9fD    |WkVVu9fD-1568731976982  |onap-dublin   |aai               |subscription-delete           |onap-dublin   |completed   |2019-09-17T14:52:56.000   |2019-09-17T14:52:57.000   |
706     +------------+------------------------+--------------+------------------+------------------------------+--------------+------------+--------------------------+--------------------------+
707     |WkVVu9fD    |WkVVu9fD-1568731785780  |onap-dublin   |aai               |vnfm-create                   |onap-dublin   |completed   |2019-09-17T14:49:45.000   |2019-09-17T14:49:46.000   |
708     ......
709
710 While executing the test cases, VTP provides unique execution-id (2nd column)
711 for each step. As you note in the example above, some steps are in-progress,
712 while others are completed already. If there is error then status will be set
713 to failed.
714
715 To find out the foot-print of each step, following commands are available:
716
717 .. code-block:: bash
718
719     oclip execution-show-out --execution-id WkVVu9fD-1568731785780       - Reports the standard output logs
720     oclip execution-show-err --execution-id WkVVu9fD-1568731785780        - Reports the standard error logs
721     oclip execution-show-debug --execution-id WkVVu9fD-1568731785780  - Reports the debug details like HTTP request and responseoclip execution-show --execution-id WkVVu9fD-1568731785780              - Reports the complete foot-print of inputs, outputs of steps
722
723 Track the progress of the vnf-tosca-provision test cases until its completed.
724 Then the out of the validation test cases could be retrieved as below:
725
726 .. code-block:: bash
727
728     oclip execution-show --execution-id WkVVu9fD-1568731678753              - use vnf tosca test case execution id here
729
730 It will provides the output format as below:
731
732 .. code-block:: json
733
734     {
735     "output": {
736         "ns-id": null,
737         "vnf-id": "",
738         "vnfm-driver": "hwvnfmdriver",
739         "vnf-vendor-name": "huawei",
740         "onap-objects": {
741         "ns_instance_id": null,
742         "tenant_version": null,
743         "service_type_id": null,
744         "tenant_id": null,
745         "subscription_version": null,
746         "esr_vnfm_id": null,
747         "location_id": null,
748         "ns_version": null,
749         "vnf_status": "active",
750         "entitlement_id": null,
751         "ns_id": null,
752         "cloud_version": null,
753         "cloud_id": null,
754         "vlm_version": null,
755         "esr_vnfm_version": null,
756         "vlm_id": null,
757         "vsp_id": null,
758         "vf_id": null,
759         "ns_instance_status": "active",
760         "service_type_version": null,
761         "ns_uuid": null,
762         "location_version": null,
763         "feature_group_id": null,
764         "vf_version": null,
765         "vsp_version": null,
766         "agreement_id": null,
767         "vf_uuid": null,
768         "ns_vf_resource_id": null,
769         "vsp_version_id": null,
770         "customer_version": null,
771         "vf_inputs": null,
772         "customer_id": null,
773         "key_group_id": null,
774         },
775         "vnf-status": "active",
776         "vnf-name": "vgw",
777         "ns-status": "active"
778     },
779     "input": {
780         "mode": "validate",
781         "vsp": "/tmp/data/vtp-tmp-files/1568731645518.csar",
782         "vnfm-driver": "hwvnfmdriver",
783         "config-json": "/opt/oclip/conf/vnf-tosca-provision.json",
784         "vnf-vendor-name": "huawei",
785         "ns-csar": "/tmp/data/vtp-tmp-files/1568731660745.csar",
786         "onap-objects": "{}",
787         "timeout": "600000",
788         "vnf-name": "vgw",
789         "vnf-csar": "/tmp/data/vtp-tmp-files/1568731655310.csar"
790     },
791     "product": "onap-dublin",
792     "start-time": "2019-09-17T14:47:58.000",
793     "service": "vnf-validation",
794     "end-time": "2019-09-17T14:53:46.000",
795     "request-id": "WkVVu9fD-1568731678753",
796     "command": "vnf-tosca-provision",
797     "status": "completed"
798     }
799
800 Reporting Results
801 +++++++++++++++++
802
803 VTP provides translation tool to migrate the VTP result into OVP portal format
804 and generates the tar file for the given test case execution.  Please refer
805 `<https://github.com/onap/vnfsdk-refrepo/tree/master/vnfmarket-be/deployment/vtp2ovp>`_
806 for more details.
807
808 Once tar is generated, it can be used to submit into OVP portal
809 `<https://vnf-verified.lfnetworking.org/>`_
810
811 .. References
812 .. _`OVP VNF portal`: https://vnf-verified.lfnetworking.org