blob: fc2a2059947b4ef5f61e4aa8ae5708d3fa3b9551 [file] [log] [blame]
DR695Hccff30b2017-02-17 18:44:24 -05001*** Settings ***
2Documentation The main interface for interacting with Policy. It handles low level stuff like managing the http request library and Policy required fields
3Library RequestsClientCert
4Library RequestsLibrary
5Library String
6Library JSONUtils
Brian Freeman55b96e22019-05-08 20:49:45 -05007Library Collections
Sylvain Desbureaux2e33ff62019-05-15 14:41:18 +02008Library Collections
DR695H910097e2019-05-08 13:55:32 -04009Library SSHLibrary
10Library OperatingSystem
11Resource json_templater.robot
DR695Hccff30b2017-02-17 18:44:24 -050012Resource global_properties.robot
DR695H910097e2019-05-08 13:55:32 -040013Resource ssh/files.robot
DR695Hccff30b2017-02-17 18:44:24 -050014
15*** Variables ***
16${POLICY_HEALTH_CHECK_PATH} /healthcheck
DR695Hbf5a3a32017-06-30 13:09:57 -040017${POLICY_ENDPOINT} ${GLOBAL_POLICY_SERVER_PROTOCOL}://${GLOBAL_INJECTED_POLICY_IP_ADDR}:${GLOBAL_POLICY_SERVER_PORT}
Gary Wu251aa682018-07-30 15:22:20 -070018${POLICY_HEALTHCHECK_ENDPOINT} ${GLOBAL_POLICY_SERVER_PROTOCOL}://${GLOBAL_INJECTED_POLICY_HEALTHCHECK_IP_ADDR}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
Brian Freemanca5e32e2018-07-23 12:47:21 -050019${POLICY_TEMPLATES} robot/assets/templates/policy
Brian Freemand65e2aa2018-07-26 11:13:46 -050020${DROOLS_ENDPOINT} ${GLOBAL_POLICY_SERVER_PROTOCOL}://${GLOBAL_INJECTED_POLICY_IP_ADDR}:${GLOBAL_DROOLS_SERVER_PORT}
Bilal A461aa5b2019-05-06 14:00:57 -040021${POLICY_API_IP} ${GLOBAL_INJECTED_POLICY_API_IP_ADDR}
22${POLICY_PAP_IP} ${GLOBAL_INJECTED_POLICY_PAP_IP_ADDR}
23${POLICY_DISTRIBUTION_IP} ${GLOBAL_INJECTED_POLICY_DISTRIBUTION_IP_ADDR}
24${POLICY_PDPX_IP} ${GLOBAL_INJECTED_POLICY_PDPX_IP_ADDR}
25${POLICY_APEX_PDP_IP} ${GLOBAL_INJECTED_POLICY_APEX_PDP_IP_ADDR}
26${POLICY_HEALTHCHECK_USERNAME} ${GLOBAL_POLICY_HEALTHCHECK_USERNAME}
27${POLICY_HEALTHCHECK_PASSWORD} ${GLOBAL_POLICY_HEALTHCHECK_PASSWORD}
DR695Hccff30b2017-02-17 18:44:24 -050028
Brian Freeman88fbb992019-05-17 17:46:56 -050029
DR695Hccff30b2017-02-17 18:44:24 -050030*** Keywords ***
31
32Run Policy Health Check
33 [Documentation] Runs Policy Health check
Brian Freeman55b96e22019-05-08 20:49:45 -050034 ${auth}= Create List ${GLOBAL_POLICY_USERNAME} ${GLOBAL_POLICY_PASSWORD}
DR695Hbf5a3a32017-06-30 13:09:57 -040035 Log Creating session ${POLICY_ENDPOINT}
36 ${session}= Create Session policy ${POLICY_HEALTHCHECK_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -050037 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
38 ${resp}= Get Request policy ${POLICY_HEALTH_CHECK_PATH} headers=${headers}
39 Log Received response from policy ${resp.text}
40 Should Be Equal As Strings ${resp.status_code} 200
41 Should Be True ${resp.json()['healthy']}
42 @{ITEMS}= Copy List ${resp.json()['details']}
43 :FOR ${ELEMENT} IN @{ITEMS}
44 \ Should Be Equal As Strings ${ELEMENT['code']} 200
45 \ Should Be True ${ELEMENT['healthy']}
Brian Freeman55b96e22019-05-08 20:49:45 -050046
Brian Freemand65e2aa2018-07-26 11:13:46 -050047Run Drools Get Request
48 [Documentation] Runs Drools Get Request
49 [Arguments] ${data_path}
50 ${auth}= Create List ${GLOBAL_DROOLS_USERNAME} ${GLOBAL_DROOLS_PASSWORD}
51 Log Creating session ${POLICY_ENDPOINT}
52 ${session}= Create Session policy ${DROOLS_ENDPOINT} auth=${auth}
53 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
54 ${resp}= Get Request policy ${data_path} headers=${headers}
55 Log Received response from policy ${resp.text}
56 Should Be Equal As Strings ${resp.status_code} 200
57 [Return] ${resp}
58
DR695Hccff30b2017-02-17 18:44:24 -050059Run Policy Put Request
60 [Documentation] Runs Policy Put request
61 [Arguments] ${data_path} ${data}
DR695Hbf5a3a32017-06-30 13:09:57 -040062 Log Creating session ${POLICY_ENDPOINT}
63 ${session}= Create Session policy ${POLICY_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -050064 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json Authorization=Basic ${GLOBAL_POLICY_AUTH} ClientAuth=${GLOBAL_POLICY_CLIENTAUTH} Environment=TEST
65 ${resp}= Put Request policy ${data_path} data=${data} headers=${headers}
66 Log Received response from policy ${resp.text}
67 [Return] ${resp}
Brian Freemane14d2572019-04-29 16:20:21 -050068
Brian Freemanc967dd62019-04-30 09:47:44 -050069Run Policy Get Request
70 [Documentation] Runs Policy Get request
71 [Arguments] ${data_path}
72 Log Creating session ${POLICY_ENDPOINT}
73 ${session}= Create Session policy ${POLICY_ENDPOINT}
74 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json Authorization=Basic ${GLOBAL_POLICY_AUTH} ClientAuth=${GLOBAL_POLICY_CLIENTAUTH} Environment=TEST
75 ${resp}= Get Request policy ${data_path} headers=${headers}
76 Log Received response from policy ${resp.text}
77
Brian Freeman55b96e22019-05-08 20:49:45 -050078Run Policy Pap Get Request
79 [Documentation] Runs Policy Pap Get request
80 [Arguments] ${data_path}
81 ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD}
82 Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
Sylvain Desbureaux2e33ff62019-05-15 14:41:18 +020083 ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth}
Brian Freeman55b96e22019-05-08 20:49:45 -050084 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
85 ${resp}= Get Request policy ${data_path} headers=${headers}
86 Log Received response from Policy Pap ${resp.text}
87 [Return] ${resp}
88
89
Brian Freemane14d2572019-04-29 16:20:21 -050090Run Policy Post Request
91 [Documentation] Runs Policy Post request
92 [Arguments] ${data_path} ${data}
93 Log Creating session ${POLICY_ENDPOINT}
94 ${session}= Create Session policy ${POLICY_ENDPOINT}
95 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json Authorization=Basic ${GLOBAL_POLICY_AUTH} ClientAuth=${GLOBAL_POLICY_CLIENTAUTH} Environment=TEST
96 ${resp}= Post Request policy ${data_path} data=${data} headers=${headers}
97 Log Received response from policy ${resp.text}
98 [Return] ${resp}
Brian Freemanc967dd62019-04-30 09:47:44 -050099
Brian Freeman55b96e22019-05-08 20:49:45 -0500100Run Policy Api Post Request
101 [Documentation] Runs Policy Api Post request
102 [Arguments] ${data_path} ${data}
103 ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD}
Sylvain Desbureaux2e33ff62019-05-15 14:41:18 +0200104 ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth}
Brian Freeman55b96e22019-05-08 20:49:45 -0500105 Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
106 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
107 ${resp}= Post Request policy ${data_path} data=${data} headers=${headers}
108 Log Received response from policy ${resp.text}
109 [Return] ${resp}
110
111
112Run Policy Pap Post Request
113 [Documentation] Runs Policy Pap Post request
114 [Arguments] ${data_path} ${data}
115 ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD}
Sylvain Desbureaux2e33ff62019-05-15 14:41:18 +0200116 ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth}
Brian Freeman55b96e22019-05-08 20:49:45 -0500117 Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
118 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
119 ${resp}= Post Request policy ${data_path} data=${data} headers=${headers}
120 Log Received response from policy ${resp.text}
121 [Return] ${resp}
122
123
DR695Hccff30b2017-02-17 18:44:24 -0500124Run Policy Delete Request
125 [Documentation] Runs Policy Delete request
126 [Arguments] ${data_path} ${data}
DR695Hbf5a3a32017-06-30 13:09:57 -0400127 Log Creating session ${POLICY_ENDPOINT}
128 ${session}= Create Session policy ${POLICY_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500129 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json Authorization=Basic ${GLOBAL_POLICY_AUTH} ClientAuth=${GLOBAL_POLICY_CLIENTAUTH} Environment=TEST
130 ${resp}= Delete Request policy ${data_path} data=${data} headers=${headers}
131 Log Received response from policy ${resp.text}
132 [Return] ${resp}
Brian Freeman55b96e22019-05-08 20:49:45 -0500133
DR695Hccff30b2017-02-17 18:44:24 -0500134Run Policy Get Configs Request
135 [Documentation] Runs Policy Get Configs request
136 [Arguments] ${data_path} ${data}
DR695Hbf5a3a32017-06-30 13:09:57 -0400137 Log Creating session ${POLICY_ENDPOINT}
138 ${session}= Create Session policy ${POLICY_ENDPOINT}
Brian Freeman55b96e22019-05-08 20:49:45 -0500139 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json Authorization=Basic ${GLOBAL_POLICY_AUTH} ClientAuth=${GLOBAL_POLICY_CLIENTAUTH}
DR695Hccff30b2017-02-17 18:44:24 -0500140 ${resp}= Post Request policy ${data_path} data=${data} headers=${headers}
141 Log Received response from policy ${resp.text}
Gary Wu76bc74f2018-03-22 13:25:49 -0700142 [Return] ${resp}
143
144
145
Brian Freemanc967dd62019-04-30 09:47:44 -0500146Update vVFWCL Policy Old
Gary Wu76bc74f2018-03-22 13:25:49 -0700147 [Arguments] ${resource_id}
Brian Freemanca5e32e2018-07-23 12:47:21 -0500148 Run Keyword and Ignore Error Delete vFWCL Policy
Gary Wu76bc74f2018-03-22 13:25:49 -0700149 Sleep 20s
Brian Freemand65e2aa2018-07-26 11:13:46 -0500150 Log To Console Create vFWCL Policy
Gary Wu76bc74f2018-03-22 13:25:49 -0700151 Create vFWCL Policy ${resource_id}
152 Sleep 5s
Brian Freemand65e2aa2018-07-26 11:13:46 -0500153 Log To Console Push vFWCL Policy
Gary Wu76bc74f2018-03-22 13:25:49 -0700154 Push vFWCL Policy
155 Sleep 20s
Brian Freemand65e2aa2018-07-26 11:13:46 -0500156 Log To Console Reboot Drools
Gary Wu76bc74f2018-03-22 13:25:49 -0700157 Reboot Drools
158 Sleep 20s
Brian Freemand65e2aa2018-07-26 11:13:46 -0500159 Log To Console Validate vFWCL Policy
Brian Freemanc967dd62019-04-30 09:47:44 -0500160 Validate the vFWCL Policy Old
161
162Update vVFWCL Policy
Brian Freeman0d866b52019-05-08 20:30:14 -0500163 [Arguments] ${resource_id}
Brian Freeman55b96e22019-05-08 20:49:45 -0500164 Log To Console Create vFWCL Monitoring Policy
Brian Freemanc967dd62019-04-30 09:47:44 -0500165 Create vFirewall Monitoring Policy
166 Sleep 5s
Brian Freeman55b96e22019-05-08 20:49:45 -0500167 Log To Console Create vFWCL Operational Policy
Brian Freeman75948282019-05-14 20:44:46 -0500168 ${op_policy_version}= Create vFirewall Operational Policy ${resource_id}
Brian Freemanc967dd62019-04-30 09:47:44 -0500169 Sleep 5s
Brian Freeman55b96e22019-05-08 20:49:45 -0500170 Log To Console Push vFWCL To PDP Group
Brian Freeman75948282019-05-14 20:44:46 -0500171 Push vFirewall Policies To PDP Group ${op_policy_version}
Brian Freemanc967dd62019-04-30 09:47:44 -0500172 Sleep 20s
173 Log To Console Validate vFWCL Policy
Gary Wu76bc74f2018-03-22 13:25:49 -0700174 Validate the vFWCL Policy
175
Brian Freemanc967dd62019-04-30 09:47:44 -0500176
Gary Wu76bc74f2018-03-22 13:25:49 -0700177Delete vFWCL Policy
178 ${data}= OperatingSystem.Get File ${POLICY_TEMPLATES}/FirewallPolicy_delete.template
179 ${resp}= Run Policy Delete Request /pdp/api/deletePolicy ${data}
180 Should Be Equal As Strings ${resp.status_code} 200
181
182Create vFWCL Policy
183 [Arguments] ${resource_id}
184 ${dict}= Create Dictionary RESOURCE_ID=${resource_id}
185 ${data}= Fill JSON Template File ${POLICY_TEMPLATES}/FirewallPolicy_update.template ${dict}
186 ${resp}= Run Policy Put Request /pdp/api/updatePolicy ${data}
187 Should Be Equal As Strings ${resp.status_code} 200
188
189Push vFWCL Policy
190 ${dict}= Create Dictionary
191 ${data}= Fill JSON Template File ${POLICY_TEMPLATES}/FirewallPolicy_push.template ${dict}
192 ${resp}= Run Policy Put Request /pdp/api/pushPolicy ${data}
193 Should Be Equal As Strings ${resp.status_code} 200
194
195Reboot Drools
196 ${stop}= Catenate docker exec -t -u policy drools bash -c "source /opt/app/policy/etc/profile.d/env.sh; policy stop"
197 ${start}= Catenate docker exec -t -u policy drools bash -c "source /opt/app/policy/etc/profile.d/env.sh; policy start"
198 Wait Until Keyword Succeeds 120 5 sec Open Connection And Log In ${GLOBAL_INJECTED_POLICY_IP_ADDR} root ${GLOBAL_VM_PRIVATE_KEY}
199 Write ${stop}
200 ${status} ${stdout}= Run Keyword And Ignore Error SSHLibrary.Read Until Regexp has stopped
201 Log ${status}: stdout=${stdout}
202 ${ctrlc}= Evaluate '\x03'
203 Run Keyword If '${status}' == 'FAIL' Write ${ctrlc}
204 Sleep 5s
205 Write ${start}
206 ${stdout}= SSHLibrary.Read Until Regexp is running
207 Log stdout=${stdout}
208 Should Contain ${stdout} is running
209
Brian Freemanc967dd62019-04-30 09:47:44 -0500210Validate the vFWCL Policy Old
Gary Wu76bc74f2018-03-22 13:25:49 -0700211 ${resp}= Run Drools Get Request /policy/pdp/engine/controllers/amsterdam/drools
212 Should Be Equal As Strings ${resp.status_code} 200
213 ${resp}= Run Drools Get Request /policy/pdp/engine/controllers/amsterdam/drools/facts/closedloop-amsterdam/org.onap.policy.controlloop.Params
214 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemane14d2572019-04-29 16:20:21 -0500215
Brian Freeman55b96e22019-05-08 20:49:45 -0500216Validate the vFWCL Policy
217 ${resp}= Run Policy Pap Get Request /policy/pap/v1/pdps
Brian Freemanc967dd62019-04-30 09:47:44 -0500218 Log Received response from policy ${resp.text}
219 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemane14d2572019-04-29 16:20:21 -0500220
221Create vFirewall Monitoring Policy
222 ${dict}= Create Dictionary
223 ${data}= Fill JSON Template File ${POLICY_TEMPLATES}/vFirewall_policy_monitoring_input_tosca.template ${dict}
Brian Freeman55b96e22019-05-08 20:49:45 -0500224 ${resp}= Run Policy Api Post Request /policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies ${data}
Brian Freemane14d2572019-04-29 16:20:21 -0500225 Should Be Equal As Strings ${resp.status_code} 200
226
227
228Create vFirewall Operational Policy
229 [Arguments] ${resource_id}
230 ${dict}= Create Dictionary RESOURCE_ID=${resource_id}
Brian Freeman88fbb992019-05-17 17:46:56 -0500231 #vFirewall_policy_operational_content.yaml
232 #vFirewall_policy_operational_url_enc_content_input.template
233 ${content_data} OperatingSystem.Get File ${POLICY_TEMPLATES}/vFirewall_policy_operational_content.yaml
234 ${content_data}= Replace String Using Regexp ${content_data} ${RESOURCE_ID} ${resource_id}
235 ${encoded_content_data}= Evaluate urllib.urlencode('''${content_data}''') urllib
236 ${content_dictionary}= Create Dictionary URL_ENCODED_CONTENT {$encoded_content_data}
237 ${data_2}= Fill JSON Template File ${POLICY_TEMPLATES}/vFirewall_policy_operational_url_enc_content_input.template ${dict_2}
238 Log To Console ${data_2}
Brian Freemane14d2572019-04-29 16:20:21 -0500239 ${data}= Fill JSON Template File ${POLICY_TEMPLATES}/vFirewall_policy_operational_input.template ${dict}
Brian Freeman55b96e22019-05-08 20:49:45 -0500240 ${resp}= Run Policy Api Post Request /policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies ${data}
Brian Freemane14d2572019-04-29 16:20:21 -0500241 Should Be Equal As Strings ${resp.status_code} 200
Brian Freeman75948282019-05-14 20:44:46 -0500242 [Return] ${resp.json()['policy-version']}
Brian Freemane14d2572019-04-29 16:20:21 -0500243
Brian Freeman88fbb992019-05-17 17:46:56 -0500244Create vFirewall Operational Policy
245 [Arguments] ${resource_id}
246 ${dict}= Create Dictionary RESOURCE_ID=${resource_id}
247 ${content_data} OperatingSystem.Get File ${POLICY_TEMPLATES}/vFirewall_policy_operational_content.yaml
248 ${content_data}= Replace String Using Regexp ${content_data} __RESOURCE_ID__ ${resource_id}
249 ${encoded_content_data}= Evaluate urllib.quote_plus('''${content_data}''') urllib
250 ${content_dictionary}= Create Dictionary URL_ENCODED_CONTENT ${encoded_content_data}
251 ${data_2}= Fill JSON Template File ${POLICY_TEMPLATES}/vFirewall_policy_operational_url_enc_content_input.template ${content_dictionary}
252 Log To Console ${data_2}
253 ${resp}= Run Policy Api Post Request /policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies ${data_2}
254 #
255 # pre-encoded content version
256 #${data}= Fill JSON Template File ${POLICY_TEMPLATES}/vFirewall_policy_operational_input.template ${dict}
257 #${resp}= Run Policy Api Post Request /policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies ${data}
258 #
259 Should Be Equal As Strings ${resp.status_code} 200
260 [Return] ${resp.json()['policy-version']}
261
262
263
264
Brian Freemane14d2572019-04-29 16:20:21 -0500265
266Push vFirewall Policies To PDP Group
Brian Freeman75948282019-05-14 20:44:46 -0500267 [Arguments] ${op_policy_version}
268 ${dict}= Create Dictionary OP_POLICY_VERSION=${op_policy_version}
Brian Freemane14d2572019-04-29 16:20:21 -0500269 ${data}= Fill JSON Template File ${POLICY_TEMPLATES}/vFirewall_push.template ${dict}
Brian Freeman55b96e22019-05-08 20:49:45 -0500270 #${resp}= Run Policy Post Request /policy/pap/v1/pdps/policies ${data}
271 ${resp}= Run Policy Pap Post Request /policy/pap/v1/pdps/policies ${data}
272 #Should Be Equal As Strings ${resp.status_code} 200
Brian Freemane14d2572019-04-29 16:20:21 -0500273
Bilal A461aa5b2019-05-06 14:00:57 -0400274Run Policy API Healthcheck
275 [Documentation] Runs Policy Api Health check
276 ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD}
277 Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
Sylvain Desbureaux2e33ff62019-05-15 14:41:18 +0200278 ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth}
Bilal A461aa5b2019-05-06 14:00:57 -0400279 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
280 ${resp}= Get Request policy /policy/api/v1/healthcheck headers=${headers}
281 Log Received response from policy ${resp.text}
282 Should Be Equal As Strings ${resp.status_code} 200
283 Should Be Equal As Strings ${resp.json()['code']} 200
284
285Run Policy PAP Healthcheck
286 [Documentation] Runs Policy PAP Health check
287 ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD}
288 Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
Sylvain Desbureaux2e33ff62019-05-15 14:41:18 +0200289 ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth}
Bilal A461aa5b2019-05-06 14:00:57 -0400290 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
291 ${resp}= Get Request policy /policy/pap/v1/healthcheck headers=${headers}
292 Log Received response from policy ${resp.text}
293 Should Be Equal As Strings ${resp.status_code} 200
294 Should Be Equal As Strings ${resp.json()['code']} 200
295
296Run Policy Distribution Healthcheck
297 [Documentation] Runs Policy Distribution Health check
298 ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD}
299 Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_DISTRIBUTION_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
Sylvain Desbureaux2e33ff62019-05-15 14:41:18 +0200300 ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_DISTRIBUTION_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth}
Bilal A461aa5b2019-05-06 14:00:57 -0400301 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
302 ${resp}= Get Request policy /healthcheck headers=${headers}
303 Log Received response from policy ${resp.text}
304 Should Be Equal As Strings ${resp.status_code} 200
305 Should Be Equal As Strings ${resp.json()['code']} 200
306
307Run Policy XACML PDP Healthcheck
308 [Documentation] Runs Policy Xacml PDP Health check
309 ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD}
310 Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PDPX_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
311 ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PDPX_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth}
312 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
313 ${resp}= Get Request policy /policy/pdpx/v1/healthcheck headers=${headers}
314 Log Received response from policy ${resp.text}
315 Should Be Equal As Strings ${resp.status_code} 200
316 Should Be Equal As Strings ${resp.json()['code']} 200
317
318Run Policy APEX PDP Healthcheck
319 [Documentation] Runs Policy Apex PDP Health check
320 ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD}
321 Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_APEX_PDP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
Sylvain Desbureaux2e33ff62019-05-15 14:41:18 +0200322 ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_APEX_PDP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth}
Bilal A461aa5b2019-05-06 14:00:57 -0400323 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
324 ${resp}= Get Request policy /policy/apex-pdp/v1/healthcheck headers=${headers}
325 Log Received response from policy ${resp.text}
326 Should Be Equal As Strings ${resp.status_code} 200
327 Should Be Equal As Strings ${resp.json()['code']} 200
328