Update docs for clamp s3ps
[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:: bash
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:: bash
73
74     bash 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 260590                    100.00 %           0.00 %              997 ms
93 =======================  =================  ==================  ==================================
94
95 **ACM component Setup**
96
97 ==============================================  ============================================================    ===========================================
98 **NAME**                                        **IMAGE**                                                       **PORT**
99 ==============================================  ============================================================    ===========================================
100  policy-clamp-runtime-acm-5c6d8fbfb-jz8rb       nexus3.onap.org:10001/onap/policy-clamp-runtime-acm:latest      30007/tcp
101  policy-clamp-ac-pf-ppnt-55c4cb99f4-spvng       nexus3.onap.org:10001/onap/policy-clamp-ac-pf-ppnt:latest       30008/tcp
102  policy-api-58cb45fc9b-ff5md                    nexus3.onap.org:10001/onap/policy-api:latest                    30002/tcp
103  policy-clamp-ac-http-ppnt-7b99cbfbf8-d4w9v     nexus3.onap.org:10001/onap/policy-clamp-ac-http-ppnt:latest     30009/tcp
104  policy-clamp-ac-k8s-ppnt-6d854cc8b6-twdkh      nexus3.onap.org:10001/onap/policy-clamp-ac-k8s-ppnt:latest      30010/tcp
105  policy-models-simulator-bcd494d87-bfg6g        nexus3.onap.org:10001/onap/policy-models-simulator:latest       30904/tcp
106  mariadb-galera-0                               nexus3.onap.org:10001/mariadb:10.5.8                            3306/tcp
107  policy-pap-847d89997d-x9h99                    nexus3.onap.org:10001/onap/policy-pap:latest                    30003/tcp
108  policy-apex-pdp-0                              nexus3.onap.org:10001/onap/policy-apex-pdp:latest               6969/tcp
109 ==============================================  ============================================================    ===========================================
110
111
112
113 .. Note::
114
115               .. container:: paragraph
116
117                   There were no failures during the 72 hours test.
118
119 **JMeter Screenshot**
120
121 .. image:: clamp-s3p-results/acm_stability_jmeter.png
122
123 **JMeter Screenshot**
124
125 .. image:: clamp-s3p-results/acm_stability_table.png
126
127 **Memory and CPU usage**
128
129 The memory and CPU usage can be monitored by running "docker stats" command.
130
131 Memory and CPU usage after test execution:
132
133 .. image:: clamp-s3p-results/Stability_after_stats.png
134
135
136 Performance Test of acm components
137 ++++++++++++++++++++++++++++++++++
138
139 Introduction
140 ------------
141
142 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.
143
144 Setup Details
145 -------------
146
147 We can setup the environment and execute the tests like this from the **clamp/testsuites** directory
148
149 .. code-block:: bash
150
151     bash run-s3p-test.sh run performance
152
153 This runs for 2 hours. Test results are present in the **testsuites/automate-performance/s3pTestResults.jtl**
154 directory. Logs are present for jmeter in **testsuites/automate-performance/jmeter.log** and
155 **testsuites/automated-performance/nohup.out**
156
157 Test Plan
158 ---------
159
160 Performance test plan is the same as the stability test plan above except for the few differences listed below.
161
162 - Increase the number of threads up to 5 (simulating 5 users' behaviours at the same time).
163 - Reduce the test time to 2 hours.
164
165 Run Test
166 --------
167
168 The code in the setup section also serves to run the tests. Just one execution needed to do it all.
169
170 .. code-block:: bash
171
172     bash run-s3p-test.sh run performance
173
174 Once the test execution is completed, the results are present in the **automate-performance/s3pTestResults.jtl** file.
175
176 This file can be imported into the Jmeter GUI for visualization. The below results are tabulated from the Jmeter GUI.
177
178 Test Results
179 ------------
180
181 Test results are shown as below.
182
183 **Test Statistics**
184
185 =======================  =================  ==================  ==================================
186 **Total # of requests**  **Success %**      **Error %**         **Average time taken per request**
187 =======================  =================  ==================  ==================================
188 15520                    100 %              0.00 %              464 ms
189 =======================  =================  ==================  ==================================
190
191 **ACM component Setup**
192
193 ==============================================  ============================================================    ===========================================
194 **NAME**                                        **IMAGE**                                                       **PORT**
195 ==============================================  ============================================================    ===========================================
196  policy-clamp-runtime-acm-5c6d8fbfb-jz8rb       nexus3.onap.org:10001/onap/policy-clamp-runtime-acm:latest      30007/tcp
197  policy-clamp-ac-pf-ppnt-55c4cb99f4-spvng       nexus3.onap.org:10001/onap/policy-clamp-ac-pf-ppnt:latest       30008/tcp
198  policy-api-58cb45fc9b-ff5md                    nexus3.onap.org:10001/onap/policy-api:latest                    30002/tcp
199  policy-clamp-ac-http-ppnt-7b99cbfbf8-d4w9v     nexus3.onap.org:10001/onap/policy-clamp-ac-http-ppnt:latest     30009/tcp
200  policy-clamp-ac-k8s-ppnt-6d854cc8b6-twdkh      nexus3.onap.org:10001/onap/policy-clamp-ac-k8s-ppnt:latest      30010/tcp
201  policy-models-simulator-bcd494d87-bfg6g        nexus3.onap.org:10001/onap/policy-models-simulator:latest       30904/tcp
202  mariadb-galera-0                               nexus3.onap.org:10001/mariadb:10.5.8                            3306/tcp
203  policy-pap-847d89997d-x9h99                    nexus3.onap.org:10001/onap/policy-pap:latest                    30003/tcp
204  policy-apex-pdp-0                              nexus3.onap.org:10001/onap/policy-apex-pdp:latest               6969/tcp
205 ==============================================  ============================================================    ===========================================
206
207 **JMeter Screenshot**
208
209 .. image:: clamp-s3p-results/acm_performance_jmeter.png