1 .. This work is licensed under a
2 .. Creative Commons Attribution 4.0 International License.
3 .. http://creativecommons.org/licenses/by/4.0
10 Policy APEX PDP component
11 ~~~~~~~~~~~~~~~~~~~~~~~~~
13 Both the Stability and the Performance tests were executed in a full ONAP OOM deployment in Nordix lab.
18 Deploying ONAP using OOM
19 ------------------------
21 APEX-PDP along with all policy components are deployed as part of a full ONAP OOM deployment.
22 At a minimum, the following ONAP components are needed: policy, mariadb-galera, aai, cassandra, aaf, and dmaap.
24 Before deploying, the values.yaml files are changed to use NodePort instead of ClusterIP for policy-api,
25 policy-pap, and policy-apex-pdp, so that they are accessible from jmeter::
27 policy-apex-pdp NodePort 10.43.70.176 <none> 6969:30237/TCP
28 policy-api NodePort 10.43.2.99 <none> 6969:30240/TCP
29 policy-pap NodePort 10.43.203.178 <none> 6969:30442/TCP
31 The node ports (30237, 30240 and 30442 above) are used in JMeter. The HOSTNAME for JMeter is set to the IP returned by running kubectl cluster-info.
33 Set up policy-models-simulator
34 ------------------------------
36 Policy-models-simulator is deployed to use CDS and DMaaP simulators during policy execution.
37 Simulator configurations used are available in apex-pdp repository:
38 testsuites/apex-pdp-stability/src/main/resources/simulatorConfig/
40 It is run as a docker image from a node accessible to the kubernetes cluster::
42 docker run -d --rm --publish 6680:6680 --publish 31054:3905 \
43 --volume "apex-pdp/testsuites/apex-pdp-stability/src/main/resources/simulatorConfig:/opt/app/policy/simulators/etc/mounted" \
44 nexus3.onap.org:10001/onap/policy-models-simulator:2.6-SNAPSHOT-latest
46 The published ports 6680 and 31054 are used in JMeter for CDS and DMaaP simulators.
48 Creation of VNF & PNF in AAI
49 ----------------------------
51 In order for APEX-PDP engine to fetch the resource details from AAI during runtime execution, we need to create dummy
52 VNF & PNF entities in AAI. In a real control loop flow, the entities in AAI will be either created during orchestration
53 phase or provisioned in AAI separately.
55 Download & execute the steps in postman collection for creating the entities along with it’s dependencies.
56 The steps needs to be performed sequentially one after another. And no input is required from user.
58 :download:`Create VNF & PNF in AAI for Apex S3P <postman/create-vnf-pnf-aai-for-apex-s3p.postman_collection.json>`
60 Make sure to skip the delete VNF & PNF steps.
65 Two APEX policies are executed in the APEX-PDP engine, and are triggered by multiple threads during the tests.
66 Both tests were run via jMeter.
68 Stability test script is available in apex-pdp repository:
69 testsuites/apex-pdp-stability/src/main/resources/apexPdpStabilityTestPlan.jmx
71 Performance test script is available in apex-pdp repository:
72 testsuites/performance/performance-benchmark-test/src/main/resources/apexPdpPerformanceTestPlan.jmx
75 Policy executions are validated in a stricter fashion during the tests.
76 There are test cases where up to 80 events are expected on the DMaaP topic.
77 DMaaP simulator is used to keep it simple and avoid any message pickup timing related issues.
79 Stability Test of APEX-PDP
80 ++++++++++++++++++++++++++
85 The 72 hours stability test ran the following steps.
90 Policies are created and deployed to APEX-PDP during this phase. Only one thread is in action and this step is done only once.
92 - **Create Policy onap.policies.apex.Simplecontrolloop** - creates the first APEX policy using policy/api component.
93 This is a sample policy used for PNF testing.
94 - **Create Policy onap.policies.apex.Example** - creates the second APEX policy using policy/api component.
95 This is a sample policy used for VNF testing.
96 - **Deploy Policies** - Deploy both the policies created to APEX-PDP using policy/pap component
101 Once the policies are created and deployed to APEX-PDP by the setup thread, five threads execute the below tests for 72 hours.
103 - **Healthcheck** - checks the health status of APEX-PDP
104 - **Prometheus Metrics** - checks that APEX-PDP is exposing prometheus metrics
105 - **Test Simplecontrolloop policy success case** - Send a trigger event to *unauthenticated.DCAE_CL_OUTPUT* DMaaP topic.
106 If the policy execution is successful, 3 different notification events are sent to *APEX-CL-MGT* topic by each one of the 5 threads.
107 So, it is checked if 15 notification messages are received in total on *APEX-CL-MGT* topic with the relevant messages.
108 - **Test Simplecontrolloop policy failure case** - Send a trigger event with invalid pnfName to *unauthenticated.DCAE_CL_OUTPUT* DMaaP topic.
109 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.
110 It is checked if 10 notification messages are received in total on *APEX-CL-MGT* topic with the relevant messages.
111 - **Test Example policy success case** - Send a trigger event to *unauthenticated.DCAE_POLICY_EXAMPLE_OUTPUT* DMaaP topic.
112 If the policy execution is successful, 4 different notification events are sent to *APEX-CL-MGT* topic by each one of the 5 threads.
113 So, it is checked if 20 notification messages are received in total on *APEX-CL-MGT* topic with the relevant messages.
114 - **Test Example policy failure case** - Send a trigger event with invalid vnfName to *unauthenticated.DCAE_POLICY_EXAMPLE_OUTPUT* DMaaP topic.
115 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.
116 So, it is checked if 10 notification messages are received in total on *APEX-CL-MGT* topic with the relevant messages.
117 - **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.
123 Policies are undeployed from APEX-PDP and deleted during this phase.
124 Only one thread is in action and this step is done only once after the Main phase is complete.
126 - **Undeploy Policies** - Undeploy both the policies from APEX-PDP using policy/pap component
127 - **Delete Policy onap.policies.apex.Simplecontrolloop** - delete the first APEX policy using policy/api component.
128 - **Delete Policy onap.policies.apex.Example** - delete the second APEX policy also using policy/api component.
133 The following steps can be used to configure the parameters of test plan.
135 - **HTTP Authorization Manager** - used to store user/password authentication details.
136 - **HTTP Header Manager** - used to store headers which will be used for making HTTP requests.
137 - **User Defined Variables** - used to store following user defined parameters.
139 =================== ===============================================================================
140 **Name** **Description**
141 =================== ===============================================================================
142 HOSTNAME IP Address or host name to access the components
143 PAP_PORT Port number of PAP for making REST API calls such as deploy/undeploy of policy
144 API_PORT Port number of API for making REST API calls such as create/delete of policy
145 APEX_PORT Port number of APEX for making REST API calls such as healthcheck/metrics
146 SIM_HOST IP Address or hostname running policy-models-simulator
147 DMAAP_PORT Port number of DMaaP simulator for making REST API calls such as reading notification events
148 CDS_PORT Port number of CDS simulator
149 wait Wait time if required after a request (in milliseconds)
150 threads Number of threads to run test cases in parallel
151 threadsTimeOutInMs Synchronization timer for threads running in parallel (in milliseconds)
152 =================== ===============================================================================
157 The test was run in the background via "nohup", to prevent it from being interrupted:
161 nohup ./apache-jmeter-5.4.3/bin/jmeter.sh -n -t apexPdpStabilityTestPlan.jmx -l stabilityTestResults.jtl
168 Stability test plan was triggered for 72 hours. There were no failures during the 72 hours test.
173 ======================= ================= ================== ==================================
174 **Total # of requests** **Success %** **Error %** **Average time taken per request**
175 ======================= ================= ================== ==================================
176 430331 100 % 0.00 % 152 ms
177 ======================= ================= ================== ==================================
181 There were no failures during the 72 hours test.
183 **JMeter Screenshot**
185 .. image:: apex-s3p-results/apex_stability_jmeter_results.png
187 **Memory and CPU usage**
189 The memory and CPU usage can be monitored by running "top" command in the APEX-PDP pod.
190 A snapshot is taken before and after test execution to monitor the changes in resource utilization.
191 Prometheus metrics is also collected before and after the test execution.
193 Memory and CPU usage before test execution:
195 .. image:: apex-s3p-results/apex_top_before_72h.png
197 :download:`Prometheus metrics before 72h test <apex-s3p-results/apex_metrics_before_72h.txt>`
199 Memory and CPU usage after test execution:
201 .. image:: apex-s3p-results/apex_top_after_72h.png
203 :download:`Prometheus metrics after 72h test <apex-s3p-results/apex_metrics_after_72h.txt>`
205 Performance Test of APEX-PDP
206 ++++++++++++++++++++++++++++
211 Performance test of APEX-PDP is done similar to the stability test, but in a more extreme manner using higher thread count.
216 The performance test is performed on a similar setup as Stability test.
222 Performance test plan is the same as the stability test plan above except for the few differences listed below.
224 - Increase the number of threads used in the Main Phase from 5 to 20.
225 - Reduce the test time to 2 hours.
232 nohup ./apache-jmeter-5.4.3/bin/jmeter.sh -n -t apexPdpPerformanceTestPlan.jmx -l perftestresults.jtl
238 Test results are shown as below.
242 ======================= ================= ================== ==================================
243 **Total # of requests** **Success %** **Error %** **Average time taken per request**
244 ======================= ================= ================== ==================================
245 47586 100 % 0.00 % 163 ms
246 ======================= ================= ================== ==================================
248 **JMeter Screenshot**
250 .. image:: apex-s3p-results/apex_perf_jmeter_results.png
255 Multiple policies were executed in a multi-threaded fashion for both stability and performance tests.
256 Both tests ran smoothly without any issues.