Apex S3P test results
[policy/parent.git] / docs / development / devtools / testing / s3p / apex-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 .. _apex-s3p-label:
6
7 .. toctree::
8    :maxdepth: 2
9
10 Policy APEX PDP component
11 ~~~~~~~~~~~~~~~~~~~~~~~~~
12
13 Both the Stability and the Performance tests were executed in a full Policy Framework deployment in a VM.
14
15 Setup Details
16 +++++++++++++
17
18 Deploying ONAP using OOM
19 ------------------------
20
21 APEX-PDP along with all policy components are deployed as part of a full Policy Framework deployment.
22 At a minimum, the following components are needed: policy, mariadb-galera, prometheus and dmaap.
23
24 The S3P tests utilise the ./run-s3p-tests script in the apex component. This will setup the microk8s environment, deploy
25 policy and prometheus, expose the services so they can be reached by JMeter, install JMeter and run the tests based on
26 the arguments provided.
27
28 Set up policy-models-simulator
29 ------------------------------
30
31 Policy-models-simulator is deployed to use the DMaaP simulator during policy execution.
32     Simulator configurations used are available in apex-pdp repository:
33       testsuites/apex-pdp-stability/src/main/resources/simulatorConfig/
34
35 The published port 30904 is used in JMeter for the DMaaP simulator.
36
37 JMeter Tests
38 ------------
39
40 Two APEX policies are executed in the APEX-PDP engine, and are triggered by multiple threads during the tests.
41 Both tests were run via jMeter.
42
43     Stability test script is available in apex-pdp repository:
44       testsuites/apex-pdp-stability/src/main/resources/apexPdpStabilityTestPlan.jmx
45
46     Performance test script is available in apex-pdp repository:
47       testsuites/performance/performance-benchmark-test/src/main/resources/apexPdpPerformanceTestPlan.jmx
48
49 .. Note::
50    Policy executions are validated in a stricter fashion during the tests.
51    There are test cases where up to 80 events are expected on the DMaaP topic.
52    DMaaP simulator is used to keep it simple and avoid any message pickup timing related issues.
53
54 Stability Test of APEX-PDP
55 ++++++++++++++++++++++++++
56
57 Test Plan
58 ---------
59
60 The 72 hours stability test ran the following steps.
61
62 Setup Phase
63 """""""""""
64
65 Policies are created and deployed to APEX-PDP during this phase. Only one thread is in action and this step is done only once.
66
67 - **Create Policy onap.policies.apex.Simplecontrolloop** - creates the first APEX policy using policy/api component.
68       This is a sample policy used for PNF testing.
69 - **Create Policy onap.policies.apex.Example** - creates the second APEX policy using policy/api component.
70       This is a sample policy used for VNF testing.
71 - **Deploy Policies** - Deploy both the policies created to APEX-PDP using policy/pap component
72
73 Main Phase
74 """"""""""
75
76 Once the policies are created and deployed to APEX-PDP by the setup thread, five threads execute the below tests for 72 hours.
77
78 - **Healthcheck** - checks the health status of APEX-PDP
79 - **Prometheus Metrics** - checks that APEX-PDP is exposing prometheus metrics
80 - **Test Simplecontrolloop policy success case** - Send a trigger event to *unauthenticated.DCAE_CL_OUTPUT* DMaaP topic.
81     If the policy execution is successful, 3 different notification events are sent to *APEX-CL-MGT* topic by each one of the 5 threads.
82     So, it is checked if 15 notification messages are received in total on *APEX-CL-MGT* topic with the relevant messages.
83 - **Test Simplecontrolloop policy failure case** - Send a trigger event with invalid pnfName to *unauthenticated.DCAE_CL_OUTPUT* DMaaP topic.
84     The policy execution is expected to fail due to AAI failure response. 2 notification events are expected on *APEX-CL-MGT* topic by a thread in this case.
85     It is checked if 10 notification messages are received in total on *APEX-CL-MGT* topic with the relevant messages.
86 - **Test Example policy success case** - Send a trigger event to *unauthenticated.DCAE_POLICY_EXAMPLE_OUTPUT* DMaaP topic.
87     If the policy execution is successful, 4 different notification events are sent to *APEX-CL-MGT* topic by each one of the 5 threads.
88     So, it is checked if 20 notification messages are received in total on *APEX-CL-MGT* topic with the relevant messages.
89 - **Test Example policy failure case** - Send a trigger event with invalid vnfName to *unauthenticated.DCAE_POLICY_EXAMPLE_OUTPUT* DMaaP topic.
90     The policy execution is expected to fail due to AAI failure response. 2 notification events are expected on *APEX-CL-MGT* topic by a thread in this case.
91     So, it is checked if 10 notification messages are received in total on *APEX-CL-MGT* topic with the relevant messages.
92 - **Clean up DMaaP notification topic** - DMaaP notification topic which is *APEX-CL-MGT* is cleaned up after each test to make sure that one failure doesn't lead to cascading errors.
93
94
95 Teardown Phase
96 """"""""""""""
97
98 Policies are undeployed from APEX-PDP and deleted during this phase.
99 Only one thread is in action and this step is done only once after the Main phase is complete.
100
101 - **Undeploy Policies** - Undeploy both the policies from APEX-PDP using policy/pap component
102 - **Delete Policy onap.policies.apex.Simplecontrolloop** - delete the first APEX policy using policy/api component.
103 - **Delete Policy onap.policies.apex.Example** - delete the second APEX policy also using policy/api component.
104
105 Test Configuration
106 ------------------
107
108 The following steps can be used to configure the parameters of test plan.
109
110 - **HTTP Authorization Manager** - used to store user/password authentication details.
111 - **HTTP Header Manager** - used to store headers which will be used for making HTTP requests.
112 - **User Defined Variables** - used to store following user defined parameters.
113
114 ===================  ===============================================================================
115  **Name**            **Description**
116 ===================  ===============================================================================
117  HOSTNAME            IP Address or host name to access the components
118  PAP_PORT            Port number of PAP for making REST API calls such as deploy/undeploy of policy
119  API_PORT            Port number of API for making REST API calls such as create/delete of policy
120  APEX_PORT           Port number of APEX for making REST API calls such as healthcheck/metrics
121  SIM_HOST            IP Address or hostname running policy-models-simulator
122  DMAAP_PORT          Port number of DMaaP simulator for making REST API calls such as reading notification events
123  wait                Wait time if required after a request (in milliseconds)
124  threads             Number of threads to run test cases in parallel
125  threadsTimeOutInMs  Synchronization timer for threads running in parallel (in milliseconds)
126 ===================  ===============================================================================
127
128 Run Test
129 --------
130
131 The test was run in the background via "nohup", to prevent it from being interrupted.
132
133 Test Results
134 ------------
135
136 **Summary**
137
138 Stability test plan was triggered for 72 hours. There were no failures during the 72 hours test.
139
140
141 **Test Statistics**
142
143 =======================  =================  ==================  ==================================
144 **Total # of requests**  **Success %**      **Error %**         **Average time taken per request**
145 =======================  =================  ==================  ==================================
146 112245                   99.47 %            0.53 %              2.309 sec.
147 =======================  =================  ==================  ==================================
148
149 **JMeter Screenshot**
150
151 .. image:: apex-s3p-results/apex_stability_results.png
152
153 .. Note::
154     These results show a huge dip in the number of requests compared to the previous release of Apex-PDP>
155     Further investigation and improvement is needed in the coming release.
156
157 Performance Test of APEX-PDP
158 ++++++++++++++++++++++++++++
159
160 Introduction
161 ------------
162
163 Performance test of APEX-PDP is done similar to the stability test, but in a more extreme manner using higher thread count.
164
165 Setup Details
166 -------------
167
168 The performance test is performed on a similar setup as Stability test.
169
170
171 Test Plan
172 ---------
173
174 Performance test plan is the same as the stability test plan above except for the few differences listed below.
175
176 - Increase the number of threads used in the Main Phase from 5 to 20.
177 - Reduce the test time to 2 hours.
178
179 Run Test
180 --------
181
182 The test was run in the background via "nohup", to prevent it from being interrupted.
183
184 Test Results
185 ------------
186
187 Test results are shown as below.
188
189 **Test Statistics**
190
191 =======================  =================  ==================  ==================================
192 **Total # of requests**  **Success %**      **Error %**         **Average time taken per request**
193 =======================  =================  ==================  ==================================
194 12486                    99.32 %            0.68 %              576.64 ms
195 =======================  =================  ==================  ==================================
196
197 **JMeter Screenshot**
198
199 .. image:: apex-s3p-results/apex_performance_results.png
200
201 .. Note::
202     These results show a huge dip in the number of requests compared to the previous release of Apex-PDP>
203     Further investigation and improvement is needed in the coming release.
204
205 Summary
206 +++++++
207
208 Multiple policies were executed in a multi-threaded fashion for both stability and performance tests.
209 Both tests showed a dip in performance and stability.