72 Hours Stability Test Plan of Distribution
Introduction
The 72 hour Stability Test for policy distribution has the goal of introducing a steady flow of transactions initiated from a test client server running JMeter. The policy distribution is configured with a special FileSystemReception plugin to monitor a local directory for newly added csar files to be processed by itself. The input CSAR will be added/removed by the test client(JMeter) and the result will be pulled from the backend(PAP and PolicyAPI) by the test client(JMeter).
The test will be performed in an environment where Jmeter will continuously add/remove a test csar into the special directory where policy distribuion is monitoring and will then get the processed results from PAP and PolicyAPI to verify the successful deployment of the policy. The policy will then be undeployed and the test will loop continuously until 72 hours have elapsed.
Setup Details
The stability test is performed on VM's running in the OpenStack cloud environment in the ONAP integration lab. There are 2 separate VMs, one for running backend policy services which policy distribution needs, and the other is for policy distribution service itself and Jmeter.
OpenStack environment details
Version: Windriver Titanium
policy backend VM details (VM1)
OS:Ubuntu 18.04.4 LTS
CPU: 8 core
RAM: 32 GB
HardDisk: 160 GB
Docker version 19.03.8, build afacb8b7f0
Java: openjdk version "11.0.7"
JMeter and Distribution VM details (VM2)
OS: Ubuntu 18.04.4 LTS
CPU: 8 core
RAM: 32 GB
HardDisk: 160 GB
Docker version 19.03.8, build afacb8b7f0
Java: openjdk version "11.0.7"
JMeter: 5.1.1
Install Docker in VM1 and VM2
Update the ubuntu software installer
$ apt-get update
Install and Check Java
$ apt-get install -y openjdk-11-jdk
$ java --version
Install and Check docker
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
$ apt-get update
$ apt-cache policy docker-ce
$ apt-get install -y docker-ce
$ systemctl status docker
$ docker ps
Change the permissions of the Docker socket file
Check the status of the Docker service and ensure it is running correctly
Install Simulators, PAP, PolicyAPI and MariaDB in VM1
To install all the components needed for Distribution, copy over the script and related files found within the simulatorsetup directory within $(REPOPATH)/distribution/testsuites/stability/src/main/resources
Run setup_components.sh script to bring up the required docker containers
After installation, ensure the following docker containers are up and running:
Install Distribution in VM2
To install the Distribution service, copy over the script and related files found within the distributionsetup directory within $(REPOPATH)/distribution/testsuites/stability/src/main/resources
Run setup_distribution.sh script to install the distribution service, provide the IP of VM1 as the arguments to the script.
e.g
Ensure the distribution container is running.
Install JMeter in VM2
Download and install jMeter
Install & configure visualVM in VM2
VisualVM needs to be installed in the virtual machine running Distrbution. It will be used to monitor CPU, Memory and GC for Distribution while the stability tests are running.
Run these commands to configure permissions
Run the following commands to start jstatd using port 1111
Using the VM2 Desktop, run visualVM to connect to localhost:9090
Run the command
This will load up the visualVM GUI
Connect to Distribution JMX Port.
Right click on "Local" in the left panel of the screen and select "Add JMX Connection"
Enter the Port 9090. this is the JMX port exposed by the dsitribution container
Double click on the newly added nodes under "Local" to start monitoring CPU, Memory & GC.
Example Screenshot
Test Plan Setup
The 72 hours stability test will run the following steps sequentially in a single threaded loop
Delete Old CSAR - Checks if CSAR already exists in the watched directory, if so it deletes it
Add CSAR - Adds CSAR to the directory that distribution is watching
Get Healthcheck - Ensures Healthcheck is returning 200 OK
Get Statistics - Ensures Statistics is returning 200 OK
CheckPDPGroupQuery - Checks that PDPGroupQuery contains the deployed policy
CheckPolicyDeployed - Checks that the Policy is Deployed
Undeploy Policy - Undeploy the Policy
Delete Policy - Deletes the Policy for the next loop
Check PDP Group for Deletion - Ensures the policy has been removed and does not exist
The following steps can be used to configure the parameters of the test plan
HTTP Authorization Manager - used to store user/password authentication details.
HTTP Header Manager - used to store headers which will be used for making HTTP requests.
User Defined Variables - used to store the following parameters
PAP_HOST | IP Address or host name of PAP component | NA |
API_HOST | IP Address or host name of Policy API component | NA |
PAP_PORT | Port of PAP service | 7000 |
API_PORT | Port of Policy API service | 6969 |
TESTCSARLOCATION | Directory containing the test csar | NA |
DURATION | Length of Test in Seconds | 259200 |
Running the Test Plan
Copy the Test Plans folder onto VM2
Edit the /tmp/ folder permissions to allow the Testplan to insert the CSAR into the /tmp/policydistribution/distributionmount/ folder
From the apache jMeter folder run the test, pointing it towards the stabiltiy.jmx file inside the testplans folder