Using Default Robot Scripts in ONAP

In this blog, I will explain the steps needed for using Robot scripts for onboarding and instantiation of VNF’s in an OOM based ONAP deployment, such as one used by Aarna Networks’ ONAP Distribution (ANOD). The Robot script comes with the default deployment and you can learn more about the Robot framework here.

Setup Requirements

Before we go deeper into various Robot scripts, we need to make sure that following setup is available and working correctly.

  1. ONAP should be setup with the correct Openstack configurations. You can refer to Aarna’s ANOD for deploying ONAP.  
  2. All Kubernetes containers in ONAP need to be up and running.  
  3. ONAP should be accessible over the GUI.

Robot Script Commands

The Robot framework in ONAP provides us various options to onboard/distribute/instantiate VNF packages.

First, you need to download latest ONAP source files from the git repo.

The base script for Robot is located at the following location:

oom/kubernetes/robot/

The first step is to initialize the Robot setup with ONAP. The command is as follows

cd oom/kubernetes/robot/

./demo-k8s.sh onap init

This will create test customer models and distribute them in ONAP. The script takes several minutes to complete. After the completion of the script one can log into ONAP GUI and see various test customers and test models.

The Robot framework provides following additional commands:

1. Create demo customer (Demonstration) and services, etc.

$>./demo-k8s.sh onap init_customer

2. Distribute demo models (demoVFW and demoVLB)

$> ./demo-k8.sh onap distribute  []

3. Preload data for VNF for a given  module

$> ./demo-k8.sh onap  preload    

4. Instantiate vFW module for the a demo customer. This will go all the way to create a stack in openstack.

$> ./demo-k8.sh onap instantiateVFW

5. Delete the module created by instantiateVFW

$> ./demo-k8.sh onap deleteVNF

The Robot framework runs as a kubernetes container on one of the ONAP server nodes. The Robot container has template files for the following VNF's.

  • vCPE  
  • vFW  
  • vFWCL  
  • vLB  
  • vLBMS  
  • vVG  

Using Robot scripts one can onboard above VNF's in ONAP. Some base functionality is provided as part of the ONAP package and the rest can be built by modifying the scripts. The scripts can also be further tweaked to create custom 'CUSTOMERS' and distribute them.

One can login to the Robot container using following commands.

# Get the Robot POD name

$> kubectl get pod --all-namespaces -o=wide | grep robot

onap dev-robot-54bbc764fb-2k2mw 1/1 Running 1 49d 10.42.108.186 beijing01

# Connect to Robot POD

$> kubectl exec -it -n onap dev-robot-54bbc764fb-2k2mw -- /bin/bash

The above kubectl command creates a bash shell within Robot container. In the shell we can view various Robot scripts that use python commands to operate on ONAP.

Above mentioned VNF packages and  corresponding Openstack Heat templates are located in following directories:

root@dev-robot-54bbc764fb-2k2mw:/# cd /share/heat/

root@dev-robot-54bbc764fb-2k2mw:/share/heat# ls

OAM-Network  ONAP  temp  vCPE  vFW  vFWCL  vLB  vLBMS  vVG

root@dev-robot-54bbc764fb-2k2mw:/share/heat# cd vFW

root@dev-robot-54bbc764fb-2k2mw:/share/heat/vFW# ls

MANIFEST.json  base_vfw.env  base_vfw.yaml

Above we can see the .yaml and .env file for virtual firewall (vFW).

When Robot scripts are invoked, it picks up the above files, creates a zip and then onboards it to ONAP.

More details on Robot scripts can be found here

/var/opt/OpenECOMP_ETE/robot/testsuites

After the completion of a Robot command, one can look at the logs located in following directory.

root@dev-robot-54bbc764fb-2k2mw:/share/logs/demo/InitDemo# pwd

/share/logs/demo/InitDemo

root@dev-robot-54bbc764fb-2k2mw:/share/logs/demo/InitDemo# ls

log.html  output.xml  report.html

# We can access the Robot logs from web UI

Logs URL = http://<PORTAL LOAD BALANCER  IP>:30209/logs/demo/

For copying the files from the container to host server you can use the following command.

kubectl cp onap/<robot container id>:<path to file>  <local name>

e.g.

kubectl cp onap/dev-robot-54bbc764fb-2k2mw:/var/opt/test  /tmp/test

For customization of Robot commands and addition of functionality one can look into following scripts.

root@dev-robot-54bbc764fb-2k2mw:/var/opt/OpenECOMP_ETE/robot/testsuites/demo.robot

The above file contains Robot tags for above mentioned commands.

In the next blog, I will explain how some of these Robot scripts can be customized for onboarding VNFs and Network services that you created, so that this process of onboarding and testing them can be automated.

Curious to learn more? Take our 2 day training in San Jose on April 1-2 just before ONS. Or give ANOD a spin.

We use cookies to enhance site navigation, analyze site usage, and assist in our marketing efforts. For more information, please see the Aarna Networks Cookie Policy.
Accept cookies