You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

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/pap
$ cd pap/
$ mvn clean install -Pdocker

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

Policy API Docker Image Run
$ docker ps
CONTAINER ID        IMAGE                                   COMMAND                  CREATED             STATUS              PORTS                    NAMES
bf5f76a3c8f2        onap/policy-pap:2.0.0-SNAPSHOT-latest   "bash ./policy-pap.sh"   2 minutes ago       Up 2 minutes        0.0.0.0:6969->6969/tcp   policy-api

# Run policy-pap container
docker run -d --name policy-pap -p 6969:6969 -it onap/policy-pap:2.0.0-SNAPSHOT-latest

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

Health Check
$ curl --user healthcheck:zb\!XztG34 -H “Accept=application/json, Content-Type=application/json” -k https://127.0.0.1:6969/healthcheck
Content-Type=application
{"name":"Policy PAP","url":"self","healthy":true,"code":200,"message":"alive"

6- Check for statistics API with Sample Output

Statistics API
$ curl --user healthcheck:zb\!XztG34 -H “Accept=application/json, Content-Type=application/json” -k https://127.0.0.1:6969/statistics
Content-Type=application
{"code":200,"totalPdpCount":0,"totalPdpGroupCount":0,"totalPolicyDeployCount":0,"policyDeploySuccessCount":0,"policyDeployFailureCount":0,"totalPolicyDownloadCount":0,"policyDownloadSuccessCount":0,"policyDownloadFailureCount":0}

JMeter VM Setup: VM2

7- Install JMeter on VM2.

JMeter Install
$ cd ~/
$ wget http://mirrors.whoishostingthis.com/apache//jmeter/binaries/apache-jmeter-5.0.zip
$ unzip apache-jmeter-5.0.zip 


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
# Go into the directory where stability tests are placed.
~/apache-jmeter-5.0/bin/jmeter.sh -n -t stability.jmx  -Jretry=200 -Jduration=3600 -Jusers=1 -l stability.log
cat stability.log | grep "failed"
  • No labels