blob: d5f72924ca218075da92ef972de042ab0d98fbf3 [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
DR695Hccff30b2017-02-17 18:44:24 -05003Library RequestsLibrary
4Library String
5Library JSONUtils
Brian Freeman55b96e22019-05-08 20:49:45 -05006Library Collections
Sylvain Desbureaux2e33ff62019-05-15 14:41:18 +02007Library Collections
DR695H910097e2019-05-08 13:55:32 -04008Library SSHLibrary
9Library OperatingSystem
10Resource json_templater.robot
DR695Hccff30b2017-02-17 18:44:24 -050011Resource global_properties.robot
DR695H910097e2019-05-08 13:55:32 -040012Resource ssh/files.robot
DR695Hccff30b2017-02-17 18:44:24 -050013
14*** Variables ***
15${POLICY_HEALTH_CHECK_PATH} /healthcheck
DR695Hbf5a3a32017-06-30 13:09:57 -040016${POLICY_ENDPOINT} ${GLOBAL_POLICY_SERVER_PROTOCOL}://${GLOBAL_INJECTED_POLICY_IP_ADDR}:${GLOBAL_POLICY_SERVER_PORT}
Gary Wu251aa682018-07-30 15:22:20 -070017${POLICY_HEALTHCHECK_ENDPOINT} ${GLOBAL_POLICY_SERVER_PROTOCOL}://${GLOBAL_INJECTED_POLICY_HEALTHCHECK_IP_ADDR}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
Brian Freemanca5e32e2018-07-23 12:47:21 -050018${POLICY_TEMPLATES} robot/assets/templates/policy
Brian Freemand65e2aa2018-07-26 11:13:46 -050019${DROOLS_ENDPOINT} ${GLOBAL_POLICY_SERVER_PROTOCOL}://${GLOBAL_INJECTED_POLICY_IP_ADDR}:${GLOBAL_DROOLS_SERVER_PORT}
Bilal A461aa5b2019-05-06 14:00:57 -040020${POLICY_API_IP} ${GLOBAL_INJECTED_POLICY_API_IP_ADDR}
21${POLICY_PAP_IP} ${GLOBAL_INJECTED_POLICY_PAP_IP_ADDR}
22${POLICY_DISTRIBUTION_IP} ${GLOBAL_INJECTED_POLICY_DISTRIBUTION_IP_ADDR}
23${POLICY_PDPX_IP} ${GLOBAL_INJECTED_POLICY_PDPX_IP_ADDR}
24${POLICY_APEX_PDP_IP} ${GLOBAL_INJECTED_POLICY_APEX_PDP_IP_ADDR}
25${POLICY_HEALTHCHECK_USERNAME} ${GLOBAL_POLICY_HEALTHCHECK_USERNAME}
26${POLICY_HEALTHCHECK_PASSWORD} ${GLOBAL_POLICY_HEALTHCHECK_PASSWORD}
DR695Hccff30b2017-02-17 18:44:24 -050027
Brian Freeman88fbb992019-05-17 17:46:56 -050028
DR695Hccff30b2017-02-17 18:44:24 -050029*** Keywords ***
30
31Run Policy Health Check
32 [Documentation] Runs Policy Health check
Brian Freeman55b96e22019-05-08 20:49:45 -050033 ${auth}= Create List ${GLOBAL_POLICY_USERNAME} ${GLOBAL_POLICY_PASSWORD}
DR695Hbf5a3a32017-06-30 13:09:57 -040034 Log Creating session ${POLICY_ENDPOINT}
35 ${session}= Create Session policy ${POLICY_HEALTHCHECK_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -050036 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
37 ${resp}= Get Request policy ${POLICY_HEALTH_CHECK_PATH} headers=${headers}
38 Log Received response from policy ${resp.text}
39 Should Be Equal As Strings ${resp.status_code} 200
40 Should Be True ${resp.json()['healthy']}
41 @{ITEMS}= Copy List ${resp.json()['details']}
42 :FOR ${ELEMENT} IN @{ITEMS}
43 \ Should Be Equal As Strings ${ELEMENT['code']} 200
44 \ Should Be True ${ELEMENT['healthy']}
Brian Freeman55b96e22019-05-08 20:49:45 -050045
Brian Freemand65e2aa2018-07-26 11:13:46 -050046Run Drools Get Request
47 [Documentation] Runs Drools Get Request
48 [Arguments] ${data_path}
49 ${auth}= Create List ${GLOBAL_DROOLS_USERNAME} ${GLOBAL_DROOLS_PASSWORD}
50 Log Creating session ${POLICY_ENDPOINT}
51 ${session}= Create Session policy ${DROOLS_ENDPOINT} auth=${auth}
52 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
53 ${resp}= Get Request policy ${data_path} headers=${headers}
54 Log Received response from policy ${resp.text}
55 Should Be Equal As Strings ${resp.status_code} 200
56 [Return] ${resp}
57
DR695Hccff30b2017-02-17 18:44:24 -050058Run Policy Put Request
59 [Documentation] Runs Policy Put request
60 [Arguments] ${data_path} ${data}
DR695Hbf5a3a32017-06-30 13:09:57 -040061 Log Creating session ${POLICY_ENDPOINT}
62 ${session}= Create Session policy ${POLICY_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -050063 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json Authorization=Basic ${GLOBAL_POLICY_AUTH} ClientAuth=${GLOBAL_POLICY_CLIENTAUTH} Environment=TEST
64 ${resp}= Put Request policy ${data_path} data=${data} headers=${headers}
65 Log Received response from policy ${resp.text}
66 [Return] ${resp}
Brian Freemane14d2572019-04-29 16:20:21 -050067
Brian Freemanc967dd62019-04-30 09:47:44 -050068Run Policy Get Request
69 [Documentation] Runs Policy Get request
70 [Arguments] ${data_path}
71 Log Creating session ${POLICY_ENDPOINT}
72 ${session}= Create Session policy ${POLICY_ENDPOINT}
73 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json Authorization=Basic ${GLOBAL_POLICY_AUTH} ClientAuth=${GLOBAL_POLICY_CLIENTAUTH} Environment=TEST
74 ${resp}= Get Request policy ${data_path} headers=${headers}
75 Log Received response from policy ${resp.text}
76
Brian Freeman55b96e22019-05-08 20:49:45 -050077Run Policy Pap Get Request
78 [Documentation] Runs Policy Pap Get request
79 [Arguments] ${data_path}
80 ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD}
81 Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
Sylvain Desbureaux2e33ff62019-05-15 14:41:18 +020082 ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth}
Brian Freeman55b96e22019-05-08 20:49:45 -050083 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
84 ${resp}= Get Request policy ${data_path} headers=${headers}
85 Log Received response from Policy Pap ${resp.text}
86 [Return] ${resp}
87
88
Brian Freemane14d2572019-04-29 16:20:21 -050089Run Policy Post Request
90 [Documentation] Runs Policy Post request
91 [Arguments] ${data_path} ${data}
92 Log Creating session ${POLICY_ENDPOINT}
93 ${session}= Create Session policy ${POLICY_ENDPOINT}
94 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json Authorization=Basic ${GLOBAL_POLICY_AUTH} ClientAuth=${GLOBAL_POLICY_CLIENTAUTH} Environment=TEST
95 ${resp}= Post Request policy ${data_path} data=${data} headers=${headers}
96 Log Received response from policy ${resp.text}
97 [Return] ${resp}
Brian Freemanc967dd62019-04-30 09:47:44 -050098
Brian Freeman55b96e22019-05-08 20:49:45 -050099Run Policy Api Post Request
100 [Documentation] Runs Policy Api Post request
101 [Arguments] ${data_path} ${data}
102 ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD}
Sylvain Desbureaux2e33ff62019-05-15 14:41:18 +0200103 ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth}
Brian Freeman55b96e22019-05-08 20:49:45 -0500104 Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
105 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
106 ${resp}= Post Request policy ${data_path} data=${data} headers=${headers}
107 Log Received response from policy ${resp.text}
108 [Return] ${resp}
109
110
111Run Policy Pap Post Request
112 [Documentation] Runs Policy Pap Post request
113 [Arguments] ${data_path} ${data}
114 ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD}
Sylvain Desbureaux2e33ff62019-05-15 14:41:18 +0200115 ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth}
Brian Freeman55b96e22019-05-08 20:49:45 -0500116 Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
117 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
118 ${resp}= Post Request policy ${data_path} data=${data} headers=${headers}
119 Log Received response from policy ${resp.text}
120 [Return] ${resp}
121
122
DR695Hccff30b2017-02-17 18:44:24 -0500123Run Policy Delete Request
124 [Documentation] Runs Policy Delete request
125 [Arguments] ${data_path} ${data}
DR695Hbf5a3a32017-06-30 13:09:57 -0400126 Log Creating session ${POLICY_ENDPOINT}
127 ${session}= Create Session policy ${POLICY_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500128 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json Authorization=Basic ${GLOBAL_POLICY_AUTH} ClientAuth=${GLOBAL_POLICY_CLIENTAUTH} Environment=TEST
129 ${resp}= Delete Request policy ${data_path} data=${data} headers=${headers}
130 Log Received response from policy ${resp.text}
131 [Return] ${resp}
Brian Freeman55b96e22019-05-08 20:49:45 -0500132
DR695Hccff30b2017-02-17 18:44:24 -0500133Run Policy Get Configs Request
134 [Documentation] Runs Policy Get Configs request
135 [Arguments] ${data_path} ${data}
DR695Hbf5a3a32017-06-30 13:09:57 -0400136 Log Creating session ${POLICY_ENDPOINT}
137 ${session}= Create Session policy ${POLICY_ENDPOINT}
Brian Freeman55b96e22019-05-08 20:49:45 -0500138 ${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 -0500139 ${resp}= Post Request policy ${data_path} data=${data} headers=${headers}
140 Log Received response from policy ${resp.text}
Gary Wu76bc74f2018-03-22 13:25:49 -0700141 [Return] ${resp}
142
143
144
Brian Freemanc967dd62019-04-30 09:47:44 -0500145Update vVFWCL Policy Old
Gary Wu76bc74f2018-03-22 13:25:49 -0700146 [Arguments] ${resource_id}
Brian Freemanca5e32e2018-07-23 12:47:21 -0500147 Run Keyword and Ignore Error Delete vFWCL Policy
Gary Wu76bc74f2018-03-22 13:25:49 -0700148 Sleep 20s
Brian Freemand65e2aa2018-07-26 11:13:46 -0500149 Log To Console Create vFWCL Policy
Gary Wu76bc74f2018-03-22 13:25:49 -0700150 Create vFWCL Policy ${resource_id}
151 Sleep 5s
Brian Freemand65e2aa2018-07-26 11:13:46 -0500152 Log To Console Push vFWCL Policy
Gary Wu76bc74f2018-03-22 13:25:49 -0700153 Push vFWCL Policy
154 Sleep 20s
Brian Freemand65e2aa2018-07-26 11:13:46 -0500155 Log To Console Reboot Drools
Gary Wu76bc74f2018-03-22 13:25:49 -0700156 Reboot Drools
157 Sleep 20s
Brian Freemand65e2aa2018-07-26 11:13:46 -0500158 Log To Console Validate vFWCL Policy
Brian Freemanc967dd62019-04-30 09:47:44 -0500159 Validate the vFWCL Policy Old
160
161Update vVFWCL Policy
Brian Freeman0d866b52019-05-08 20:30:14 -0500162 [Arguments] ${resource_id}
Brian Freeman55b96e22019-05-08 20:49:45 -0500163 Log To Console Create vFWCL Monitoring Policy
Brian Freemanc967dd62019-04-30 09:47:44 -0500164 Create vFirewall Monitoring Policy
165 Sleep 5s
Brian Freeman55b96e22019-05-08 20:49:45 -0500166 Log To Console Create vFWCL Operational Policy
Brian Freeman75948282019-05-14 20:44:46 -0500167 ${op_policy_version}= Create vFirewall Operational Policy ${resource_id}
Brian Freemanc967dd62019-04-30 09:47:44 -0500168 Sleep 5s
Brian Freeman55b96e22019-05-08 20:49:45 -0500169 Log To Console Push vFWCL To PDP Group
Brian Freeman75948282019-05-14 20:44:46 -0500170 Push vFirewall Policies To PDP Group ${op_policy_version}
Brian Freemanc967dd62019-04-30 09:47:44 -0500171 Sleep 20s
172 Log To Console Validate vFWCL Policy
Gary Wu76bc74f2018-03-22 13:25:49 -0700173 Validate the vFWCL Policy
174
Brian Freemanc967dd62019-04-30 09:47:44 -0500175
Gary Wu76bc74f2018-03-22 13:25:49 -0700176Delete vFWCL Policy
177 ${data}= OperatingSystem.Get File ${POLICY_TEMPLATES}/FirewallPolicy_delete.template
178 ${resp}= Run Policy Delete Request /pdp/api/deletePolicy ${data}
179 Should Be Equal As Strings ${resp.status_code} 200
180
181Create vFWCL Policy
182 [Arguments] ${resource_id}
183 ${dict}= Create Dictionary RESOURCE_ID=${resource_id}
184 ${data}= Fill JSON Template File ${POLICY_TEMPLATES}/FirewallPolicy_update.template ${dict}
185 ${resp}= Run Policy Put Request /pdp/api/updatePolicy ${data}
186 Should Be Equal As Strings ${resp.status_code} 200
187
188Push vFWCL Policy
189 ${dict}= Create Dictionary
190 ${data}= Fill JSON Template File ${POLICY_TEMPLATES}/FirewallPolicy_push.template ${dict}
191 ${resp}= Run Policy Put Request /pdp/api/pushPolicy ${data}
192 Should Be Equal As Strings ${resp.status_code} 200
193
194Reboot Drools
195 ${stop}= Catenate docker exec -t -u policy drools bash -c "source /opt/app/policy/etc/profile.d/env.sh; policy stop"
196 ${start}= Catenate docker exec -t -u policy drools bash -c "source /opt/app/policy/etc/profile.d/env.sh; policy start"
197 Wait Until Keyword Succeeds 120 5 sec Open Connection And Log In ${GLOBAL_INJECTED_POLICY_IP_ADDR} root ${GLOBAL_VM_PRIVATE_KEY}
198 Write ${stop}
199 ${status} ${stdout}= Run Keyword And Ignore Error SSHLibrary.Read Until Regexp has stopped
200 Log ${status}: stdout=${stdout}
201 ${ctrlc}= Evaluate '\x03'
202 Run Keyword If '${status}' == 'FAIL' Write ${ctrlc}
203 Sleep 5s
204 Write ${start}
205 ${stdout}= SSHLibrary.Read Until Regexp is running
206 Log stdout=${stdout}
207 Should Contain ${stdout} is running
208
Brian Freemanc967dd62019-04-30 09:47:44 -0500209Validate the vFWCL Policy Old
Gary Wu76bc74f2018-03-22 13:25:49 -0700210 ${resp}= Run Drools Get Request /policy/pdp/engine/controllers/amsterdam/drools
211 Should Be Equal As Strings ${resp.status_code} 200
212 ${resp}= Run Drools Get Request /policy/pdp/engine/controllers/amsterdam/drools/facts/closedloop-amsterdam/org.onap.policy.controlloop.Params
213 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemane14d2572019-04-29 16:20:21 -0500214
Brian Freeman55b96e22019-05-08 20:49:45 -0500215Validate the vFWCL Policy
216 ${resp}= Run Policy Pap Get Request /policy/pap/v1/pdps
Brian Freemanc967dd62019-04-30 09:47:44 -0500217 Log Received response from policy ${resp.text}
218 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemane14d2572019-04-29 16:20:21 -0500219
220Create vFirewall Monitoring Policy
221 ${dict}= Create Dictionary
222 ${data}= Fill JSON Template File ${POLICY_TEMPLATES}/vFirewall_policy_monitoring_input_tosca.template ${dict}
Brian Freeman55b96e22019-05-08 20:49:45 -0500223 ${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 -0500224 Should Be Equal As Strings ${resp.status_code} 200
225
Brian Freeman88fbb992019-05-17 17:46:56 -0500226Create vFirewall Operational Policy
227 [Arguments] ${resource_id}
228 ${dict}= Create Dictionary RESOURCE_ID=${resource_id}
229 ${content_data} OperatingSystem.Get File ${POLICY_TEMPLATES}/vFirewall_policy_operational_content.yaml
230 ${content_data}= Replace String Using Regexp ${content_data} __RESOURCE_ID__ ${resource_id}
231 ${encoded_content_data}= Evaluate urllib.quote_plus('''${content_data}''') urllib
232 ${content_dictionary}= Create Dictionary URL_ENCODED_CONTENT ${encoded_content_data}
233 ${data_2}= Fill JSON Template File ${POLICY_TEMPLATES}/vFirewall_policy_operational_url_enc_content_input.template ${content_dictionary}
234 Log To Console ${data_2}
235 ${resp}= Run Policy Api Post Request /policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies ${data_2}
236 #
237 # pre-encoded content version
238 #${data}= Fill JSON Template File ${POLICY_TEMPLATES}/vFirewall_policy_operational_input.template ${dict}
239 #${resp}= Run Policy Api Post Request /policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies ${data}
240 #
241 Should Be Equal As Strings ${resp.status_code} 200
242 [Return] ${resp.json()['policy-version']}
243
Brian Freemane14d2572019-04-29 16:20:21 -0500244Push vFirewall Policies To PDP Group
Brian Freeman75948282019-05-14 20:44:46 -0500245 [Arguments] ${op_policy_version}
246 ${dict}= Create Dictionary OP_POLICY_VERSION=${op_policy_version}
Brian Freemane14d2572019-04-29 16:20:21 -0500247 ${data}= Fill JSON Template File ${POLICY_TEMPLATES}/vFirewall_push.template ${dict}
Brian Freeman55b96e22019-05-08 20:49:45 -0500248 #${resp}= Run Policy Post Request /policy/pap/v1/pdps/policies ${data}
249 ${resp}= Run Policy Pap Post Request /policy/pap/v1/pdps/policies ${data}
Brian Freeman60831812019-05-23 20:16:16 -0500250 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemane14d2572019-04-29 16:20:21 -0500251
Bilal A461aa5b2019-05-06 14:00:57 -0400252Run Policy API Healthcheck
253 [Documentation] Runs Policy Api Health check
254 ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD}
255 Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
Sylvain Desbureaux2e33ff62019-05-15 14:41:18 +0200256 ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth}
Bilal A461aa5b2019-05-06 14:00:57 -0400257 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
258 ${resp}= Get Request policy /policy/api/v1/healthcheck headers=${headers}
259 Log Received response from policy ${resp.text}
260 Should Be Equal As Strings ${resp.status_code} 200
261 Should Be Equal As Strings ${resp.json()['code']} 200
262
263Run Policy PAP Healthcheck
264 [Documentation] Runs Policy PAP Health check
265 ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD}
266 Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
Sylvain Desbureaux2e33ff62019-05-15 14:41:18 +0200267 ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth}
Bilal A461aa5b2019-05-06 14:00:57 -0400268 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
269 ${resp}= Get Request policy /policy/pap/v1/healthcheck headers=${headers}
270 Log Received response from policy ${resp.text}
271 Should Be Equal As Strings ${resp.status_code} 200
272 Should Be Equal As Strings ${resp.json()['code']} 200
273
274Run Policy Distribution Healthcheck
275 [Documentation] Runs Policy Distribution Health check
276 ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD}
277 Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_DISTRIBUTION_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
Sylvain Desbureaux2e33ff62019-05-15 14:41:18 +0200278 ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_DISTRIBUTION_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 /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 XACML PDP Healthcheck
286 [Documentation] Runs Policy Xacml PDP Health check
287 ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD}
288 Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PDPX_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
289 ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PDPX_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth}
290 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
291 ${resp}= Get Request policy /policy/pdpx/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 APEX PDP Healthcheck
297 [Documentation] Runs Policy Apex PDP Health check
298 ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD}
299 Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_APEX_PDP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
Sylvain Desbureaux2e33ff62019-05-15 14:41:18 +0200300 ${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 -0400301 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
302 ${resp}= Get Request policy /policy/apex-pdp/v1/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