Update S3P testing xacml PDP documentation
[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   63618103                 0.00 %             5 ms                      736.064 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 mariadb-galera-0                                docker.io/bitnami/mariadb-galera:10.5.8                               3306/TCP
104 policy-models-simulator-bcd494d87-cldfr         nexus3.onap.org:10001/onap/policy-models-simulator:3.0.2-SNAPSHOT     30904/TCP
105 policy-apex-pdp-0                               nexus3.onap.org:10001/onap/policy-apex-pdp:3.0.2-SNAPSHOT             30001/TCP
106 prometheus-f66f97b6-kpg5c                       nexus3.onap.org:10001/prom/prometheus:latest                          30909/TCP
107 policy-distribution-86777bdd78-95zjx            nexus3.onap.org:10001/onap/policy-distribution:3.0.2-SNAPSHOT         30006/TCP
108 policy-clamp-ac-http-ppnt-7b99cbfbf8-d5zjk      nexus3.onap.org:10001/onap/policy-clamp-ac-http-ppnt:7.0.3-SNAPSHOT
109 policy-clamp-ac-pf-ppnt-55c4cb99f4-pp699        nexus3.onap.org:10001/onap/policy-clamp-ac-pf-ppnt:7.0.3-SNAPSHOT     30008/TCP
110 policy-clamp-ac-k8s-ppnt-6d854cc8b6-nzlgh       nexus3.onap.org:10001/onap/policy-clamp-ac-k8s-ppnt:7.0.3-SNAPSHOT
111 policy-clamp-runtime-acm-5c6d8fbfb-zww5j        nexus3.onap.org:10001/onap/policy-clamp-runtime-acm:7.0.3-SNAPSHOT    30007/TCP
112 policy-pap-847d89997d-gljzh                     nexus3.onap.org:10001/onap/policy-pap:3.0.2-SNAPSHOT                  30003/TCP
113 policy-xacml-pdp-656d57d578-9h6fx               nexus3.onap.org:10001/onap/policy-xacml-pdp:3.0.2-SNAPSHOT            30004/TCP
114 policy-api-58cb45fc9b-9qcx6                     nexus3.onap.org:10001/onap/policy-api:3.0.2-SNAPSHOT                  30002/tcp
115 ==============================================  ====================================================================  ===========================================
116
117 .. Note::
118
119               .. container:: paragraph
120
121                   There were no failures during the 24 hours test.
122
123 The XACML PDP offered very good performance with JMeter for the traffic mix described above.
124 The average transaction time is insignificant.
125
126
127 Performance Test of Policy XACML PDP
128 ++++++++++++++++++++++++++++++++++++
129
130 Introduction
131 ------------
132
133 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.
134
135 Setup Details
136 -------------
137
138 We can setup the environment and execute the tests like this from the **xacml-pdp/testsuites** directory
139
140 Test Plan
141 ---------
142
143 Performance test plan is the same as the stability test plan above except for the few differences listed below.
144
145 - Increase the number of threads up to 10 (simulating 10 users' behaviours at the same time).
146 - Reduce the test time to 20 minutes.
147
148 The performance tests runs the following, all in parallel:
149
150 - Healthcheck, 10 simultaneous threads
151 - Decisions, 10 simultaneous threads, each running the following in sequence:
152
153    - Monitoring Decision
154    - Monitoring Decision, abbreviated
155    - Naming Decision
156    - Optimization Decision
157    - Default Guard Decision (always "Permit")
158    - Frequency Limiter Guard Decision
159    - Min/Max Guard Decision
160
161 When the script starts up, it uses policy-api to create, and policy-pap to deploy
162 the policies that are needed by the test.  It assumes that the "naming" policy has
163 already been created and deployed.  Once the test completes, it undeploys and deletes
164 the policies that it previously created.
165
166 Run Test
167 --------
168
169 The code in the setup section also serves to run the tests. Just one execution needed to do it all.
170
171 .. code-block:: bash
172
173     bash run-s3p-test.sh run performance
174
175 Once the test execution is completed, the results are present in the **automate-performance/s3pTestResults.jtl** file and in **/tmp/** directory.
176
177 This file can be imported into the Jmeter GUI for visualization. The below results are tabulated from the GUI.
178
179 Test Results
180 ------------
181
182 **Summary**
183
184 The test was run for 20 minutes with 10 users (i.e., threads), with the following results:
185
186 **Test Statistics**
187
188 =======================  =================  ========================  =========================
189 **Total # of requests**  **Error %**        **Average Latency (ms)**  **Measured requests/sec**
190 =======================  =================  ========================  =========================
191   912141                   0.00 %             25.5666 ms                741.917 ms
192 =======================  =================  ========================  =========================
193
194 .. image:: xacml-s3p-results/s3p-perf-xacml.png