Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Info

This is not published to gerrit yetStarting with the Frankfurt release, this method is deprecated and this page will no longer be maintained. Visit this page for instructions on executing the testsuite.


About

This page contains instructions for executing the VNF Lifecycle Validation automation flow for heat-based VNFs. The result will be a .tar.gz file that can be used to submit to the OVP Portal to obtain a certification badge for a VNF. The execution is very similar to running the other ONAP demo VNFs, however there are some additional steps detailed below

This will be introduced in the El Alto release, and will not be backwards compatible with previous ONAP releases

Prerequisites

...

If you're not familiar with how to configure ONAP, there are guides that use robot or direct api requests available to help, as well as a guide for adding a new OpenStack site to ONAP. 

...

Code Block
vnf_folder
├── /templates
|   ├──└── base.yaml
|   ├──└── base.env
|   └── incremental_0.yaml
|   └── incremental_0.env
|   └── ...
├── /preloads
|   ├──└── base_preload.json
|   └── incremental_0_preload.json
|   └── ...
└── vnf-details.json

...

The script to execute the testsuite is located in the OOM project. Clone the OOM repository and cd to the robot folder.


Code Block
$ git clone httpsssh://github<username>@gerrit.com/onap.org:29418/oom.git --recurse-submodules
$ cd oom/kubernetes/robot
$ ./instantiate-k8s.sh --help
./instantiate-k8s.sh [options]
 
required:
-n, --namespace <namespace>       namespace that robot pod is running under.
-f, --folder <folder>             path to folder containing heat templates, preloads, and vnf-details.json.
 
additional options:
-p, --poll                        some cloud environments (like azure) have a short time out value when executing
                                  kubectl. If your shell exits before the testsuite finishes, using this option
                                  will poll the testsuite logs every 30 seconds until the test finishes.
-t, --tag <tag>                   robot testcase tag to execute (default is instantiate_vnf).
 
This script executes the VNF instantiation robot testsuite.
- It copies the VNF folder to the robot container that is part of the ONAP deployment.
- It models, distributes, and instantiates a heat-based VNF.
- It copies the logs to an output directory, and creates a tarball for upload to the OVP portal.



Execution


Code Block
languagebash
$ ./instantiate-k8s.sh --namespace onap --folder /tmp/vnf-instantiation/examples/VNF_API/pass/multi_module/ --poll
...
...
...
...
------------------------------------------------------------------------------
Testsuites.Vnf Instantiation :: The main driver for instantiating ... | PASS |
1 critical test, 1 passed, 0 failed
1 test total, 1 passed, 0 failed
==============================================================================
Testsuites                                                            | PASS |
1 critical test, 1 passed, 0 failed
1 test total, 1 passed, 0 failed
==============================================================================
Output:  /share/logs/0003_ete_instantiate_vnf/output.xml
+ set +x
testsuite has finished
Copying Results from pod...
/tmp/vnf-instantiation /tmp/vnf-instantiation
a log.html
a results.json
a stack_report.json
a validation-scripts.json
/tmp/vnf-instantiation
VNF test results: /tmp/vnfdata.46749/vnf_heat_results.tar.gz

...

The testsuite takes about 10-15 minutes for a simple VNF, and will take longer for a more complicated VNF.


Results

Once the testsuite is finished, it will create a directory and tarball in /tmp (the name of the directory and file is shown at the end of the stdout of the script). There will be a results.json in that directory that has the ultimate outcome of the test, in the structure shown below.

Log files

The output file will have 4 log files in it.

  • results.json

...

  • : This

...

  • is high-level results file of all of the test steps, and is consumed by the OVP portal.
  • report.json: This is the output of the vvp validation scripts.
  • stack_report.json: This is the output from querying openstack to validate the heat modules.
  • log.html: This is the robot log, and contains each execution step of the testcase.

results.json


Code Block
{
    "vnf_checksum": "afc57604a3b3b7401d5b8648328807b594d7711355a2315095ac57db4c334a50", 
    "build_tag": "vnf-validation-4674953270", 
    "version": "2019.09", 
    "test_date": "2019-0809-2604 2217:3850:4710.884575", 
    "duration": 867437.973002, 
    "vnf_type": "heat", 
    "testcases_list": [
        {
            "mandatory": "true", 
            "name": "onap-vvp.validate.heat", 
            "result": "PASS", 
            "objective": "onap heat template validation", 
            "sub_testcase": [], 
            "logportal_key_file": "validation-scriptsreport.json"
        }, 
        {
            "objectivemandatory": "onap vnf lifecycle validationtrue", 
            "sub_testcasename": [
   "onap-vvp.lifecycle_validate.heat", 
           {    "result": "PASS", 
               "log_file"objective": "log.htmlonap vnf lifecycle validation", 
            "sub_testcase": [
      "name": "model-and-distribute",         {
           "result         "name": "PASSmodel-and-distribute", 
               },     "result": "PASS"
           {     }, 
               "log_file": "log.html", {
                    "name": "instantiation", 
                    "result": "PASS"
                },
            ], 
  {              "portal_key_file": "log.html"
       "log_file": "stack_report.json" }, 
        {
            "namemandatory": "stack_validationtrue",
     
              "resultname": "PASSstack_validation", 
            "result": "PASS", 
}             ],
            "mandatory"objective": "trueonap vnf openstack validation", 
            "namesub_testcase": "onap-vvp.lifecycle_validate.heat",[], 
            "resultportal_key_file": "PASSstack_report.json"
        }
    ]
}


If the result is "PASS", that means the testsuite was successful and the tarball is ready for submission to the OVP portal.

Examples

Attached to this page are simple examples that you can use to try out the testcase, along with the output tarballs that are generated. To run one of the examples, download one of the zip files named input-* and unzip it to your computer, then follow the instructions from the section Running the testsuite above.

View file
nameinput-VNF-API-fail-single_module.zip
height250
View file
nameinput-VNF-API-pass-single_module.zip
height250
View file
namevnf_heat_results-fail-vnfapi-singlemodule.tar.gz
height250
View file
namevnf_heat_results-pass-vnfapi-singlemodule.tar.gz
height250