blob: 077edd750e9a2653277d5f3217df1a937673df12 [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
Sylvain Desbureaux2e33ff62019-05-15 14:41:18 +02005Library Collections
DR695H910097e2019-05-08 13:55:32 -04006Library SSHLibrary
7Library OperatingSystem
DR695H34409422019-06-20 10:56:46 -04008Library ONAPLibrary.Templating
DR695Hccff30b2017-02-17 18:44:24 -05009Resource global_properties.robot
DR695H910097e2019-05-08 13:55:32 -040010Resource ssh/files.robot
DR695Hccff30b2017-02-17 18:44:24 -050011
12*** Variables ***
13${POLICY_HEALTH_CHECK_PATH} /healthcheck
DR695Hbf5a3a32017-06-30 13:09:57 -040014${POLICY_ENDPOINT} ${GLOBAL_POLICY_SERVER_PROTOCOL}://${GLOBAL_INJECTED_POLICY_IP_ADDR}:${GLOBAL_POLICY_SERVER_PORT}
Gary Wu251aa682018-07-30 15:22:20 -070015${POLICY_HEALTHCHECK_ENDPOINT} ${GLOBAL_POLICY_SERVER_PROTOCOL}://${GLOBAL_INJECTED_POLICY_HEALTHCHECK_IP_ADDR}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
DR695H34409422019-06-20 10:56:46 -040016${POLICY_TEMPLATES} policy
Brian Freemand65e2aa2018-07-26 11:13:46 -050017${DROOLS_ENDPOINT} ${GLOBAL_POLICY_SERVER_PROTOCOL}://${GLOBAL_INJECTED_POLICY_IP_ADDR}:${GLOBAL_DROOLS_SERVER_PORT}
Bilal A461aa5b2019-05-06 14:00:57 -040018${POLICY_API_IP} ${GLOBAL_INJECTED_POLICY_API_IP_ADDR}
19${POLICY_PAP_IP} ${GLOBAL_INJECTED_POLICY_PAP_IP_ADDR}
20${POLICY_DISTRIBUTION_IP} ${GLOBAL_INJECTED_POLICY_DISTRIBUTION_IP_ADDR}
21${POLICY_PDPX_IP} ${GLOBAL_INJECTED_POLICY_PDPX_IP_ADDR}
22${POLICY_APEX_PDP_IP} ${GLOBAL_INJECTED_POLICY_APEX_PDP_IP_ADDR}
23${POLICY_HEALTHCHECK_USERNAME} ${GLOBAL_POLICY_HEALTHCHECK_USERNAME}
24${POLICY_HEALTHCHECK_PASSWORD} ${GLOBAL_POLICY_HEALTHCHECK_PASSWORD}
DR695Hccff30b2017-02-17 18:44:24 -050025
Brian Freeman88fbb992019-05-17 17:46:56 -050026
DR695Hccff30b2017-02-17 18:44:24 -050027*** Keywords ***
28
29Run Policy Health Check
30 [Documentation] Runs Policy Health check
Brian Freeman55b96e22019-05-08 20:49:45 -050031 ${auth}= Create List ${GLOBAL_POLICY_USERNAME} ${GLOBAL_POLICY_PASSWORD}
DR695Hbf5a3a32017-06-30 13:09:57 -040032 Log Creating session ${POLICY_ENDPOINT}
33 ${session}= Create Session policy ${POLICY_HEALTHCHECK_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -050034 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
35 ${resp}= Get Request policy ${POLICY_HEALTH_CHECK_PATH} headers=${headers}
36 Log Received response from policy ${resp.text}
37 Should Be Equal As Strings ${resp.status_code} 200
38 Should Be True ${resp.json()['healthy']}
39 @{ITEMS}= Copy List ${resp.json()['details']}
40 :FOR ${ELEMENT} IN @{ITEMS}
41 \ Should Be Equal As Strings ${ELEMENT['code']} 200
42 \ Should Be True ${ELEMENT['healthy']}
Brian Freeman55b96e22019-05-08 20:49:45 -050043
Brian Freemand65e2aa2018-07-26 11:13:46 -050044Run Drools Get Request
45 [Documentation] Runs Drools Get Request
46 [Arguments] ${data_path}
47 ${auth}= Create List ${GLOBAL_DROOLS_USERNAME} ${GLOBAL_DROOLS_PASSWORD}
48 Log Creating session ${POLICY_ENDPOINT}
49 ${session}= Create Session policy ${DROOLS_ENDPOINT} auth=${auth}
50 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
51 ${resp}= Get Request policy ${data_path} headers=${headers}
52 Log Received response from policy ${resp.text}
53 Should Be Equal As Strings ${resp.status_code} 200
54 [Return] ${resp}
55
DR695Hccff30b2017-02-17 18:44:24 -050056Run Policy Put Request
57 [Documentation] Runs Policy Put request
58 [Arguments] ${data_path} ${data}
DR695Hbf5a3a32017-06-30 13:09:57 -040059 Log Creating session ${POLICY_ENDPOINT}
60 ${session}= Create Session policy ${POLICY_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -050061 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json Authorization=Basic ${GLOBAL_POLICY_AUTH} ClientAuth=${GLOBAL_POLICY_CLIENTAUTH} Environment=TEST
62 ${resp}= Put Request policy ${data_path} data=${data} headers=${headers}
63 Log Received response from policy ${resp.text}
64 [Return] ${resp}
Brian Freemane14d2572019-04-29 16:20:21 -050065
Brian Freemanc967dd62019-04-30 09:47:44 -050066Run Policy Get Request
67 [Documentation] Runs Policy Get request
68 [Arguments] ${data_path}
69 Log Creating session ${POLICY_ENDPOINT}
70 ${session}= Create Session policy ${POLICY_ENDPOINT}
71 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json Authorization=Basic ${GLOBAL_POLICY_AUTH} ClientAuth=${GLOBAL_POLICY_CLIENTAUTH} Environment=TEST
72 ${resp}= Get Request policy ${data_path} headers=${headers}
73 Log Received response from policy ${resp.text}
74
Brian Freeman55b96e22019-05-08 20:49:45 -050075Run Policy Pap Get Request
76 [Documentation] Runs Policy Pap Get request
77 [Arguments] ${data_path}
78 ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD}
79 Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
Sylvain Desbureaux2e33ff62019-05-15 14:41:18 +020080 ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth}
Brian Freeman55b96e22019-05-08 20:49:45 -050081 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
82 ${resp}= Get Request policy ${data_path} headers=${headers}
83 Log Received response from Policy Pap ${resp.text}
84 [Return] ${resp}
85
86
Brian Freemane14d2572019-04-29 16:20:21 -050087Run Policy Post Request
88 [Documentation] Runs Policy Post request
89 [Arguments] ${data_path} ${data}
90 Log Creating session ${POLICY_ENDPOINT}
91 ${session}= Create Session policy ${POLICY_ENDPOINT}
92 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json Authorization=Basic ${GLOBAL_POLICY_AUTH} ClientAuth=${GLOBAL_POLICY_CLIENTAUTH} Environment=TEST
93 ${resp}= Post Request policy ${data_path} data=${data} headers=${headers}
94 Log Received response from policy ${resp.text}
95 [Return] ${resp}
Brian Freemanc967dd62019-04-30 09:47:44 -050096
Brian Freeman55b96e22019-05-08 20:49:45 -050097Run Policy Api Post Request
98 [Documentation] Runs Policy Api Post request
99 [Arguments] ${data_path} ${data}
100 ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD}
Sylvain Desbureaux2e33ff62019-05-15 14:41:18 +0200101 ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth}
Brian Freeman55b96e22019-05-08 20:49:45 -0500102 Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
103 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
104 ${resp}= Post Request policy ${data_path} data=${data} headers=${headers}
105 Log Received response from policy ${resp.text}
106 [Return] ${resp}
107
108
109Run Policy Pap Post Request
110 [Documentation] Runs Policy Pap Post request
111 [Arguments] ${data_path} ${data}
112 ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD}
Sylvain Desbureaux2e33ff62019-05-15 14:41:18 +0200113 ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth}
Brian Freeman55b96e22019-05-08 20:49:45 -0500114 Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
115 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
116 ${resp}= Post Request policy ${data_path} data=${data} headers=${headers}
117 Log Received response from policy ${resp.text}
118 [Return] ${resp}
119
120
DR695Hccff30b2017-02-17 18:44:24 -0500121Run Policy Delete Request
122 [Documentation] Runs Policy Delete request
123 [Arguments] ${data_path} ${data}
DR695Hbf5a3a32017-06-30 13:09:57 -0400124 Log Creating session ${POLICY_ENDPOINT}
125 ${session}= Create Session policy ${POLICY_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -0500126 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json Authorization=Basic ${GLOBAL_POLICY_AUTH} ClientAuth=${GLOBAL_POLICY_CLIENTAUTH} Environment=TEST
127 ${resp}= Delete Request policy ${data_path} data=${data} headers=${headers}
128 Log Received response from policy ${resp.text}
129 [Return] ${resp}
Brian Freeman55b96e22019-05-08 20:49:45 -0500130
DR695Hccff30b2017-02-17 18:44:24 -0500131Run Policy Get Configs Request
132 [Documentation] Runs Policy Get Configs request
133 [Arguments] ${data_path} ${data}
DR695Hbf5a3a32017-06-30 13:09:57 -0400134 Log Creating session ${POLICY_ENDPOINT}
135 ${session}= Create Session policy ${POLICY_ENDPOINT}
Brian Freeman55b96e22019-05-08 20:49:45 -0500136 ${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 -0500137 ${resp}= Post Request policy ${data_path} data=${data} headers=${headers}
138 Log Received response from policy ${resp.text}
Gary Wu76bc74f2018-03-22 13:25:49 -0700139 [Return] ${resp}
140
141
142
Brian Freemanc967dd62019-04-30 09:47:44 -0500143Update vVFWCL Policy Old
Gary Wu76bc74f2018-03-22 13:25:49 -0700144 [Arguments] ${resource_id}
Brian Freemanca5e32e2018-07-23 12:47:21 -0500145 Run Keyword and Ignore Error Delete vFWCL Policy
Gary Wu76bc74f2018-03-22 13:25:49 -0700146 Sleep 20s
DR695H8e7028b2019-07-10 10:13:58 -0400147 Log Create vFWCL Policy
Gary Wu76bc74f2018-03-22 13:25:49 -0700148 Create vFWCL Policy ${resource_id}
149 Sleep 5s
DR695H8e7028b2019-07-10 10:13:58 -0400150 Log Push vFWCL Policy
Gary Wu76bc74f2018-03-22 13:25:49 -0700151 Push vFWCL Policy
152 Sleep 20s
DR695H8e7028b2019-07-10 10:13:58 -0400153 Log Reboot Drools
Gary Wu76bc74f2018-03-22 13:25:49 -0700154 Reboot Drools
155 Sleep 20s
DR695H8e7028b2019-07-10 10:13:58 -0400156 Log Validate vFWCL Policy
Brian Freemanc967dd62019-04-30 09:47:44 -0500157 Validate the vFWCL Policy Old
158
159Update vVFWCL Policy
Brian Freeman0d866b52019-05-08 20:30:14 -0500160 [Arguments] ${resource_id}
DR695H8e7028b2019-07-10 10:13:58 -0400161 Log Create vFWCL Monitoring Policy
Brian Freemanc967dd62019-04-30 09:47:44 -0500162 Create vFirewall Monitoring Policy
163 Sleep 5s
DR695H8e7028b2019-07-10 10:13:58 -0400164 Log Create vFWCL Operational Policy
Brian Freeman75948282019-05-14 20:44:46 -0500165 ${op_policy_version}= Create vFirewall Operational Policy ${resource_id}
Brian Freemanc967dd62019-04-30 09:47:44 -0500166 Sleep 5s
DR695H8e7028b2019-07-10 10:13:58 -0400167 Log Push vFWCL To PDP Group
Brian Freeman75948282019-05-14 20:44:46 -0500168 Push vFirewall Policies To PDP Group ${op_policy_version}
Brian Freemanc967dd62019-04-30 09:47:44 -0500169 Sleep 20s
DR695H8e7028b2019-07-10 10:13:58 -0400170 Log Validate vFWCL Policy
Gary Wu76bc74f2018-03-22 13:25:49 -0700171 Validate the vFWCL Policy
172
Brian Freemanc967dd62019-04-30 09:47:44 -0500173
Gary Wu76bc74f2018-03-22 13:25:49 -0700174Delete vFWCL Policy
DR695H34409422019-06-20 10:56:46 -0400175 Create Environment policy ${GLOBAL_TEMPLATE_FOLDER}
176 ${dict}= Create Dictionary policyName=com.BRMSParamvFirewall
177 ${data}= Apply Template policy ${POLICY_TEMPLATES}/FirewallPolicy_delete.jinja ${dict}
178 ${resp}= Run Policy Delete Request /pdp/api/deletePolicy ${data}
179 Should Be Equal As Strings ${resp.status_code} 200
Gary Wu76bc74f2018-03-22 13:25:49 -0700180
181Create vFWCL Policy
182 [Arguments] ${resource_id}
183 ${dict}= Create Dictionary RESOURCE_ID=${resource_id}
DR695H34409422019-06-20 10:56:46 -0400184 Create Environment policy ${GLOBAL_TEMPLATE_FOLDER}
185 ${data}= Apply Template policy ${POLICY_TEMPLATES}/FirewallPolicy_update.jinja ${dict}
Gary Wu76bc74f2018-03-22 13:25:49 -0700186 ${resp}= Run Policy Put Request /pdp/api/updatePolicy ${data}
187 Should Be Equal As Strings ${resp.status_code} 200
188
189Push vFWCL Policy
DR695H34409422019-06-20 10:56:46 -0400190 Create Environment policy ${GLOBAL_TEMPLATE_FOLDER}
191 ${dict}= Create Dictionary
192 ${data}= Apply Template policy ${POLICY_TEMPLATES}/FirewallPolicy_push.jinja ${dict}
193 ${resp}= Run Policy Put Request /pdp/api/pushPolicy ${data}
194 Should Be Equal As Strings ${resp.status_code} 200
Gary Wu76bc74f2018-03-22 13:25:49 -0700195
196Reboot Drools
197 ${stop}= Catenate docker exec -t -u policy drools bash -c "source /opt/app/policy/etc/profile.d/env.sh; policy stop"
198 ${start}= Catenate docker exec -t -u policy drools bash -c "source /opt/app/policy/etc/profile.d/env.sh; policy start"
199 Wait Until Keyword Succeeds 120 5 sec Open Connection And Log In ${GLOBAL_INJECTED_POLICY_IP_ADDR} root ${GLOBAL_VM_PRIVATE_KEY}
200 Write ${stop}
201 ${status} ${stdout}= Run Keyword And Ignore Error SSHLibrary.Read Until Regexp has stopped
202 Log ${status}: stdout=${stdout}
203 ${ctrlc}= Evaluate '\x03'
204 Run Keyword If '${status}' == 'FAIL' Write ${ctrlc}
205 Sleep 5s
206 Write ${start}
207 ${stdout}= SSHLibrary.Read Until Regexp is running
208 Log stdout=${stdout}
209 Should Contain ${stdout} is running
210
Brian Freemanc967dd62019-04-30 09:47:44 -0500211Validate the vFWCL Policy Old
Gary Wu76bc74f2018-03-22 13:25:49 -0700212 ${resp}= Run Drools Get Request /policy/pdp/engine/controllers/amsterdam/drools
213 Should Be Equal As Strings ${resp.status_code} 200
214 ${resp}= Run Drools Get Request /policy/pdp/engine/controllers/amsterdam/drools/facts/closedloop-amsterdam/org.onap.policy.controlloop.Params
215 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemane14d2572019-04-29 16:20:21 -0500216
Brian Freeman55b96e22019-05-08 20:49:45 -0500217Validate the vFWCL Policy
218 ${resp}= Run Policy Pap Get Request /policy/pap/v1/pdps
Brian Freemanc967dd62019-04-30 09:47:44 -0500219 Log Received response from policy ${resp.text}
220 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemane14d2572019-04-29 16:20:21 -0500221
222Create vFirewall Monitoring Policy
223 ${dict}= Create Dictionary
DR695H34409422019-06-20 10:56:46 -0400224 Create Environment policy ${GLOBAL_TEMPLATE_FOLDER}
225 ${data}= Apply Template policy ${POLICY_TEMPLATES}/vFirewall_policy_monitoring_input_tosca.jinja ${dict}
Brian Freeman55b96e22019-05-08 20:49:45 -0500226 ${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 -0500227 Should Be Equal As Strings ${resp.status_code} 200
228
Brian Freeman88fbb992019-05-17 17:46:56 -0500229Create vFirewall Operational Policy
DR695H34409422019-06-20 10:56:46 -0400230 [Arguments] ${resource_id}
231 ${dict}= Create Dictionary RESOURCE_ID=${resource_id}
232 Create Environment policy ${GLOBAL_TEMPLATE_FOLDER}
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.quote_plus('''${content_data}''') urllib
236 ${content_dictionary}= Create Dictionary URL_ENCODED_CONTENT ${encoded_content_data}
237 ${data_2}= Apply Template policy ${POLICY_TEMPLATES}/vFirewall_policy_operational_url_enc_content_input.jinja ${content_dictionary}
DR695H8e7028b2019-07-10 10:13:58 -0400238 Log ${data_2}
DR695H34409422019-06-20 10:56:46 -0400239 ${resp}= Run Policy Api Post Request /policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies ${data_2}
240 Should Be Equal As Strings ${resp.status_code} 200
241 [Return] ${resp.json()['policy-version']}
Brian Freeman88fbb992019-05-17 17:46:56 -0500242
Brian Freemane14d2572019-04-29 16:20:21 -0500243Push vFirewall Policies To PDP Group
DR695H34409422019-06-20 10:56:46 -0400244 [Arguments] ${op_policy_version}
245 ${dict}= Create Dictionary OP_POLICY_VERSION=${op_policy_version}
246 Create Environment policy ${GLOBAL_TEMPLATE_FOLDER}
247 ${data}= Apply Template policy ${POLICY_TEMPLATES}/vFirewall_push.jinja ${dict}
248 ${resp}= Run Policy Pap Post Request /policy/pap/v1/pdps/policies ${data}
249 Should Be Equal As Strings ${resp.status_code} 200
Brian Freemane14d2572019-04-29 16:20:21 -0500250
Bilal A461aa5b2019-05-06 14:00:57 -0400251Run Policy API Healthcheck
252 [Documentation] Runs Policy Api Health check
253 ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD}
254 Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
Sylvain Desbureaux2e33ff62019-05-15 14:41:18 +0200255 ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth}
Bilal A461aa5b2019-05-06 14:00:57 -0400256 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
257 ${resp}= Get Request policy /policy/api/v1/healthcheck headers=${headers}
258 Log Received response from policy ${resp.text}
259 Should Be Equal As Strings ${resp.status_code} 200
260 Should Be Equal As Strings ${resp.json()['code']} 200
261
262Run Policy PAP Healthcheck
263 [Documentation] Runs Policy PAP Health check
264 ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD}
265 Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
Sylvain Desbureaux2e33ff62019-05-15 14:41:18 +0200266 ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth}
Bilal A461aa5b2019-05-06 14:00:57 -0400267 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
268 ${resp}= Get Request policy /policy/pap/v1/healthcheck headers=${headers}
269 Log Received response from policy ${resp.text}
270 Should Be Equal As Strings ${resp.status_code} 200
271 Should Be Equal As Strings ${resp.json()['code']} 200
272
273Run Policy Distribution Healthcheck
274 [Documentation] Runs Policy Distribution Health check
275 ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD}
276 Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_DISTRIBUTION_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
Sylvain Desbureaux2e33ff62019-05-15 14:41:18 +0200277 ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_DISTRIBUTION_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth}
Bilal A461aa5b2019-05-06 14:00:57 -0400278 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
279 ${resp}= Get Request policy /healthcheck headers=${headers}
280 Log Received response from policy ${resp.text}
281 Should Be Equal As Strings ${resp.status_code} 200
282 Should Be Equal As Strings ${resp.json()['code']} 200
283
284Run Policy XACML PDP Healthcheck
285 [Documentation] Runs Policy Xacml PDP Health check
286 ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD}
287 Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PDPX_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
288 ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PDPX_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth}
289 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
290 ${resp}= Get Request policy /policy/pdpx/v1/healthcheck headers=${headers}
291 Log Received response from policy ${resp.text}
292 Should Be Equal As Strings ${resp.status_code} 200
293 Should Be Equal As Strings ${resp.json()['code']} 200
294
295Run Policy APEX PDP Healthcheck
296 [Documentation] Runs Policy Apex PDP Health check
297 ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD}
298 Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_APEX_PDP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
Sylvain Desbureaux2e33ff62019-05-15 14:41:18 +0200299 ${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 -0400300 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
301 ${resp}= Get Request policy /policy/apex-pdp/v1/healthcheck headers=${headers}
302 Log Received response from policy ${resp.text}
303 Should Be Equal As Strings ${resp.status_code} 200
304 Should Be Equal As Strings ${resp.json()['code']} 200
305