1 <?xml version="1.0" encoding="UTF-8"?>
3 ============LICENSE_START=======================================================
5 ================================================================================
6 Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
7 ================================================================================
8 Licensed under the Apache License, Version 2.0 (the "License");
9 you may not use this file except in compliance with the License.
10 You may obtain a copy of the License at
12 http://www.apache.org/licenses/LICENSE-2.0
14 Unless required by applicable law or agreed to in writing, software
15 distributed under the License is distributed on an "AS IS" BASIS,
16 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 See the License for the specific language governing permissions and
18 limitations under the License.
19 ============LICENSE_END=========================================================
21 <jmeterTestPlan version="1.2" properties="5.0" jmeter="5.0 r1840935">
23 <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Policy XACML PDP Stability" enabled="true">
24 <stringProp name="TestPlan.comments">Policy XACML PDP Stability Tests</stringProp>
25 <boolProp name="TestPlan.functional_mode">false</boolProp>
26 <boolProp name="TestPlan.tearDown_on_shutdown">true</boolProp>
27 <boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
28 <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
29 <collectionProp name="Arguments.arguments">
30 <elementProp name="POLICY_XACML_PDP_HOST" elementType="Argument">
31 <stringProp name="Argument.name">POLICY_XACML_PDP_HOST</stringProp>
32 <stringProp name="Argument.value">${__P(host,127.0.0.1)}</stringProp>
33 <stringProp name="Argument.metadata">=</stringProp>
35 <elementProp name="DURATION" elementType="Argument">
36 <stringProp name="Argument.name">DURATION</stringProp>
37 <stringProp name="Argument.value">${__P(duration, 5)}</stringProp>
38 <stringProp name="Argument.metadata">=</stringProp>
40 <elementProp name="USERS" elementType="Argument">
41 <stringProp name="Argument.name">USERS</stringProp>
42 <stringProp name="Argument.value">${__P(users, 1)}</stringProp>
43 <stringProp name="Argument.metadata">=</stringProp>
45 <elementProp name="PORT" elementType="Argument">
46 <stringProp name="Argument.name">PORT</stringProp>
47 <stringProp name="Argument.value">${__P(port, 6969)}</stringProp>
48 <stringProp name="Argument.metadata">=</stringProp>
52 <stringProp name="TestPlan.user_define_classpath"></stringProp>
55 <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="XACML PDP Health Check Test" enabled="true">
56 <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
57 <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
58 <boolProp name="LoopController.continue_forever">false</boolProp>
59 <intProp name="LoopController.loops">-1</intProp>
61 <stringProp name="ThreadGroup.num_threads">${USERS}</stringProp>
62 <stringProp name="ThreadGroup.ramp_time">1</stringProp>
63 <boolProp name="ThreadGroup.scheduler">true</boolProp>
64 <stringProp name="ThreadGroup.duration">${DURATION}</stringProp>
65 <stringProp name="ThreadGroup.delay">1</stringProp>
68 <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Check Health" enabled="true">
69 <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
70 <collectionProp name="Arguments.arguments"/>
72 <stringProp name="HTTPSampler.domain">${POLICY_XACML_PDP_HOST}</stringProp>
73 <stringProp name="HTTPSampler.port">6969</stringProp>
74 <stringProp name="HTTPSampler.protocol">http</stringProp>
75 <stringProp name="HTTPSampler.contentEncoding"></stringProp>
76 <stringProp name="HTTPSampler.path">policy/pdpx/v1/healthcheck</stringProp>
77 <stringProp name="HTTPSampler.method">GET</stringProp>
78 <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
79 <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
80 <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
81 <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
82 <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
83 <stringProp name="HTTPSampler.connect_timeout"></stringProp>
84 <stringProp name="HTTPSampler.response_timeout"></stringProp>
85 <stringProp name="TestPlan.comments">Basic Health Check</stringProp>
88 <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
89 <collectionProp name="Asserion.test_strings">
90 <stringProp name="49586">200</stringProp>
92 <stringProp name="Assertion.custom_message"></stringProp>
93 <stringProp name="Assertion.test_field">Assertion.response_code</stringProp>
94 <boolProp name="Assertion.assume_success">false</boolProp>
95 <intProp name="Assertion.test_type">1</intProp>
98 <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="JSR223 Assertion" enabled="true">
99 <stringProp name="scriptLanguage">groovy</stringProp>
100 <stringProp name="parameters"></stringProp>
101 <stringProp name="filename"></stringProp>
102 <stringProp name="cacheKey">true</stringProp>
103 <stringProp name="script">import groovy.json.JsonSlurper;
106 if (prev.getResponseCode() == '200') {
107 def jsonSlurper = new JsonSlurper();
108 res = jsonSlurper.parseText(prev.getResponseDataAsString());
110 assert res instanceof Map;
111 assert res.code == 200;
112 assert res.name == "Policy Xacml PDP";
113 assert res.healthy==true;
114 assert res.message=="alive";
120 <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true">
121 <collectionProp name="HeaderManager.headers">
122 <elementProp name="" elementType="Header">
123 <stringProp name="Header.name">Accept</stringProp>
124 <stringProp name="Header.value">application/json</stringProp>
126 <elementProp name="" elementType="Header">
127 <stringProp name="Header.name">Content-Type</stringProp>
128 <stringProp name="Header.value">application/json</stringProp>
133 <AuthManager guiclass="AuthPanel" testclass="AuthManager" testname="HTTP Authorization Manager" enabled="true">
134 <collectionProp name="AuthManager.auth_list">
135 <elementProp name="" elementType="Authorization">
136 <stringProp name="Authorization.url">http://${POLICY_XACML_PDP_HOST}:6969/policy/pdpx/v1/healthcheck</stringProp>
137 <stringProp name="Authorization.username">healthcheck</stringProp>
138 <stringProp name="Authorization.password">zb!XztG34</stringProp>
139 <stringProp name="Authorization.domain"></stringProp>
140 <stringProp name="Authorization.realm"></stringProp>
143 <boolProp name="AuthManager.clearEachIteration">true</boolProp>
146 <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">
147 <boolProp name="ResultCollector.error_logging">false</boolProp>
149 <name>saveConfig</name>
150 <value class="SampleSaveConfiguration">
152 <latency>true</latency>
153 <timestamp>true</timestamp>
154 <success>true</success>
157 <message>true</message>
158 <threadName>true</threadName>
159 <dataType>true</dataType>
160 <encoding>false</encoding>
161 <assertions>true</assertions>
162 <subresults>true</subresults>
163 <responseData>false</responseData>
164 <samplerData>false</samplerData>
166 <fieldNames>true</fieldNames>
167 <responseHeaders>false</responseHeaders>
168 <requestHeaders>false</requestHeaders>
169 <responseDataOnError>false</responseDataOnError>
170 <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>
171 <assertionsResultsToSave>0</assertionsResultsToSave>
173 <sentBytes>true</sentBytes>
175 <threadCounts>true</threadCounts>
176 <idleTime>true</idleTime>
177 <connectTime>true</connectTime>
180 <stringProp name="filename"></stringProp>
184 <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="XACML PDP Statistics API" enabled="true">
185 <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
186 <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
187 <boolProp name="LoopController.continue_forever">false</boolProp>
188 <intProp name="LoopController.loops">-1</intProp>
190 <stringProp name="ThreadGroup.num_threads">${USERS}</stringProp>
191 <stringProp name="ThreadGroup.ramp_time">1</stringProp>
192 <boolProp name="ThreadGroup.scheduler">true</boolProp>
193 <stringProp name="ThreadGroup.duration">${DURATION}</stringProp>
194 <stringProp name="ThreadGroup.delay">1</stringProp>
197 <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Check Statistics" enabled="true">
198 <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
199 <collectionProp name="Arguments.arguments"/>
201 <stringProp name="HTTPSampler.domain">${POLICY_XACML_PDP_HOST}</stringProp>
202 <stringProp name="HTTPSampler.port">6969</stringProp>
203 <stringProp name="HTTPSampler.protocol">http</stringProp>
204 <stringProp name="HTTPSampler.contentEncoding"></stringProp>
205 <stringProp name="HTTPSampler.path">policy/pdpx/v1/statistics</stringProp>
206 <stringProp name="HTTPSampler.method">GET</stringProp>
207 <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
208 <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
209 <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
210 <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
211 <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
212 <stringProp name="HTTPSampler.connect_timeout"></stringProp>
213 <stringProp name="HTTPSampler.response_timeout"></stringProp>
214 <stringProp name="TestPlan.comments">Basic Health Check</stringProp>
217 <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
218 <collectionProp name="Asserion.test_strings">
219 <stringProp name="49586">200</stringProp>
221 <stringProp name="Assertion.custom_message"></stringProp>
222 <stringProp name="Assertion.test_field">Assertion.response_code</stringProp>
223 <boolProp name="Assertion.assume_success">false</boolProp>
224 <intProp name="Assertion.test_type">1</intProp>
227 <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="JSR223 Assertion" enabled="true">
228 <stringProp name="scriptLanguage">groovy</stringProp>
229 <stringProp name="parameters"></stringProp>
230 <stringProp name="filename"></stringProp>
231 <stringProp name="cacheKey">true</stringProp>
232 <stringProp name="script">import groovy.json.JsonSlurper;
235 if (prev.getResponseCode() == '200') {
236 def jsonSlurper = new JsonSlurper();
237 res = jsonSlurper.parseText(prev.getResponseDataAsString());
239 assert res instanceof Map;
240 assert res.code == 200;
241 assert res.totalPoliciesCount == 0;
242 assert res.permitDecisionsCount == 0;
243 assert res.denyDecisionsCount == 0;
244 assert res.indeterminantDecisionsCount == 0;
245 assert res.notApplicableDecisionsCount == 0;
253 <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true">
254 <collectionProp name="HeaderManager.headers">
255 <elementProp name="" elementType="Header">
256 <stringProp name="Header.name">Accept</stringProp>
257 <stringProp name="Header.value">application/json</stringProp>
259 <elementProp name="" elementType="Header">
260 <stringProp name="Header.name">Content-Type</stringProp>
261 <stringProp name="Header.value">application/json</stringProp>
266 <AuthManager guiclass="AuthPanel" testclass="AuthManager" testname="HTTP Authorization Manager" enabled="true">
267 <collectionProp name="AuthManager.auth_list">
268 <elementProp name="" elementType="Authorization">
269 <stringProp name="Authorization.url">http://${POLICY_XACML_PDP_HOST}:6969/policy/pdpx/v1/statistics</stringProp>
270 <stringProp name="Authorization.username">healthcheck</stringProp>
271 <stringProp name="Authorization.password">zb!XztG34</stringProp>
272 <stringProp name="Authorization.domain"></stringProp>
273 <stringProp name="Authorization.realm"></stringProp>
276 <boolProp name="AuthManager.clearEachIteration">true</boolProp>
279 <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">
280 <boolProp name="ResultCollector.error_logging">false</boolProp>
282 <name>saveConfig</name>
283 <value class="SampleSaveConfiguration">
285 <latency>true</latency>
286 <timestamp>true</timestamp>
287 <success>true</success>
290 <message>true</message>
291 <threadName>true</threadName>
292 <dataType>true</dataType>
293 <encoding>false</encoding>
294 <assertions>true</assertions>
295 <subresults>true</subresults>
296 <responseData>false</responseData>
297 <samplerData>false</samplerData>
299 <fieldNames>true</fieldNames>
300 <responseHeaders>false</responseHeaders>
301 <requestHeaders>false</requestHeaders>
302 <responseDataOnError>false</responseDataOnError>
303 <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>
304 <assertionsResultsToSave>0</assertionsResultsToSave>
306 <sentBytes>true</sentBytes>
308 <threadCounts>true</threadCounts>
309 <idleTime>true</idleTime>
310 <connectTime>true</connectTime>
313 <stringProp name="filename"></stringProp>