Allow checkstyle to avoid auto snapshot update
[policy/parent.git] / docs / development / devtools / testing / s3p / clamp-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 .. _acm-s3p-label:
6
7 .. toctree::
8    :maxdepth: 2
9
10 Policy Clamp Automation Composition
11 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12
13 Both the Performance and the Stability tests were executed by performing requests
14 against acm components installed as docker images in local environment. These tests we all
15 performed on a Ubuntu VM with 32GB of memory, 16 CPU and 50GB of disk space.
16
17
18 ACM Deployment
19 ++++++++++++++
20
21 In an effort to allow the execution of the s3p tests to be as close to automatic as possible,
22 a script will be executed that will perform the following:
23
24 - Install of a microk8s kubernetes environment
25 - Bring up the policy components
26 - Checks that the components are successfully up and running before proceeding
27 - Install Java 17
28 - Install Jmeter locally and configure it
29 - Specify whether you want to run stability or performance tests
30
31
32 The remainder of this document outlines how to run the tests and the test results
33
34 Common Setup
35 ++++++++++++
36 The common setup for performance and stability tests is now automated - being carried out by a script in- **testsuites/run-s3p-test.sh**.
37
38 Clone the policy-clamp repo to access the test scripts
39
40 .. code-block:: sh
41
42     git clone https://gerrit.onap.org/r/policy/clamp
43
44 Stability Test of acm components
45 ++++++++++++++++++++++++++++++++
46
47 Test Plan
48 ---------
49 The 72 hours stability test ran the following steps sequentially in a single threaded loop.
50
51 - **Commission Automation Composition Definitions** - Commissions the ACM Definitions
52 - **Register Participants** - Registers the presence of participants in the acm database
53 - **Prime AC definition** - Primes the AC Definition to the participants
54 - **Instantiate acm** - Instantiate the acm instance
55 - **DEPLOY the ACM instance** - change the state of the acm to DEPLOYED
56 - **Check instance state** - check the current state of instance and that it is DEPLOYED
57 - **UNDEPLOY the ACM instance** - change the state of the ACM to UNDEPLOYED
58 - **Check instance state** - check the current state of instance and that it is UNDEPLOYED
59 - **Delete instance** - delete the instance from all participants and ACM db
60 - **DEPRIME ACM definitions** - DEPRIME ACM definitions from participants
61 - **Delete ACM Definition** - delete the ACM definition on runtime
62
63 This runs for 72 hours. Test results are present in the **testsuites/automated-performance/s3pTestResults.jtl**
64 directory. Logs are present for jmeter in **testsuites/automated-performance/jmeter.log** and
65 **testsuites/automated-performance/nohup.out**
66
67 Run Test
68 --------
69
70 The code in the setup section also serves to run the tests. Just one execution needed to do it all.
71
72 .. code-block:: sh
73
74     ./run-s3p-test.sh run stability
75
76 Once the test execution is completed, the results are present in the **automate-performance/s3pTestResults.jtl** file.
77
78 This file can be imported into the Jmeter GUI for visualization. The below results are tabulated from the GUI.
79
80 Test Results
81 ------------
82
83 **Summary**
84
85 Stability test plan was triggered for 72 hours.
86
87 **Test Statistics**
88
89 =======================  =================  ==================  ==================================
90 **Total # of requests**  **Success %**      **Error %**         **Average time taken per request**
91 =======================  =================  ==================  ==================================
92 261852                    100.00 %           0.00 %              387.126 ms
93 =======================  =================  ==================  ==================================
94
95 **ACM component Setup**
96
97 ==============================================  ==================================================================  ====================
98 **NAME**                                        **IMAGE**                                                            **PORT**
99 ==============================================  ==================================================================  ====================
100  zookeeper-deployment-7ff87c7fcc-ptkwv          confluentinc/cp-zookeeper:latest                                     2181/TCP
101  kafka-deployment-5c87d497b-2jv27               confluentinc/cp-kafka:latest                                         9092/TCP
102  policy-models-simulator-6947667bdc-v4czs       nexus3.onap.org:10001/onap/policy-models-simulator:latest            3904:30904/TCP
103  prometheus-f66f97b6-rknvp                      nexus3.onap.org:10001/prom/prometheus:latest                         9090:30909/TCP
104  mariadb-galera-0                               nexus3.onap.org:10001/bitnami/mariadb-galera:10.5.8                  3306/TCP
105  policy-apex-pdp-0                              nexus3.onap.org:10001/onap/policy-apex-pdp:3.1.3-SNAPSHOT            6969:30001/TCP
106  policy-clamp-ac-http-ppnt-7d747b5d98-4phjf     nexus3.onap.org:10001/onap/policy-clamp-ac-http-ppnt7.1.3-SNAPSHOT   8084/TCP
107  policy-clamp-ac-sim-ppnt-97f487577-4p7ks       nexus3.onap.org:10001/onap/policy-clamp-ac-sim-ppnt7.1.3-SNAPSHOT    6969/TCP
108  policy-clamp-ac-k8s-ppnt-6bbd86bbc6-csknn      nexus3.onap.org:10001/onap/policy-clamp-ac-k8s-ppnt7.1.3-SNAPSHOT    8083:30443/TCP
109  policy-clamp-ac-pf-ppnt-5fcbbcdb6c-twkxw       nexus3.onap.org:10001/onap/policy-clamp-ac-pf-ppnt7.1.3-SNAPSHOT     6969:30008/TCP
110  policy-clamp-runtime-acm-66b5d6b64-4gnth       nexus3.onap.org:10001/onap/policy-clamp-runtime-acm7.1.3-SNAPSHOT    6969:30007/TCP
111  policy-pap-f7899d4cd-7m898                     nexus3.onap.org:10001/onap/policy-pap:3.1.3-SNAPSHOT                 6969:30003/TCP
112  policy-api-7f7d995b4-ckb84                     nexus3.onap.org:10001/onap/policy-api:3.1.3-SNAPSHOT                 6969:30002/TCP
113 ==============================================  ==================================================================  ====================
114
115
116
117 .. Note::
118
119               .. container:: paragraph
120
121                   There were no failures during the 72 hours test.
122
123 **JMeter Screenshot**
124
125 .. image:: clamp-s3p-results/acm_stability_jmeter.png
126
127 **JMeter Screenshot**
128
129 .. image:: clamp-s3p-results/acm_stability_table.png
130
131
132 Performance Test of acm components
133 ++++++++++++++++++++++++++++++++++
134
135 Introduction
136 ------------
137
138 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.
139
140 Setup Details
141 -------------
142
143 We can setup the environment and execute the tests like this from the **clamp/testsuites** directory
144
145 .. code-block:: sh
146
147     ./run-s3p-test.sh run performance
148
149 Test results are present in the **testsuites/automate-performance/s3pTestResults.jtl**
150 directory. Logs are present for jmeter in **testsuites/automate-performance/jmeter.log** and
151 **testsuites/automated-performance/nohup.out**
152
153 Test Plan
154 ---------
155
156 The Performance test ran the following steps sequentially by 5 threaded users. Any user will create 100 compositions/instances.
157
158 - **SetUp** - SetUp Thread Group
159    - **Register Participants** - Registers the presence of participants in the acm database
160 - **AutomationComposition Test Flow** - flow by 5 threaded users.
161    - **Creation and Deploy** - Creates 100 Compositions and Instances
162       - **Commission Automation Composition Definitions** - Commissions the ACM Definitions
163       - **Prime AC definition** - Primes the AC Definition to the participants
164       - **Instantiate acm** - Instantiate the acm instance
165       - **DEPLOY the ACM instance** - change the state of the acm to DEPLOYED
166       - **Check instance state** - check the current state of instance and that it is DEPLOYED
167    - **Get participants** - fetch all participants
168    - **Get compositions** - fetch all compositions
169    - **Undeploy and Delete** - Deletes instances and Compositions created before
170       - **UNDEPLOY the ACM instance** - change the state of the ACM to UNDEPLOYED
171       - **Check instance state** - check the current state of instance and that it is UNDEPLOYED
172       - **Delete instance** - delete the instance from all participants and ACM db
173       - **DEPRIME ACM definitions** - DEPRIME ACM definitions from participants
174       - **Delete ACM Definition** - delete the ACM definition on runtime
175
176 Run Test
177 --------
178
179 The code in the setup section also serves to run the tests. Just one execution needed to do it all.
180
181 .. code-block:: sh
182
183     ./run-s3p-test.sh run performance
184
185 Once the test execution is completed, the results are present in the **automate-performance/s3pTestResults.jtl** file.
186
187 This file can be imported into the Jmeter GUI for visualization. The below results are tabulated from the Jmeter GUI.
188
189 Test Results
190 ------------
191
192 Test results are shown as below.
193
194 **Test Statistics**
195
196 =======================  =================  ==================  ==================================
197 **Total # of requests**  **Success %**      **Error %**         **Average time taken per request**
198 =======================  =================  ==================  ==================================
199 8624                     100 %              0.00 %              1296.8 ms
200 =======================  =================  ==================  ==================================
201
202 **ACM component Setup**
203
204 ==============================================  ==================================================================  ====================
205 **NAME**                                        **IMAGE**                                                            **PORT**
206 ==============================================  ==================================================================  ====================
207  zookeeper-deployment-7ff87c7fcc-5svgw          confluentinc/cp-zookeeper:latest                                     2181/TCP
208  kafka-deployment-5c87d497b-hmbhc               confluentinc/cp-kafka:latest                                         9092/TCP
209  policy-models-simulator-6947667bdc-crcwq       nexus3.onap.org:10001/onap/policy-models-simulator:latest            3904:30904/TCP
210  prometheus-f66f97b6-24dvx                      nexus3.onap.org:10001/prom/prometheus:latest                         9090:30909/TCP
211  mariadb-galera-0                               nexus3.onap.org:10001/bitnami/mariadb-galera:10.5.8                  3306/TCP
212  policy-apex-pdp-0                              nexus3.onap.org:10001/onap/policy-apex-pdp:3.1.3-SNAPSHOT            6969:30001/TCP
213  policy-clamp-ac-sim-ppnt-97f487577-pn56t       nexus3.onap.org:10001/onap/policy-clamp-ac-sim-ppnt7.1.3-SNAPSHOT    6969/TCP
214  policy-clamp-ac-http-ppnt-7d747b5d98-qjjlv     nexus3.onap.org:10001/onap/policy-clamp-ac-http-ppnt7.1.3-SNAPSHOT   8084/TCP
215  policy-clamp-ac-k8s-ppnt-6bbd86bbc6-ffbz2      nexus3.onap.org:10001/onap/policy-clamp-ac-k8s-ppnt7.1.3-SNAPSHOT    8083:30443/TCP
216  policy-clamp-ac-pf-ppnt-5fcbbcdb6c-vmsnv       nexus3.onap.org:10001/onap/policy-clamp-ac-pf-ppnt7.1.3-SNAPSHOT     6969:30008/TCP
217  policy-clamp-runtime-acm-66b5d6b64-6vjl5       nexus3.onap.org:10001/onap/policy-clamp-runtime-acm7.1.3-SNAPSHOT    6969:30007/TCP
218  policy-pap-f7899d4cd-8sjk9                     nexus3.onap.org:10001/onap/policy-pap:3.1.3-SNAPSHOT                 6969:30003/TCP
219  policy-api-7f7d995b4-dktdw                     nexus3.onap.org:10001/onap/policy-api:3.1.3-SNAPSHOT                 6969:30002/TCP
220 ==============================================  ==================================================================  ====================
221
222 **JMeter Screenshot**
223
224 .. image:: clamp-s3p-results/acm_performance_jmeter.png