02eecec4e86b06baf88d3c74b4ea92c61ed66fce
[policy/xacml-pdp.git] / testsuites / performance / src / main / resources / testplans / perf.jmx
1 <?xml version="1.0" encoding="UTF-8"?>
2 <jmeterTestPlan version="1.2" properties="5.0" jmeter="5.0 r1840935">
3   <hashTree>
4     <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Policy XACML PDP Performance" enabled="true">
5       <stringProp name="TestPlan.comments">Policy XACML PDP Performance Tests</stringProp>
6       <boolProp name="TestPlan.functional_mode">false</boolProp>
7       <boolProp name="TestPlan.tearDown_on_shutdown">true</boolProp>
8       <boolProp name="TestPlan.serialize_threadgroups">true</boolProp>
9       <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
10         <collectionProp name="Arguments.arguments">
11           <elementProp name="POLICY_XACML_PDP_HOST" elementType="Argument">
12             <stringProp name="Argument.name">POLICY_XACML_PDP_HOST</stringProp>
13             <stringProp name="Argument.value">${__P(host,10.12.6.164)}</stringProp>
14             <stringProp name="Argument.metadata">=</stringProp>
15           </elementProp>
16           <elementProp name="DURATION" elementType="Argument">
17             <stringProp name="Argument.name">DURATION</stringProp>
18             <stringProp name="Argument.value">${__P(duration, 5)}</stringProp>
19             <stringProp name="Argument.metadata">=</stringProp>
20           </elementProp>
21           <elementProp name="USERS" elementType="Argument">
22             <stringProp name="Argument.name">USERS</stringProp>
23             <stringProp name="Argument.value">${__P(users, 1)}</stringProp>
24             <stringProp name="Argument.metadata">=</stringProp>
25           </elementProp>
26           <elementProp name="PORT" elementType="Argument">
27             <stringProp name="Argument.name">PORT</stringProp>
28             <stringProp name="Argument.value">${__P(port, 6969)}</stringProp>
29             <stringProp name="Argument.metadata">=</stringProp>
30           </elementProp>
31         </collectionProp>
32       </elementProp>
33       <stringProp name="TestPlan.user_define_classpath"></stringProp>
34     </TestPlan>
35     <hashTree>
36       <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Policy XACML PDP Health Check " enabled="true">
37         <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
38         <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
39           <boolProp name="LoopController.continue_forever">false</boolProp>
40           <intProp name="LoopController.loops">-1</intProp>
41         </elementProp>
42         <stringProp name="ThreadGroup.num_threads">${USERS}</stringProp>
43         <stringProp name="ThreadGroup.ramp_time">1</stringProp>
44         <boolProp name="ThreadGroup.scheduler">true</boolProp>
45         <stringProp name="ThreadGroup.duration">${DURATION}</stringProp>
46         <stringProp name="ThreadGroup.delay">1</stringProp>
47       </ThreadGroup>
48       <hashTree>
49         <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Check Health" enabled="true">
50           <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
51             <collectionProp name="Arguments.arguments"/>
52           </elementProp>
53           <stringProp name="HTTPSampler.domain">${POLICY_XACML_PDP_HOST}</stringProp>
54           <stringProp name="HTTPSampler.port">6969</stringProp>
55           <stringProp name="HTTPSampler.protocol">https</stringProp>
56           <stringProp name="HTTPSampler.contentEncoding"></stringProp>
57           <stringProp name="HTTPSampler.path">policy/pdpx/v1/healthcheck</stringProp>
58           <stringProp name="HTTPSampler.method">GET</stringProp>
59           <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
60           <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
61           <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
62           <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
63           <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
64           <stringProp name="HTTPSampler.connect_timeout"></stringProp>
65           <stringProp name="HTTPSampler.response_timeout"></stringProp>
66           <stringProp name="TestPlan.comments">Basic Health Check</stringProp>
67         </HTTPSamplerProxy>
68         <hashTree>
69           <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
70             <collectionProp name="Asserion.test_strings">
71               <stringProp name="49586">200</stringProp>
72             </collectionProp>
73             <stringProp name="Assertion.custom_message"></stringProp>
74             <stringProp name="Assertion.test_field">Assertion.response_code</stringProp>
75             <boolProp name="Assertion.assume_success">false</boolProp>
76             <intProp name="Assertion.test_type">1</intProp>
77           </ResponseAssertion>
78           <hashTree/>
79           <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="JSR223 Assertion" enabled="true">
80             <stringProp name="scriptLanguage">groovy</stringProp>
81             <stringProp name="parameters"></stringProp>
82             <stringProp name="filename"></stringProp>
83             <stringProp name="cacheKey">true</stringProp>
84             <stringProp name="script">import groovy.json.JsonSlurper;
85
86 def res = [];
87 if (prev.getResponseCode() == &apos;200&apos;) {
88     def jsonSlurper = new JsonSlurper();
89     res = jsonSlurper.parseText(prev.getResponseDataAsString());
90
91     assert res instanceof Map;
92     assert res.code == 200;
93
94 }</stringProp>
95           </JSR223Assertion>
96           <hashTree/>
97         </hashTree>
98         <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true">
99           <collectionProp name="HeaderManager.headers">
100             <elementProp name="" elementType="Header">
101               <stringProp name="Header.name">Accept</stringProp>
102               <stringProp name="Header.value">application/json</stringProp>
103             </elementProp>
104             <elementProp name="" elementType="Header">
105               <stringProp name="Header.name">Content-Type</stringProp>
106               <stringProp name="Header.value">application/json</stringProp>
107             </elementProp>
108           </collectionProp>
109         </HeaderManager>
110         <hashTree/>
111         <AuthManager guiclass="AuthPanel" testclass="AuthManager" testname="HTTP Authorization Manager" enabled="true">
112           <collectionProp name="AuthManager.auth_list">
113             <elementProp name="" elementType="Authorization">
114               <stringProp name="Authorization.url">https://${POLICY_XACML_PDP_HOST}:6969/policy/pdpx/v1/healthcheck</stringProp>
115               <stringProp name="Authorization.username">healthcheck</stringProp>
116               <stringProp name="Authorization.password">zb!XztG34</stringProp>
117               <stringProp name="Authorization.domain"></stringProp>
118               <stringProp name="Authorization.realm"></stringProp>
119             </elementProp>
120           </collectionProp>
121           <boolProp name="AuthManager.clearEachIteration">true</boolProp>
122         </AuthManager>
123         <hashTree/>
124         <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">
125           <boolProp name="ResultCollector.error_logging">false</boolProp>
126           <objProp>
127             <name>saveConfig</name>
128             <value class="SampleSaveConfiguration">
129               <time>true</time>
130               <latency>true</latency>
131               <timestamp>true</timestamp>
132               <success>true</success>
133               <label>true</label>
134               <code>true</code>
135               <message>true</message>
136               <threadName>true</threadName>
137               <dataType>true</dataType>
138               <encoding>false</encoding>
139               <assertions>true</assertions>
140               <subresults>true</subresults>
141               <responseData>false</responseData>
142               <samplerData>false</samplerData>
143               <xml>false</xml>
144               <fieldNames>true</fieldNames>
145               <responseHeaders>false</responseHeaders>
146               <requestHeaders>false</requestHeaders>
147               <responseDataOnError>false</responseDataOnError>
148               <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>
149               <assertionsResultsToSave>0</assertionsResultsToSave>
150               <bytes>true</bytes>
151               <sentBytes>true</sentBytes>
152               <url>true</url>
153               <threadCounts>true</threadCounts>
154               <idleTime>true</idleTime>
155               <connectTime>true</connectTime>
156             </value>
157           </objProp>
158           <stringProp name="filename">/tmp/pdpx_perf_health.log</stringProp>
159         </ResultCollector>
160         <hashTree/>
161       </hashTree>
162       <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="XACML PDP Statistics Check " enabled="true">
163         <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
164         <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
165           <boolProp name="LoopController.continue_forever">false</boolProp>
166           <intProp name="LoopController.loops">-1</intProp>
167         </elementProp>
168         <stringProp name="ThreadGroup.num_threads">${USERS}</stringProp>
169         <stringProp name="ThreadGroup.ramp_time">1</stringProp>
170         <boolProp name="ThreadGroup.scheduler">true</boolProp>
171         <stringProp name="ThreadGroup.duration">${DURATION}</stringProp>
172         <stringProp name="ThreadGroup.delay">1</stringProp>
173       </ThreadGroup>
174       <hashTree>
175         <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Check Statistics" enabled="true">
176           <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
177             <collectionProp name="Arguments.arguments"/>
178           </elementProp>
179           <stringProp name="HTTPSampler.domain">${POLICY_XACML_PDP_HOST}</stringProp>
180           <stringProp name="HTTPSampler.port">6969</stringProp>
181           <stringProp name="HTTPSampler.protocol">https</stringProp>
182           <stringProp name="HTTPSampler.contentEncoding"></stringProp>
183           <stringProp name="HTTPSampler.path">policy/pdpx/v1/statistics</stringProp>
184           <stringProp name="HTTPSampler.method">GET</stringProp>
185           <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
186           <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
187           <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
188           <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
189           <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
190           <stringProp name="HTTPSampler.connect_timeout"></stringProp>
191           <stringProp name="HTTPSampler.response_timeout"></stringProp>
192           <stringProp name="TestPlan.comments">Basic Health Check</stringProp>
193         </HTTPSamplerProxy>
194         <hashTree>
195           <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
196             <collectionProp name="Asserion.test_strings">
197               <stringProp name="49586">200</stringProp>
198             </collectionProp>
199             <stringProp name="Assertion.custom_message"></stringProp>
200             <stringProp name="Assertion.test_field">Assertion.response_code</stringProp>
201             <boolProp name="Assertion.assume_success">false</boolProp>
202             <intProp name="Assertion.test_type">1</intProp>
203           </ResponseAssertion>
204           <hashTree/>
205           <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="JSR223 Assertion" enabled="true">
206             <stringProp name="scriptLanguage">groovy</stringProp>
207             <stringProp name="parameters"></stringProp>
208             <stringProp name="filename"></stringProp>
209             <stringProp name="cacheKey">true</stringProp>
210             <stringProp name="script">import groovy.json.JsonSlurper;
211
212 def res = [];
213 if (prev.getResponseCode() == &apos;200&apos;) {
214     def jsonSlurper = new JsonSlurper();
215     res = jsonSlurper.parseText(prev.getResponseDataAsString());
216
217     assert res instanceof Map;
218     assert res.code == 200;
219
220
221 }</stringProp>
222           </JSR223Assertion>
223           <hashTree/>
224         </hashTree>
225         <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true">
226           <collectionProp name="HeaderManager.headers">
227             <elementProp name="" elementType="Header">
228               <stringProp name="Header.name">Accept</stringProp>
229               <stringProp name="Header.value">application/json</stringProp>
230             </elementProp>
231             <elementProp name="" elementType="Header">
232               <stringProp name="Header.name">Content-Type</stringProp>
233               <stringProp name="Header.value">application/json</stringProp>
234             </elementProp>
235           </collectionProp>
236         </HeaderManager>
237         <hashTree/>
238         <AuthManager guiclass="AuthPanel" testclass="AuthManager" testname="HTTP Authorization Manager" enabled="true">
239           <collectionProp name="AuthManager.auth_list">
240             <elementProp name="" elementType="Authorization">
241               <stringProp name="Authorization.url">https://${POLICY_XACML_PDP_HOST}:6969/policy/pdpx/v1/statistics</stringProp>
242               <stringProp name="Authorization.username">healthcheck</stringProp>
243               <stringProp name="Authorization.password">zb!XztG34</stringProp>
244               <stringProp name="Authorization.domain"></stringProp>
245               <stringProp name="Authorization.realm"></stringProp>
246             </elementProp>
247           </collectionProp>
248           <boolProp name="AuthManager.clearEachIteration">true</boolProp>
249         </AuthManager>
250         <hashTree/>
251         <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">
252           <boolProp name="ResultCollector.error_logging">false</boolProp>
253           <objProp>
254             <name>saveConfig</name>
255             <value class="SampleSaveConfiguration">
256               <time>true</time>
257               <latency>true</latency>
258               <timestamp>true</timestamp>
259               <success>true</success>
260               <label>true</label>
261               <code>true</code>
262               <message>true</message>
263               <threadName>true</threadName>
264               <dataType>true</dataType>
265               <encoding>false</encoding>
266               <assertions>true</assertions>
267               <subresults>true</subresults>
268               <responseData>false</responseData>
269               <samplerData>false</samplerData>
270               <xml>false</xml>
271               <fieldNames>true</fieldNames>
272               <responseHeaders>false</responseHeaders>
273               <requestHeaders>false</requestHeaders>
274               <responseDataOnError>false</responseDataOnError>
275               <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>
276               <assertionsResultsToSave>0</assertionsResultsToSave>
277               <bytes>true</bytes>
278               <sentBytes>true</sentBytes>
279               <url>true</url>
280               <threadCounts>true</threadCounts>
281               <idleTime>true</idleTime>
282               <connectTime>true</connectTime>
283             </value>
284           </objProp>
285           <stringProp name="filename">/tmp/pdpx_perf_stats.log</stringProp>
286         </ResultCollector>
287         <hashTree/>
288       </hashTree>
289     </hashTree>
290   </hashTree>
291 </jmeterTestPlan>