Policy API Stability and Performance Tests

0- This process requires 2 VMs. Both VMs should be accessible from each other. Here we'll provide instructions for VM1 setup and then on VM2 setup.



1- Install the basic packages on VM1 and VM2.

basic_packages
$ sudo apt-get update $ sudo apt-get install -y openjdk-8-jdk docker docker-compose zip unzip curl wget ssh telnet maven # make sure docker can be launched with normal user $ sudo groupadd docker $ sudo gpasswd -a $USER docker $ newgrp docker



Policy API VM Setup: VM1

2- Download and build policy API and its docker image.

Policy API Docker Image Build
$ cd ~/ $ git clone https://gerrit.onap.org/r/oparent $ cd oparent/ $ cp settings.xml ~/.m2/ $ mvn clean install $ cd ../ $ git clone https://gerrit.onap.org/r/policy/parent $ cd parent/ $ mvn clean install $ cd ../ $ git clone https://gerrit.onap.org/r/policy/api $ cd api/ $ mvn clean install -Pdocker

3- Check if the images are indeed built and then run the docker  image.

Policy API Docker Image Run
$ docker images REPOSITORY TAG IMAGE ID CREATED SIZE onap/policy-api 2.0.0-SNAPSHOT 891f162e17fc 28 hours ago 1e+03MB onap/policy-api 2.0.0-SNAPSHOT-20190212T1205 891f162e17fc 28 hours ago 1e+03MB onap/policy-api 2.0.0-SNAPSHOT-latest 891f162e17fc 28 hours ago 1e+03MB onap/policy-api latest 891f162e17fc 28 hours ago 1e+03MB # Run policy-api container docker run -d --name policy-api -p 6969:6969 -it onap/policy-api:2.0.0-SNAPSHOT-latest

5- Check health status of the API service with following command:

Health Check

6- Check for statistics API with Sample Output

Statistics API



JMeter VM Setup: VM2

7- Install JMeter on VM2.

JMeter Install



8- Run JMeter Stability Tests.

      Jduration is time in seconds to run the tests.

      Jusers is the number of threads to be started.

    Results of the run are stored in stability.log file.

    To check for any failures search for any "failed"/"Failed" message.

Stability Tests