blob: 2002327f5541076bec16825013b007e66492ec8d [file] [log] [blame]
Pamela Dragoshba45dc62020-04-16 09:27:44 -04001.. This work is licensed under a
2.. Creative Commons Attribution 4.0 International License.
3.. http://creativecommons.org/licenses/by/4.0
4
5.. _pap-s3p-label:
6
7.. toctree::
8 :maxdepth: 2
9
10Policy PAP component
11~~~~~~~~~~~~~~~~~~~~
12
1372 Hours Stability Test of PAP
14++++++++++++++++++++++++++++++
15
16Introduction
17------------
18
19The 72 hour Stability Test for PAP has the goal of introducing a steady flow of transactions initiated from a test client server running JMeter for the duration of 72 hours.
20
21Setup details
22-------------
23
24The stability test is performed on VM's running in OpenStack cloud environment.
25
26There are 2 seperate VM's, one for running PAP & other one for running JMeter to simulate steady flow of transactions.
27
28All the dependencies like mariadb, dmaap simulator, pdp simulator & policy/api component are installed in the VM having JMeter.
29
30For simplicity lets assume
31
32VM1 will be running JMeter, MariaDB, DMaaP simulator, PDP simulator & API component.
33
34VM2 will be running only PAP component.
35
36**OpenStack environment details**
37
38Version: Mitaka
39
40**PAP VM details (VM2)**
41
42OS:Ubuntu 16.04 LTS
43
44CPU: 4 core
45
46RAM: 4 GB
47
48HardDisk: 40 GB
49
aditya.puthuparambil4bccfbc2020-05-06 11:18:25 +010050Docker version 19.03.8
Pamela Dragoshba45dc62020-04-16 09:27:44 -040051
aditya.puthuparambil4bccfbc2020-05-06 11:18:25 +010052Java: openjdk version "11.0.7" 2020-04-14
Pamela Dragoshba45dc62020-04-16 09:27:44 -040053
54**JMeter VM details (VM1)**
55
56OS: Ubuntu 16.04 LTS
57
58CPU: 4 core
59
60RAM: 4 GB
61
62HardDisk: 40 GB
63
64Docker Version: 18.09.6
65
aditya.puthuparambil4bccfbc2020-05-06 11:18:25 +010066Java: openjdk version "11.0.7" 2020-04-14
Pamela Dragoshba45dc62020-04-16 09:27:44 -040067
aditya.puthuparambil4bccfbc2020-05-06 11:18:25 +010068JMeter: 5.2.1
Pamela Dragoshba45dc62020-04-16 09:27:44 -040069
70Install Docker in VM1 & VM2
71---------------------------
72
73Make sure to execute below commands in VM1 & VM2 both.
74
75Make the etc/hosts entries
76
77.. code-block:: bash
78
79 $ echo $(hostname -I | cut -d\ -f1) $(hostname) | sudo tee -a /etc/hosts
aditya.puthuparambil4bccfbc2020-05-06 11:18:25 +010080
Pamela Dragoshba45dc62020-04-16 09:27:44 -040081Make the DNS entries
82
83.. code-block:: bash
84
85 $ echo "nameserver <PrimaryDNSIPIP>" >> /etc/resolvconf/resolv.conf.d/head
86 $ echo "nameserver <SecondaryDNSIP>" >> /etc/resolvconf/resolv.conf.d/head
87 $ resolvconf -u
aditya.puthuparambil4bccfbc2020-05-06 11:18:25 +010088
Pamela Dragoshba45dc62020-04-16 09:27:44 -040089Update the ubuntu software installer
90
91.. code-block:: bash
92
93 $ apt-get update
aditya.puthuparambil4bccfbc2020-05-06 11:18:25 +010094
Pamela Dragoshba45dc62020-04-16 09:27:44 -040095Check and Install Java
96
97.. code-block:: bash
98
aditya.puthuparambil4bccfbc2020-05-06 11:18:25 +010099 $ apt-get install -y openjdk-11-jdk
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400100 $ java -version
101
102Ensure that the Java version that is executing is OpenJDK version 8
103
104
105Check and install docker
106
107.. code-block:: bash
108
109 $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
110 $ add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
111 $ apt-get update
112 $ apt-cache policy docker-ce
113 $ apt-get install -y docker-ce
114 $ systemctl status docker
115 $ docker ps
116
117Change the permissions of the Docker socket file
118
119.. code-block:: bash
120
121 $ chmod 777 /var/run/docker.sock
122
123Check the status of the Docker service and ensure it is running correctly
124
125.. code-block:: bash
126
127 $ service docker status
128 $ docker ps
129
130Install JMeter in VM1
131---------------------
132
133Download & install JMeter
134
135.. code-block:: bash
136
137 $ mkdir jMeter
138 $ cd jMeter
aditya.puthuparambil4bccfbc2020-05-06 11:18:25 +0100139 $ wget http://mirrors.whoishostingthis.com/apache//jmeter/binaries/apache-jmeter-5.2.1.zip
140 $ unzip apache-jmeter-5.2.1.zip
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400141
142Run JMeter
143
144.. code-block:: bash
145
aditya.puthuparambil4bccfbc2020-05-06 11:18:25 +0100146 $ /home/ubuntu/jMeter/apache-jmeter-5.2.1/bin/jmeter
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400147
aditya.puthuparambil4bccfbc2020-05-06 11:18:25 +0100148The above command will load the JMeter UI. Then navigate to File Open Browse and select the test plan jmx file to open.
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400149The jmx file is present in the policy/pap git repository.
150
151Install simulators in VM1
152-------------------------
153
154For installing simulator, there is a script placed at `install simulator script <https://gerrit.onap.org/r/gitweb?p=policy/pap.git;a=blob;f=testsuites/stability/src/main/resources/simulatorsetup/setup_components.sh;h=86de3c1efcb468431a2395eef610db209a613fc3;hb=refs/heads/master>`_
155
156Copy the script & all related files in virtual machine and run it.
157
158After installation make sure that following 4 docker containers are up and running.
159
160.. code-block:: bash
161
162 root@policytest-policytest-3-p5djn6as2477:/home/ubuntu/simulator# docker ps
163 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
164 887efa8dac12 nexus3.onap.org:10001/onap/policy-api "bash ./policy-api.sh" 6 days ago Up 6 days 0.0.0.0:6969->6969/tcp policy-api
165 0a931c0a63ac pdp/simulator:latest "bash pdp-sim.sh" 6 days ago Up 6 days pdp-simulator
166 a41adcb32afb dmaap/simulator:latest "bash dmaap-sim.sh" 6 days ago Up 6 days 0.0.0.0:3904->3904/tcp dmaap-simulator
167 d52d6b750ba0 mariadb:10.2.14 "docker-entrypoint.s…" 6 days ago Up 6 days 0.0.0.0:3306->3306/tcp mariadb
168
169Install PAP in VM2
170------------------
171
172For installing PAP, there is a script placed at `install pap script <https://gerrit.onap.org/r/gitweb?p=policy/pap.git;a=blob;f=testsuites/stability/src/main/resources/papsetup/setup_pap.sh;h=dc5e69e76da9f48f6b23cc012e14148f1373d1e1;hb=refs/heads/master>`_
173
174Copy the script & all related files in virtual machine and run it.
175
176After installation make sure that following docker container is up and running.
177
178.. code-block:: bash
179
180 root@policytest-policytest-0-uc3y2h5x6p4j:/home/ubuntu/pap# docker ps
181 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
aditya.puthuparambil4bccfbc2020-05-06 11:18:25 +0100182 42ac0ed4b713 nexus3.onap.org:10001/onap/policy-pap:2.2.3-SNAPSHOT "bash ./policy-pap.sh" 3 days ago Up 3 days 0.0.0.0:6969->6969/tcp, 0.0.0.0:9090->9090/tcp policy-pap
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400183
184Install & configure visualVM in VM2
185-----------------------------------
186
187visualVM needs to be installed in the virtual machine having PAP. It will be used to monitor CPU, Memory, GC for PAP while stability test is running.
188
189Install visualVM
190
191.. code-block:: bash
192
193 $ sudo apt-get install visualvm
aditya.puthuparambil4bccfbc2020-05-06 11:18:25 +0100194
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400195Run few commands to configure permissions
196
197.. code-block:: bash
198
aditya.puthuparambil4bccfbc2020-05-06 11:18:25 +0100199 $ cd /usr/lib/jvm/java-11-openjdk-amd64/bin/
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400200 $ sudo touch visualvm.policy
201 $ sudo chmod 777 visualvm.policy
aditya.puthuparambil4bccfbc2020-05-06 11:18:25 +0100202
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400203 $ vi visualvm.policy
aditya.puthuparambil4bccfbc2020-05-06 11:18:25 +0100204
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400205 Add the following in visualvm.policy
aditya.puthuparambil4bccfbc2020-05-06 11:18:25 +0100206
207
208 grant codebase "file:/usr/lib/jvm/java-11-openjdk-amd64/lib/tools.jar" {
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400209 permission java.security.AllPermission;
210 };
211
212Run following commands to start jstatd using port 1111
213
214.. code-block:: bash
215
aditya.puthuparambil4bccfbc2020-05-06 11:18:25 +0100216 $ cd /usr/lib/jvm/java-11-openjdk-amd64/bin/
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400217 $ ./jstatd -p 1111 -J-Djava.security.policy=visualvm.policy &
aditya.puthuparambil4bccfbc2020-05-06 11:18:25 +0100218
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400219Run visualVM locally to connect to remote VM2
220
221.. code-block:: bash
222
223 # On your windows machine or your linux box locally, launch visualVM
aditya.puthuparambil4bccfbc2020-05-06 11:18:25 +0100224 $ nohup visualvm
225
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400226Connect to jstatd & remote apex-pdp JVM
227
228 1. Right click on "Remote" in the left panel of the screen and select "Add Remote Host..."
229 2. Enter the IP address of VM2.
230 3. Right click on IP address, select "Add JMX Connection..."
231 4. Enter the VM2 IP Address (from step 2) <IP address>:9090 ( for example -10.12.6.201:9090) and click OK.
232 5. Double click on the newly added nodes under "Remote" to start monitoring CPU, Memory & GC.
233
234Sample Screenshot of visualVM
235
236.. image:: images/pap-s3p-vvm-sample.png
237
238Test Plan
239---------
240
241The 72 hours stability test will run the following steps sequentially in a single threaded loop.
242
243- **Create Policy Type** - creates an operational policy type using policy/api component
aditya.puthuparambil4bccfbc2020-05-06 11:18:25 +0100244- **Create Policy defaultDomain** - creates an operational policy using the policy type created in the above step using policy/api component
245- **Create Policy sampleDomain** - creates an operational policy using the policy type created in the above step using policy/api component
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400246- **Check Health** - checks the health status of pap
247- **Check Statistics** - checks the statistics of pap
aditya.puthuparambil4bccfbc2020-05-06 11:18:25 +0100248- **Change state to ACTIVE** - changes the state of defaultGroup PdpGroup to ACTIVE
249- **Check PdpGroup Query** - makes a PdpGroup query request and verifies that PdpGroup is in the ACTIVE state.
250- **Deploy defaultDomain Policy** - deploys the policy defaultDomain in the existing PdpGroup
251- **Create/Update PDP Group** - creates a new PDPGroup named sampleGroup.
252- **OS Process Sampler** - OS Process Sampler to start a new Pdp Instance
253- **Check PdpGroup Query** - makes a PdpGroup query request and verifies that 2 PdpGroups are in the ACTIVE state and defaultGroup has a policy deployed on it.
254- **Deployment Update sampleDomain** - deploys the policy sampleDomain in sampleGroup PdpGroup using pap api
255- **Check PdpGroup Query** - makes a PdpGroup query request and verifies that the defaultGroup has a policy defaultDomain deployed on it and sampleGroup has policy sampleDomain deployed on it.
256- **Check Deployed Policies** - checks for all the deployed policies using pap api.
257- **OS Process Sampler** - OS Process Sampler to stop the newly created Pdp Instance
258- **Undeploy Policy sampleDomain** - undeploys the policy sampleDomain from sampleGroup PdpGroup using pap api
259- **Undeploy Default Policy** - undeploys the policy defaultDomain from PdpGroup
260- **Change state to PASSIVE(sampleGroup)** - changes the state of sampleGroup PdpGroup to PASSIVE
261- **Delete PdpGroup SampleGroup** - delete the sampleGroup PdpGroup using pap api
262- **Change State to PASSIVE(defaultGroup)** - changes the state of defaultGroup PdpGroup to PASSIVE
263- **Check PdpGroup Query** - makes a PdpGroup query request and verifies that PdpGroup is in the PASSIVE state.
264- **Delete Policy defaultDomain** - deletes the operational policy defaultDomain using policy/api component
265- **Delete Policy sampleDomain** - deletes the operational policy sampleDomain using policy/api component
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400266- **Delete Policy Type** - deletes the operational policy type using policy/api component
267
268The following steps can be used to configure the parameters of test plan.
269
270- **HTTP Authorization Manager** - used to store user/password authentication details.
271- **HTTP Header Manager** - used to store headers which will be used for making HTTP requests.
272- **User Defined Variables** - used to store following user defined parameters.
273
aditya.puthuparambil4bccfbc2020-05-06 11:18:25 +0100274=========== ===================================================================
275 **Name** **Description**
276=========== ===================================================================
277 PAP_HOST IP Address or host name of PAP component
278 PAP_PORT Port number of PAP for making REST API calls
279 API_HOST IP Address or host name of API component
280 API_PORT Port number of API for making REST API calls
281 DIR Path where the pdp instance startup and stop script is placed
282 CONFIG_DIR Path where the pdp default Config file is placed
283=========== ===================================================================
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400284
285Screenshot of PAP stability test plan
286
287.. image:: images/pap-s3p-testplan.png
288
289Test Results
290------------
291
292**Summary**
293
294Stability test plan was triggered for 72 hours.
295
296**Test Statistics**
297
298======================= ================= ================== ==================================
299**Total # of requests** **Success %** **Error %** **Average time taken per request**
300======================= ================= ================== ==================================
301178208 100 % 0 % 76 ms
302======================= ================= ================== ==================================
303
304**VisualVM Screenshot**
305
306.. image:: images/pap-s3p-vvm-1.png
307.. image:: images/pap-s3p-vvm-2.png
308
309**JMeter Screenshot**
310
311.. image:: images/pap-s3p-jm-1.png
312.. image:: images/pap-s3p-jm-1.png
aditya.puthuparambil4bccfbc2020-05-06 11:18:25 +0100313
314Test Results Frankfurt release
315-------------------------------
316
317**Summary**
318
319Stability test plan was triggered for 72 hours.
320
321.. Note::
322
323 .. container:: paragraph
324
325 Test cases for starting and stopping the PDP Instance has been included in the
326 test plan. These test cases have resulted in a spike in the Average time taken per request.
327
328**Test Statistics**
329
330======================= ================= ================== ==================================
331**Total # of requests** **Success %** **Error %** **Average time taken per request**
332======================= ================= ================== ==================================
333 29423 100 % 0 % 948 ms
334======================= ================= ================== ==================================
335
336**VisualVM Screenshot**
337
338.. image:: images/pap-s3p-vvm-1_F.png
339.. image:: images/pap-s3p-vvm-2_F.png
340
341**JMeter Screenshot**
342
343.. image:: images/pap-s3p-jm-1_F.png
344.. image:: images/pap-s3p-jm-1_F.png
aditya.puthuparambil4750e512020-05-13 11:51:04 +0100345
346Performance Test of PAP
347++++++++++++++++++++++++
348
349Introduction
350------------
351
352Performance test of PAP has the goal of testing the min/avg/max processing time and rest call throughput for all the requests with multiple requests at the same time.
353
354Setup Details
355-------------
356
357The performance test is performed on a similar setup as Stability test. The JMeter VM will be sending a large number of REST requests to the PAP component and collecting the statistics.
358
359Test Plan
360---------
361
362Performance test plan is the same as the stability test plan above except for the few differences listed below.
363
364- Increase the number of threads up to 5 (simulating 5 users' behaviours at the same time).
365- Reduce the test time to 2 hours.
366- Usage of counters to create different groups by the 'Create/Update PDP Group' test case.
367- Usage of If-Controller for 'Deploy defaultDomain Policy' and 'Undeploy defaultDomain Policy' test cases to install and uninstall the Default policy only in one thread.
368- OS Process Sampler for starting and stopping the PDP Instance has been disabled in the performance test plan for a better performance check.
369
370Run Test
371--------
372
373Running/Triggering the performance test will be the same as the stability test. That is, launch JMeter pointing to corresponding *.jmx* test plan. The *API_HOST* , *API_PORT* , *PAP_HOST* , *PAP_PORT* are already set up in *.jmx*.
374
375Once the test execution is completed, execute the below script to get the statistics:
376
377.. code-block:: bash
378
379 $ cd /home/ubuntu/pap/testsuites/performance/src/main/resources/testplans
380 $ ./results.sh /home/ubuntu/pap_perf/resultTree.log
381
382Test Results
383------------
384
385Test results are shown as below. Overall, the test was running smoothly and successfully. We do see some minor failed transactions, especially in the 'Deploy' and 'Undeploy' Pap API in a multi-threaded fashion .
386
387**Test Statistics**
388
389======================= ================= ================== ================================== =======================
390**Total # of requests** **Success %** **Error %** **Average time taken per request** **Requests/sec**
391======================= ================= ================== ================================== =======================
392 25743 99.5 % 0.50 % 397 ms 5148
393======================= ================= ================== ================================== =======================
394
395**JMeter Screenshot**
396
397.. image:: images/pap-perf-jm-1_F.png
398.. image:: images/pap-perf-jm-2_F.png