Allow checkstyle to avoid auto snapshot update
[policy/parent.git] / docs / development / devtools / testing / s3p / xacml-s3p.rst
1 .. This work is licensed under a
2 .. Creative Commons Attribution 4.0 International License.
3 .. http://creativecommons.org/licenses/by/4.0
4
5 .. _xacml-s3p-label:
6
7 .. toctree::
8    :maxdepth: 2
9
10 ##########################
11
12 Policy XACML PDP S3P Tests
13 ~~~~~~~~~~~~~~~~~~~~~~~~~~
14
15 Both the Performance and the Stability tests were executed by performing requests
16 against Policy components installed in Kubernetes environment. These tests were all
17 performed on a Ubuntu VM with 32GB of memory, 16 CPU and 100GB of disk space.
18
19 Policy XACML PDP Deployment
20 +++++++++++++++++++++++++++
21
22 In an effort to allow the execution of the s3p tests to be as close to automatic as possible,
23 a script will be executed that will perform the following:
24
25 - Install of a microk8s kubernetes environment
26 - Bring up the policy components
27 - Checks that the components are successfully up and running before proceeding
28 - Install Java 17
29 - Install Jmeter locally and configure it
30 - Specify whether you want to run stability or performance tests
31
32
33 The remainder of this document outlines how to run the tests and the test results
34
35 Common Setup
36 ++++++++++++
37 The common setup for performance and stability tests is now automated - being carried out by a script in- **testsuites/run-s3p-test.sh**.
38
39 Clone the policy-xacml-pdp repo to access the test scripts
40
41 .. code-block:: bash
42
43     git clone https://gerrit.onap.org/r/policy/xacml-pdp xacml-pdp
44
45 Stability Test of Policy XACML PDP
46 ++++++++++++++++++++++++++++++++++
47
48 Test Plan
49 ---------
50 The 24 hours stability test ran the following steps.
51
52 - Healthcheck, 2 simultaneous threads
53 - Decisions, 2 simultaneous threads, each running the following tasks in sequence:
54    - Monitoring Decision
55    - Monitoring Decision, abbreviated
56    - Naming Decision
57    - Optimization Decision
58    - Default Guard Decision (always "Permit")
59    - Frequency Limiter Guard Decision
60    - Min/Max Guard Decision
61
62 This runs for 24 hours. Test results are present in the **testsuites/automated-performance/s3pTestResults.jtl**
63 file and in **/tmp/** directory. Logs are present for jmeter in **testsuites/automated-performance/jmeter.log** and
64 **testsuites/automated-performance/nohup.out**
65
66 Run Test
67 --------
68
69 The code in the setup section also serves to run the tests. Just one execution needed to do it all.
70
71 .. code-block:: bash
72
73     bash run-s3p-test.sh run stability
74
75 Once the test execution is completed, the results are present in the **automate-performance/s3pTestResults.jtl** file.
76
77 This file can be imported into the Jmeter GUI for visualization. The below results are tabulated from the GUI.
78
79 Test Results
80 ------------
81
82 **Summary**
83
84 Stability test plan was triggered for 24 hours.
85
86 **Test Statistics**
87
88 =======================  =================  ========================  =========================
89 **Total # of requests**  **Error %**        **Average Latency (ms)**  **Measured requests/sec**
90 =======================  =================  ========================  =========================
91   54472562                 0.00 %             5 ms                      630.1 ms
92 =======================  =================  ========================  =========================
93
94 **JMeter Results**
95
96 .. image:: xacml-s3p-results/s3p-stability-xacml.png
97
98 **Policy component Setup**
99
100 ==============================================  ====================================================================  =============================================
101 **NAME**                                        **IMAGE**                                                             **PORT**
102 ==============================================  ====================================================================  =============================================
103 zookeeper-deployment-7ff87c7fcc-fbsfb           confluentinc/cp-zookeeper:latest                                      2181/TCP
104 kafka-deployment-5c87d497b-m8s2g                    confluentinc/cp-kafka:latest                                          9092/TCP
105 policy-drools-pdp-0                                 nexus3.onap.org:10001/onap/policy-pdpd-cl:2.1.3-SNAPSHOT              6969/TCP 9696/TCP
106 policy-apex-pdp-0                                   nexus3.onap.org:10001/onap/policy-apex-pdp:3.1.3-SNAPSHOT             6969/TCP
107 policy-distribution-f48bff778-48pm2                 nexus3.onap.org:10001/onap/policy-distribution:3.1.3-SNAPSHOT         6969/TCP
108 policy-models-simulator-6947667bdc-wcd9r        nexus3.onap.org:10001/onap/policy-models-simulator:3.1.3-SNAPSHOT     6666/TCP 6680/TCP 6668/TCP 6669/TCP 6670/TCP
109 policy-clamp-ac-http-ppnt-7d747b5d98-wmr5n      nexus3.onap.org:10001/onap/policy-clamp-ac-http-ppnt:7.1.3-SNAPSHOT   8084/TCP
110 policy-clamp-ac-k8s-ppnt-6bbd86bbc6-vnvx6       nexus3.onap.org:10001/onap/policy-clamp-ac-k8s-ppnt:7.1.3-SNAPSHOT    8083/TCP
111 policy-clamp-ac-pf-ppnt-5fcbbcdb6c-k2cbk        nexus3.onap.org:10001/onap/policy-clamp-ac-pf-ppnt:7.1.3-SNAPSHOT     6969/TCP
112 policy-clamp-ac-sim-ppnt-97f487577-m2zjr        nexus3.onap.org:10001/onap/policy-clamp-ac-sim-ppnt:7.1.3-SNAPSHOT    6969/TCP
113 policy-clamp-runtime-acm-66b5d6b64-l6dpq        nexus3.onap.org:10001/onap/policy-clamp-runtime-acm:7.1.3-SNAPSHOT    6969/TCP
114 mariadb-galera-0                                docker.io/bitnami/mariadb-galera:10.5.8                               3306/TCP
115 prometheus-f66f97b6-kkmpq                       nexus3.onap.org:10001/prom/prometheus:latest                          9090/TCP
116 policy-api-7f7d995b4-2zhnw                      nexus3.onap.org:10001/onap/policy-api:3.1.3-SNAPSHOT                  6969/TCP
117 policy-pap-f7899d4cd-mfrtp                      nexus3.onap.org:10001/onap/policy-pap:3.1.3-SNAPSHOT                  6969/TCP
118 policy-xacml-pdp-6c86f85ff6-6qzgf               nexus3.onap.org:10001/onap/policy-xacml-pdp:3.1.2                     6969/TCP
119 ==============================================  ====================================================================  =============================================
120
121 .. Note::
122
123               .. container:: paragraph
124
125                   There were no failures during the 24 hours test.
126
127 The XACML PDP offered very good performance with JMeter for the traffic mix described above.
128 The average transaction time is insignificant.
129
130
131 Performance Test of Policy XACML PDP
132 ++++++++++++++++++++++++++++++++++++
133
134 Introduction
135 ------------
136
137 Performance test of acm components 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.
138
139 Setup Details
140 -------------
141
142 We can setup the environment and execute the tests like this from the **xacml-pdp/testsuites** directory
143
144 Test Plan
145 ---------
146
147 Performance test plan is the same as the stability test plan above except for the few differences listed below.
148
149 - Increase the number of threads up to 10 (simulating 10 users' behaviours at the same time).
150 - Reduce the test time to 20 minutes.
151
152 The performance tests runs the following, all in parallel:
153
154 - Healthcheck, 10 simultaneous threads
155 - Decisions, 10 simultaneous threads, each running the following in sequence:
156
157    - Monitoring Decision
158    - Monitoring Decision, abbreviated
159    - Naming Decision
160    - Optimization Decision
161    - Default Guard Decision (always "Permit")
162    - Frequency Limiter Guard Decision
163    - Min/Max Guard Decision
164
165 When the script starts up, it uses policy-api to create, and policy-pap to deploy
166 the policies that are needed by the test.  It assumes that the "naming" policy has
167 already been created and deployed.  Once the test completes, it undeploys and deletes
168 the policies that it previously created.
169
170 Run Test
171 --------
172
173 The code in the setup section also serves to run the tests. Just one execution needed to do it all.
174
175 .. code-block:: bash
176
177     bash run-s3p-test.sh run performance
178
179 Once the test execution is completed, the results are present in the **automate-performance/s3pTestResults.jtl** file and in **/tmp/** directory.
180
181 This file can be imported into the Jmeter GUI for visualization. The below results are tabulated from the GUI.
182
183 Test Results
184 ------------
185
186 **Summary**
187
188 The test was run for 20 minutes with 10 users (i.e., threads), with the following results:
189
190 **Test Statistics**
191
192 =======================  =================  ========================  =========================
193 **Total # of requests**  **Error %**        **Average Latency (ms)**  **Measured requests/sec**
194 =======================  =================  ========================  =========================
195   888047                   0.00 %             25 ms                     723.2 ms
196 =======================  =================  ========================  =========================
197
198 .. image:: xacml-s3p-results/s3p-perf-xacml.png