1 .. This work is licensed under a
2 .. Creative Commons Attribution 4.0 International License.
3 .. http://creativecommons.org/licenses/by/4.0
5 .. _distribution-s3p-label:
7 Policy Distribution component
8 #############################
10 72h Stability and 4h Performance Tests of Distribution
11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
16 The common setup for performance and stability tests is now automated - being carried out by a script in- **testsuites/run-sc3-test.sh**.
18 Clone the policy-distribution repo to access the test scripts
22 git clone https://gerrit.onap.org/r/policy/distribution
24 **The following common steps are carried out by the scripts**
26 * Updates the repo package lists for apt
27 * Installs Java 17 open jdk
29 * Installs docker-compose
30 * Retrieves version information in environment variables from th release info file
31 * Builds relevant images including the pdp simulator
32 * Triggers docker compose to bring up containers required for the testing
34 * Installs visualvm (and starts it in a GUI environment)
35 * Configures permissions for monitoring
37 * Waits for containers to come up
38 * Runs either stability or performance tests for a specified duration depending on the arguments specified
40 For example, the below runs performance tests for 2 hours. Start from the root directory of policy distribution
45 ./run-s3p-test.sh performance 7200
48 The containers on this docker-compose are running with HTTP configuration. For HTTPS, ports
49 and configurations will need to be changed, as well certificates and keys must be generated
52 The script will load up the visualvm GUI on your virtual machine. You will need to manually connect
53 it to the distribution JMX port.
55 Connect to Distribution JMX Port.
57 1. On the visualvm toolbar, click on "Add JMX Connection"
58 2. Enter localhost as the IP address and Port 9090. This is the JMX port exposed by the
59 distribution container
60 3. Double click on the newly added nodes under "Local" to start monitoring CPU, Memory & GC.
62 Example Screenshot of visualVM
64 .. image:: distribution-s3p-results/distribution-visualvm-snapshot.png
68 Once the testing is finished, you can tear down the docker setup from **./testsuites** with:
72 docker-compose -f stability/src/main/resources/setup/docker-compose.yml down
74 Stability Test of Policy Distribution
75 +++++++++++++++++++++++++++++++++++++
80 The 72 hour Stability Test for policy distribution has the goal of introducing a steady flow of
81 transactions initiated from a test client server running JMeter. The policy distribution is
82 configured with a special FileSystemReception plugin to monitor a local directory for newly added
83 csar files to be processed by itself. The input CSAR will be added/removed by the test client
84 (JMeter) and the result will be pulled from the backend (PAP and PolicyAPI) by the test client
87 The test will be performed in an environment where Jmeter will continuously add/remove a test csar
88 into the special directory where policy distribution is monitoring and will then get the processed
89 results from PAP and PolicyAPI to verify the successful deployment of the policy. The policy will
90 then be undeployed and the test will loop continuously until 72 hours have elapsed.
96 The 72h stability test will run the following steps sequentially in a single threaded loop.
98 - **Delete Old CSAR** - Checks if CSAR already exists in the watched directory, if so it deletes it
99 - **Add CSAR** - Adds CSAR to the directory that distribution is watching
100 - **Get Healthcheck** - Ensures Healthcheck is returning 200 OK
101 - **Get Metrics** - Ensures Metrics is returning 200 OK
102 - **Assert PDP Group Query** - Checks that PDPGroupQuery contains the deployed policy
103 - **Assert PoliciesDeployed** - Checks that the policy is deployed
104 - **Undeploy/Delete Policy** - Undeploys and deletes the Policy for the next loop
105 - **Assert PDP Group Query for Deleted Policy** - Ensures the policy has been removed and does not exist
107 The following steps can be used to configure the parameters of the test plan.
109 - **HTTP Authorization Manager** - used to store user/password authentication details.
110 - **HTTP Header Manager** - used to store headers which will be used for making HTTP requests.
111 - **User Defined Variables** - used to store following user defined parameters.
113 ========== ===============================================
114 **Name** **Description**
115 ========== ===============================================
116 PAP_HOST IP Address or host name of PAP component
117 PAP_PORT Port number of PAP for making REST API calls
118 API_HOST IP Address or host name of API component
119 API_PORT Port number of API for making REST API calls
120 DURATION Duration of Test
121 ========== ===============================================
123 Screenshot of Distribution stability test plan
125 .. image:: distribution-s3p-results/distribution-jmeter-testcases.png
128 Running the Test Plan
129 ---------------------
131 The main script takes care of everything. To run the 72 hour stability tests do as follows
136 ./run-s3p-test.sh stability 259200
138 * visualvm produces the monitor and threads - we can screenshot those and add them to the test results
139 * A jmeter .jtl file is produced by the run - it is called distribution-stability.jtl
140 * The file can be imported into the jmeter GUI to view statistics
141 * The application performance index table can be produced with jmeter on the cli as below:ls
145 jmeter -n -t your_test_plan.jmx -l test_results.jtl -e -o report_directory
152 - Stability test plan was triggered for 72 hours.
153 - No errors were reported
157 .. image:: distribution-s3p-results/stability-statistics.png
158 .. image:: distribution-s3p-results/stability-threshold.png
160 **VisualVM Screenshots**
162 .. image:: distribution-s3p-results/stability-monitor.png
163 .. image:: distribution-s3p-results/stability-threads.png
166 Performance Test of Policy Distribution
167 +++++++++++++++++++++++++++++++++++++++
172 The 4h Performance Test of Policy Distribution has the goal of testing the min/avg/max processing
173 time and rest call throughput for all the requests when the number of requests are large enough to
174 saturate the resource and find the bottleneck.
176 It also tests that distribution can handle multiple policy CSARs and that these are deployed within
177 60 seconds consistently.
183 The performance test is based on the same setup as the distribution stability tests. This setup is done by the main
184 **run-s3p-test.sh** script
190 Performance test plan is different from the stability test plan.
192 - Instead of handling one policy csar at a time, multiple csar's are deployed within the watched
193 folder at the exact same time.
194 - We expect all policies from these csar's to be deployed within 60 seconds.
195 - There are also multithreaded tests running towards the healthcheck and statistics endpoints of
196 the distribution service.
199 Running the Test Plan
200 ---------------------
202 The main script takes care of everything. To run the 4 hour performance tests do as follows
207 ./run-s3p-test.sh performance 14400
209 * visualvm produces the monitor and threads - we can screenshot those and add them to the test results
210 * A jmeter .jtl file is produced by the run - it is called distribution-performance.jtl
211 * The file can be imported into the jmeter GUI to view statistics
212 * The application performance index table can be produced with jmeter on the cli as below:
216 jmeter -n -t your_test_plan.jmx -l test_results.jtl -e -o report_directory
218 This produced html pages where statistics tables can be seen and added to the results.
225 - Performance test plan was triggered for 4 hours.
226 - No errors were reported
230 .. image:: distribution-s3p-results/performance-statistics.png
231 .. image:: distribution-s3p-results/performance-threshold.png
233 **VisualVM Screenshots**
235 .. image:: distribution-s3p-results/performance-monitor.png
236 .. image:: distribution-s3p-results/performance-threads.png