DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation The main interface for interacting with Policy. It handles low level stuff like managing the http request library and Policy required fields |
| 3 | Library RequestsClientCert |
| 4 | Library RequestsLibrary |
| 5 | Library String |
| 6 | Library JSONUtils |
Brian Freeman | 55b96e2 | 2019-05-08 20:49:45 -0500 | [diff] [blame] | 7 | Library Collections |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 8 | Library Collections |
| 9 | Library SSHLibrary |
| 10 | Library OperatingSystem |
| 11 | Resource json_templater.robot |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 12 | Resource global_properties.robot |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 13 | Resource ssh/files.robot |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 14 | |
| 15 | *** Variables *** |
| 16 | ${POLICY_HEALTH_CHECK_PATH} /healthcheck |
DR695H | bf5a3a3 | 2017-06-30 13:09:57 -0400 | [diff] [blame] | 17 | ${POLICY_ENDPOINT} ${GLOBAL_POLICY_SERVER_PROTOCOL}://${GLOBAL_INJECTED_POLICY_IP_ADDR}:${GLOBAL_POLICY_SERVER_PORT} |
Gary Wu | 251aa68 | 2018-07-30 15:22:20 -0700 | [diff] [blame] | 18 | ${POLICY_HEALTHCHECK_ENDPOINT} ${GLOBAL_POLICY_SERVER_PROTOCOL}://${GLOBAL_INJECTED_POLICY_HEALTHCHECK_IP_ADDR}:${GLOBAL_POLICY_HEALTHCHECK_PORT} |
Brian Freeman | ca5e32e | 2018-07-23 12:47:21 -0500 | [diff] [blame] | 19 | ${POLICY_TEMPLATES} robot/assets/templates/policy |
Brian Freeman | d65e2aa | 2018-07-26 11:13:46 -0500 | [diff] [blame] | 20 | ${DROOLS_ENDPOINT} ${GLOBAL_POLICY_SERVER_PROTOCOL}://${GLOBAL_INJECTED_POLICY_IP_ADDR}:${GLOBAL_DROOLS_SERVER_PORT} |
Bilal A | 461aa5b | 2019-05-06 14:00:57 -0400 | [diff] [blame] | 21 | ${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} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 28 | |
| 29 | *** Keywords *** |
| 30 | |
| 31 | Run Policy Health Check |
| 32 | [Documentation] Runs Policy Health check |
Brian Freeman | 55b96e2 | 2019-05-08 20:49:45 -0500 | [diff] [blame] | 33 | ${auth}= Create List ${GLOBAL_POLICY_USERNAME} ${GLOBAL_POLICY_PASSWORD} |
DR695H | bf5a3a3 | 2017-06-30 13:09:57 -0400 | [diff] [blame] | 34 | Log Creating session ${POLICY_ENDPOINT} |
| 35 | ${session}= Create Session policy ${POLICY_HEALTHCHECK_ENDPOINT} auth=${auth} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 36 | ${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 Freeman | 55b96e2 | 2019-05-08 20:49:45 -0500 | [diff] [blame] | 45 | |
Brian Freeman | d65e2aa | 2018-07-26 11:13:46 -0500 | [diff] [blame] | 46 | Run 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 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 58 | Run Policy Put Request |
| 59 | [Documentation] Runs Policy Put request |
| 60 | [Arguments] ${data_path} ${data} |
DR695H | bf5a3a3 | 2017-06-30 13:09:57 -0400 | [diff] [blame] | 61 | Log Creating session ${POLICY_ENDPOINT} |
| 62 | ${session}= Create Session policy ${POLICY_ENDPOINT} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 63 | ${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 Freeman | e14d257 | 2019-04-29 16:20:21 -0500 | [diff] [blame] | 67 | |
Brian Freeman | c967dd6 | 2019-04-30 09:47:44 -0500 | [diff] [blame] | 68 | Run 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 Freeman | 55b96e2 | 2019-05-08 20:49:45 -0500 | [diff] [blame] | 77 | Run 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} |
| 82 | ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} disable_warnings=1 |
| 83 | ${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 Freeman | e14d257 | 2019-04-29 16:20:21 -0500 | [diff] [blame] | 89 | Run 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 Freeman | c967dd6 | 2019-04-30 09:47:44 -0500 | [diff] [blame] | 98 | |
Brian Freeman | 55b96e2 | 2019-05-08 20:49:45 -0500 | [diff] [blame] | 99 | Run 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} |
| 103 | ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} disable_warnings=1 |
| 104 | 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 | |
| 111 | Run 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} |
| 115 | ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} disable_warnings=1 |
| 116 | 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 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 123 | Run Policy Delete Request |
| 124 | [Documentation] Runs Policy Delete request |
| 125 | [Arguments] ${data_path} ${data} |
DR695H | bf5a3a3 | 2017-06-30 13:09:57 -0400 | [diff] [blame] | 126 | Log Creating session ${POLICY_ENDPOINT} |
| 127 | ${session}= Create Session policy ${POLICY_ENDPOINT} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 128 | ${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 Freeman | 55b96e2 | 2019-05-08 20:49:45 -0500 | [diff] [blame] | 132 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 133 | Run Policy Get Configs Request |
| 134 | [Documentation] Runs Policy Get Configs request |
| 135 | [Arguments] ${data_path} ${data} |
DR695H | bf5a3a3 | 2017-06-30 13:09:57 -0400 | [diff] [blame] | 136 | Log Creating session ${POLICY_ENDPOINT} |
| 137 | ${session}= Create Session policy ${POLICY_ENDPOINT} |
Brian Freeman | 55b96e2 | 2019-05-08 20:49:45 -0500 | [diff] [blame] | 138 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json Authorization=Basic ${GLOBAL_POLICY_AUTH} ClientAuth=${GLOBAL_POLICY_CLIENTAUTH} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 139 | ${resp}= Post Request policy ${data_path} data=${data} headers=${headers} |
| 140 | Log Received response from policy ${resp.text} |
Gary Wu | 76bc74f | 2018-03-22 13:25:49 -0700 | [diff] [blame] | 141 | [Return] ${resp} |
| 142 | |
| 143 | |
| 144 | |
Brian Freeman | c967dd6 | 2019-04-30 09:47:44 -0500 | [diff] [blame] | 145 | Update vVFWCL Policy Old |
Gary Wu | 76bc74f | 2018-03-22 13:25:49 -0700 | [diff] [blame] | 146 | [Arguments] ${resource_id} |
Brian Freeman | ca5e32e | 2018-07-23 12:47:21 -0500 | [diff] [blame] | 147 | Run Keyword and Ignore Error Delete vFWCL Policy |
Gary Wu | 76bc74f | 2018-03-22 13:25:49 -0700 | [diff] [blame] | 148 | Sleep 20s |
Brian Freeman | d65e2aa | 2018-07-26 11:13:46 -0500 | [diff] [blame] | 149 | Log To Console Create vFWCL Policy |
Gary Wu | 76bc74f | 2018-03-22 13:25:49 -0700 | [diff] [blame] | 150 | Create vFWCL Policy ${resource_id} |
| 151 | Sleep 5s |
Brian Freeman | d65e2aa | 2018-07-26 11:13:46 -0500 | [diff] [blame] | 152 | Log To Console Push vFWCL Policy |
Gary Wu | 76bc74f | 2018-03-22 13:25:49 -0700 | [diff] [blame] | 153 | Push vFWCL Policy |
| 154 | Sleep 20s |
Brian Freeman | d65e2aa | 2018-07-26 11:13:46 -0500 | [diff] [blame] | 155 | Log To Console Reboot Drools |
Gary Wu | 76bc74f | 2018-03-22 13:25:49 -0700 | [diff] [blame] | 156 | Reboot Drools |
| 157 | Sleep 20s |
Brian Freeman | d65e2aa | 2018-07-26 11:13:46 -0500 | [diff] [blame] | 158 | Log To Console Validate vFWCL Policy |
Brian Freeman | c967dd6 | 2019-04-30 09:47:44 -0500 | [diff] [blame] | 159 | Validate the vFWCL Policy Old |
| 160 | |
| 161 | Update vVFWCL Policy |
Brian Freeman | 0d866b5 | 2019-05-08 20:30:14 -0500 | [diff] [blame] | 162 | [Arguments] ${resource_id} |
Brian Freeman | 55b96e2 | 2019-05-08 20:49:45 -0500 | [diff] [blame] | 163 | Log To Console Create vFWCL Monitoring Policy |
Brian Freeman | c967dd6 | 2019-04-30 09:47:44 -0500 | [diff] [blame] | 164 | Create vFirewall Monitoring Policy |
| 165 | Sleep 5s |
Brian Freeman | 55b96e2 | 2019-05-08 20:49:45 -0500 | [diff] [blame] | 166 | Log To Console Create vFWCL Operational Policy |
Brian Freeman | 7594828 | 2019-05-14 20:44:46 -0500 | [diff] [blame^] | 167 | ${op_policy_version}= Create vFirewall Operational Policy ${resource_id} |
Brian Freeman | c967dd6 | 2019-04-30 09:47:44 -0500 | [diff] [blame] | 168 | Sleep 5s |
Brian Freeman | 55b96e2 | 2019-05-08 20:49:45 -0500 | [diff] [blame] | 169 | Log To Console Push vFWCL To PDP Group |
Brian Freeman | 7594828 | 2019-05-14 20:44:46 -0500 | [diff] [blame^] | 170 | Push vFirewall Policies To PDP Group ${op_policy_version} |
Brian Freeman | c967dd6 | 2019-04-30 09:47:44 -0500 | [diff] [blame] | 171 | Sleep 20s |
| 172 | Log To Console Validate vFWCL Policy |
Gary Wu | 76bc74f | 2018-03-22 13:25:49 -0700 | [diff] [blame] | 173 | Validate the vFWCL Policy |
| 174 | |
Brian Freeman | c967dd6 | 2019-04-30 09:47:44 -0500 | [diff] [blame] | 175 | |
Gary Wu | 76bc74f | 2018-03-22 13:25:49 -0700 | [diff] [blame] | 176 | Delete 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 | |
| 181 | Create 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 | |
| 188 | Push 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 | |
| 194 | Reboot 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 Freeman | c967dd6 | 2019-04-30 09:47:44 -0500 | [diff] [blame] | 209 | Validate the vFWCL Policy Old |
Gary Wu | 76bc74f | 2018-03-22 13:25:49 -0700 | [diff] [blame] | 210 | ${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 Freeman | e14d257 | 2019-04-29 16:20:21 -0500 | [diff] [blame] | 214 | |
Brian Freeman | 55b96e2 | 2019-05-08 20:49:45 -0500 | [diff] [blame] | 215 | Validate the vFWCL Policy |
| 216 | ${resp}= Run Policy Pap Get Request /policy/pap/v1/pdps |
Brian Freeman | c967dd6 | 2019-04-30 09:47:44 -0500 | [diff] [blame] | 217 | Log Received response from policy ${resp.text} |
| 218 | Should Be Equal As Strings ${resp.status_code} 200 |
Brian Freeman | e14d257 | 2019-04-29 16:20:21 -0500 | [diff] [blame] | 219 | |
| 220 | Create vFirewall Monitoring Policy |
| 221 | ${dict}= Create Dictionary |
| 222 | ${data}= Fill JSON Template File ${POLICY_TEMPLATES}/vFirewall_policy_monitoring_input_tosca.template ${dict} |
Brian Freeman | 55b96e2 | 2019-05-08 20:49:45 -0500 | [diff] [blame] | 223 | ${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 Freeman | e14d257 | 2019-04-29 16:20:21 -0500 | [diff] [blame] | 224 | Should Be Equal As Strings ${resp.status_code} 200 |
| 225 | |
| 226 | |
| 227 | Create vFirewall Operational Policy |
| 228 | [Arguments] ${resource_id} |
| 229 | ${dict}= Create Dictionary RESOURCE_ID=${resource_id} |
| 230 | ${data}= Fill JSON Template File ${POLICY_TEMPLATES}/vFirewall_policy_operational_input.template ${dict} |
Brian Freeman | 55b96e2 | 2019-05-08 20:49:45 -0500 | [diff] [blame] | 231 | ${resp}= Run Policy Api Post Request /policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies ${data} |
Brian Freeman | e14d257 | 2019-04-29 16:20:21 -0500 | [diff] [blame] | 232 | Should Be Equal As Strings ${resp.status_code} 200 |
Brian Freeman | 7594828 | 2019-05-14 20:44:46 -0500 | [diff] [blame^] | 233 | [Return] ${resp.json()['policy-version']} |
Brian Freeman | e14d257 | 2019-04-29 16:20:21 -0500 | [diff] [blame] | 234 | |
| 235 | |
| 236 | Push vFirewall Policies To PDP Group |
Brian Freeman | 7594828 | 2019-05-14 20:44:46 -0500 | [diff] [blame^] | 237 | [Arguments] ${op_policy_version} |
| 238 | ${dict}= Create Dictionary OP_POLICY_VERSION=${op_policy_version} |
Brian Freeman | e14d257 | 2019-04-29 16:20:21 -0500 | [diff] [blame] | 239 | ${data}= Fill JSON Template File ${POLICY_TEMPLATES}/vFirewall_push.template ${dict} |
Brian Freeman | 55b96e2 | 2019-05-08 20:49:45 -0500 | [diff] [blame] | 240 | #${resp}= Run Policy Post Request /policy/pap/v1/pdps/policies ${data} |
| 241 | ${resp}= Run Policy Pap Post Request /policy/pap/v1/pdps/policies ${data} |
| 242 | #Should Be Equal As Strings ${resp.status_code} 200 |
Brian Freeman | e14d257 | 2019-04-29 16:20:21 -0500 | [diff] [blame] | 243 | |
Bilal A | 461aa5b | 2019-05-06 14:00:57 -0400 | [diff] [blame] | 244 | Run Policy API Healthcheck |
| 245 | [Documentation] Runs Policy Api Health check |
| 246 | ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD} |
| 247 | Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} |
Brian Freeman | 55b96e2 | 2019-05-08 20:49:45 -0500 | [diff] [blame] | 248 | ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} disable_warnings=1 |
Bilal A | 461aa5b | 2019-05-06 14:00:57 -0400 | [diff] [blame] | 249 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 250 | ${resp}= Get Request policy /policy/api/v1/healthcheck headers=${headers} |
| 251 | Log Received response from policy ${resp.text} |
| 252 | Should Be Equal As Strings ${resp.status_code} 200 |
| 253 | Should Be Equal As Strings ${resp.json()['code']} 200 |
| 254 | |
| 255 | Run Policy PAP Healthcheck |
| 256 | [Documentation] Runs Policy PAP Health check |
| 257 | ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD} |
| 258 | Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} |
Brian Freeman | 55b96e2 | 2019-05-08 20:49:45 -0500 | [diff] [blame] | 259 | ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} disable_warnings=1 |
Bilal A | 461aa5b | 2019-05-06 14:00:57 -0400 | [diff] [blame] | 260 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 261 | ${resp}= Get Request policy /policy/pap/v1/healthcheck headers=${headers} |
| 262 | Log Received response from policy ${resp.text} |
| 263 | Should Be Equal As Strings ${resp.status_code} 200 |
| 264 | Should Be Equal As Strings ${resp.json()['code']} 200 |
| 265 | |
| 266 | Run Policy Distribution Healthcheck |
| 267 | [Documentation] Runs Policy Distribution Health check |
| 268 | ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD} |
| 269 | Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_DISTRIBUTION_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} |
Brian Freeman | 55b96e2 | 2019-05-08 20:49:45 -0500 | [diff] [blame] | 270 | ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_DISTRIBUTION_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} disable_warnings=1 |
Bilal A | 461aa5b | 2019-05-06 14:00:57 -0400 | [diff] [blame] | 271 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 272 | ${resp}= Get Request policy /healthcheck headers=${headers} |
| 273 | Log Received response from policy ${resp.text} |
| 274 | Should Be Equal As Strings ${resp.status_code} 200 |
| 275 | Should Be Equal As Strings ${resp.json()['code']} 200 |
| 276 | |
| 277 | Run Policy XACML PDP Healthcheck |
| 278 | [Documentation] Runs Policy Xacml PDP Health check |
| 279 | ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD} |
| 280 | Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PDPX_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} |
| 281 | ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PDPX_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} |
| 282 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 283 | ${resp}= Get Request policy /policy/pdpx/v1/healthcheck headers=${headers} |
| 284 | Log Received response from policy ${resp.text} |
| 285 | Should Be Equal As Strings ${resp.status_code} 200 |
| 286 | Should Be Equal As Strings ${resp.json()['code']} 200 |
| 287 | |
| 288 | Run Policy APEX PDP Healthcheck |
| 289 | [Documentation] Runs Policy Apex PDP Health check |
| 290 | ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD} |
| 291 | Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_APEX_PDP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} |
Brian Freeman | 55b96e2 | 2019-05-08 20:49:45 -0500 | [diff] [blame] | 292 | ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_APEX_PDP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} disable_warnings=1 |
Bilal A | 461aa5b | 2019-05-06 14:00:57 -0400 | [diff] [blame] | 293 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 294 | ${resp}= Get Request policy /policy/apex-pdp/v1/healthcheck headers=${headers} |
| 295 | Log Received response from policy ${resp.text} |
| 296 | Should Be Equal As Strings ${resp.status_code} 200 |
| 297 | Should Be Equal As Strings ${resp.json()['code']} 200 |
| 298 | |