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 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 3 | Library RequestsLibrary |
| 4 | Library String |
Sylvain Desbureaux | 2e33ff6 | 2019-05-15 14:41:18 +0200 | [diff] [blame] | 5 | Library Collections |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 6 | Library SSHLibrary |
| 7 | Library OperatingSystem |
DR695H | d979465 | 2019-07-19 18:20:40 -0400 | [diff] [blame] | 8 | Library ONAPLibrary.Templating WITH NAME Templating |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 9 | Resource global_properties.robot |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 10 | Resource ssh/files.robot |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 11 | |
| 12 | *** Variables *** |
| 13 | ${POLICY_HEALTH_CHECK_PATH} /healthcheck |
DR695H | bf5a3a3 | 2017-06-30 13:09:57 -0400 | [diff] [blame] | 14 | ${POLICY_ENDPOINT} ${GLOBAL_POLICY_SERVER_PROTOCOL}://${GLOBAL_INJECTED_POLICY_IP_ADDR}:${GLOBAL_POLICY_SERVER_PORT} |
Michal Ptacek | 6880b65 | 2019-07-08 16:13:02 +0200 | [diff] [blame] | 15 | ${POLICY_HEALTHCHECK_ENDPOINT} ${GLOBAL_POLICY_SERVER_PROTOCOL}://${GLOBAL_INJECTED_POLICY_DROOLS_IP_ADDR}:${GLOBAL_POLICY_HEALTHCHECK_PORT} |
DR695H | 3440942 | 2019-06-20 10:56:46 -0400 | [diff] [blame] | 16 | ${POLICY_TEMPLATES} policy |
Michal Ptacek | 6880b65 | 2019-07-08 16:13:02 +0200 | [diff] [blame] | 17 | ${DROOLS_ENDPOINT} ${GLOBAL_POLICY_SERVER_PROTOCOL}://${GLOBAL_INJECTED_POLICY_DROOLS_IP_ADDR}:${GLOBAL_DROOLS_SERVER_PORT} |
Bilal A | 461aa5b | 2019-05-06 14:00:57 -0400 | [diff] [blame] | 18 | ${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} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 25 | |
Brian Freeman | 88fbb99 | 2019-05-17 17:46:56 -0500 | [diff] [blame] | 26 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 27 | *** Keywords *** |
| 28 | |
| 29 | Run Policy Health Check |
| 30 | [Documentation] Runs Policy Health check |
Brian Freeman | 55b96e2 | 2019-05-08 20:49:45 -0500 | [diff] [blame] | 31 | ${auth}= Create List ${GLOBAL_POLICY_USERNAME} ${GLOBAL_POLICY_PASSWORD} |
DR695H | bf5a3a3 | 2017-06-30 13:09:57 -0400 | [diff] [blame] | 32 | Log Creating session ${POLICY_ENDPOINT} |
| 33 | ${session}= Create Session policy ${POLICY_HEALTHCHECK_ENDPOINT} auth=${auth} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 34 | ${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 Freeman | 55b96e2 | 2019-05-08 20:49:45 -0500 | [diff] [blame] | 43 | |
Brian Freeman | d65e2aa | 2018-07-26 11:13:46 -0500 | [diff] [blame] | 44 | Run Drools Get Request |
| 45 | [Documentation] Runs Drools Get Request |
| 46 | [Arguments] ${data_path} |
| 47 | ${auth}= Create List ${GLOBAL_DROOLS_USERNAME} ${GLOBAL_DROOLS_PASSWORD} |
Michal Ptacek | 6880b65 | 2019-07-08 16:13:02 +0200 | [diff] [blame] | 48 | Log Creating session ${DROOLS_ENDPOINT} |
Brian Freeman | d65e2aa | 2018-07-26 11:13:46 -0500 | [diff] [blame] | 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 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 56 | Run Policy Put Request |
| 57 | [Documentation] Runs Policy Put request |
| 58 | [Arguments] ${data_path} ${data} |
DR695H | bf5a3a3 | 2017-06-30 13:09:57 -0400 | [diff] [blame] | 59 | Log Creating session ${POLICY_ENDPOINT} |
| 60 | ${session}= Create Session policy ${POLICY_ENDPOINT} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 61 | ${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 Freeman | e14d257 | 2019-04-29 16:20:21 -0500 | [diff] [blame] | 65 | |
Brian Freeman | c967dd6 | 2019-04-30 09:47:44 -0500 | [diff] [blame] | 66 | Run 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 Freeman | 55b96e2 | 2019-05-08 20:49:45 -0500 | [diff] [blame] | 75 | Run 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 Desbureaux | 2e33ff6 | 2019-05-15 14:41:18 +0200 | [diff] [blame] | 80 | ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} |
Brian Freeman | 55b96e2 | 2019-05-08 20:49:45 -0500 | [diff] [blame] | 81 | ${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 Freeman | e14d257 | 2019-04-29 16:20:21 -0500 | [diff] [blame] | 87 | Run 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 Freeman | c967dd6 | 2019-04-30 09:47:44 -0500 | [diff] [blame] | 96 | |
Brian Freeman | 55b96e2 | 2019-05-08 20:49:45 -0500 | [diff] [blame] | 97 | Run 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 Desbureaux | 2e33ff6 | 2019-05-15 14:41:18 +0200 | [diff] [blame] | 101 | ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} |
Brian Freeman | 55b96e2 | 2019-05-08 20:49:45 -0500 | [diff] [blame] | 102 | 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 | |
| 109 | Run 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 Desbureaux | 2e33ff6 | 2019-05-15 14:41:18 +0200 | [diff] [blame] | 113 | ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} |
Brian Freeman | 55b96e2 | 2019-05-08 20:49:45 -0500 | [diff] [blame] | 114 | 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 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 121 | Run Policy Delete Request |
| 122 | [Documentation] Runs Policy Delete request |
| 123 | [Arguments] ${data_path} ${data} |
DR695H | bf5a3a3 | 2017-06-30 13:09:57 -0400 | [diff] [blame] | 124 | Log Creating session ${POLICY_ENDPOINT} |
| 125 | ${session}= Create Session policy ${POLICY_ENDPOINT} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 126 | ${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 Freeman | 55b96e2 | 2019-05-08 20:49:45 -0500 | [diff] [blame] | 130 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 131 | Run Policy Get Configs Request |
| 132 | [Documentation] Runs Policy Get Configs request |
| 133 | [Arguments] ${data_path} ${data} |
DR695H | bf5a3a3 | 2017-06-30 13:09:57 -0400 | [diff] [blame] | 134 | Log Creating session ${POLICY_ENDPOINT} |
| 135 | ${session}= Create Session policy ${POLICY_ENDPOINT} |
Brian Freeman | 55b96e2 | 2019-05-08 20:49:45 -0500 | [diff] [blame] | 136 | ${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] | 137 | ${resp}= Post Request policy ${data_path} data=${data} headers=${headers} |
| 138 | Log Received response from policy ${resp.text} |
Gary Wu | 76bc74f | 2018-03-22 13:25:49 -0700 | [diff] [blame] | 139 | [Return] ${resp} |
| 140 | |
Brian Freeman | c967dd6 | 2019-04-30 09:47:44 -0500 | [diff] [blame] | 141 | Update vVFWCL Policy |
Brian Freeman | 0d866b5 | 2019-05-08 20:30:14 -0500 | [diff] [blame] | 142 | [Arguments] ${resource_id} |
DR695H | 8e7028b | 2019-07-10 10:13:58 -0400 | [diff] [blame] | 143 | Log Create vFWCL Monitoring Policy |
Brian Freeman | c967dd6 | 2019-04-30 09:47:44 -0500 | [diff] [blame] | 144 | Create vFirewall Monitoring Policy |
| 145 | Sleep 5s |
DR695H | 8e7028b | 2019-07-10 10:13:58 -0400 | [diff] [blame] | 146 | Log Create vFWCL Operational Policy |
Brian Freeman | 7594828 | 2019-05-14 20:44:46 -0500 | [diff] [blame] | 147 | ${op_policy_version}= Create vFirewall Operational Policy ${resource_id} |
Brian Freeman | c967dd6 | 2019-04-30 09:47:44 -0500 | [diff] [blame] | 148 | Sleep 5s |
DR695H | 8e7028b | 2019-07-10 10:13:58 -0400 | [diff] [blame] | 149 | Log Push vFWCL To PDP Group |
Brian Freeman | 7594828 | 2019-05-14 20:44:46 -0500 | [diff] [blame] | 150 | Push vFirewall Policies To PDP Group ${op_policy_version} |
Brian Freeman | c967dd6 | 2019-04-30 09:47:44 -0500 | [diff] [blame] | 151 | Sleep 20s |
DR695H | 8e7028b | 2019-07-10 10:13:58 -0400 | [diff] [blame] | 152 | Log Validate vFWCL Policy |
Gary Wu | 76bc74f | 2018-03-22 13:25:49 -0700 | [diff] [blame] | 153 | Validate the vFWCL Policy |
| 154 | |
Brian Freeman | c967dd6 | 2019-04-30 09:47:44 -0500 | [diff] [blame] | 155 | |
Gary Wu | 76bc74f | 2018-03-22 13:25:49 -0700 | [diff] [blame] | 156 | Delete vFWCL Policy |
DR695H | d979465 | 2019-07-19 18:20:40 -0400 | [diff] [blame] | 157 | Templating.Create Environment policy ${GLOBAL_TEMPLATE_FOLDER} |
DR695H | 3440942 | 2019-06-20 10:56:46 -0400 | [diff] [blame] | 158 | ${dict}= Create Dictionary policyName=com.BRMSParamvFirewall |
DR695H | d979465 | 2019-07-19 18:20:40 -0400 | [diff] [blame] | 159 | ${data}= Templating.Apply Template policy ${POLICY_TEMPLATES}/FirewallPolicy_delete.jinja ${dict} |
DR695H | 3440942 | 2019-06-20 10:56:46 -0400 | [diff] [blame] | 160 | ${resp}= Run Policy Delete Request /pdp/api/deletePolicy ${data} |
| 161 | Should Be Equal As Strings ${resp.status_code} 200 |
Gary Wu | 76bc74f | 2018-03-22 13:25:49 -0700 | [diff] [blame] | 162 | |
| 163 | Create vFWCL Policy |
| 164 | [Arguments] ${resource_id} |
| 165 | ${dict}= Create Dictionary RESOURCE_ID=${resource_id} |
DR695H | d979465 | 2019-07-19 18:20:40 -0400 | [diff] [blame] | 166 | Templating.Create Environment policy ${GLOBAL_TEMPLATE_FOLDER} |
| 167 | ${data}= Templating.Apply Template policy ${POLICY_TEMPLATES}/FirewallPolicy_update.jinja ${dict} |
Gary Wu | 76bc74f | 2018-03-22 13:25:49 -0700 | [diff] [blame] | 168 | ${resp}= Run Policy Put Request /pdp/api/updatePolicy ${data} |
| 169 | Should Be Equal As Strings ${resp.status_code} 200 |
| 170 | |
| 171 | Push vFWCL Policy |
DR695H | d979465 | 2019-07-19 18:20:40 -0400 | [diff] [blame] | 172 | Templating.Create Environment policy ${GLOBAL_TEMPLATE_FOLDER} |
DR695H | 3440942 | 2019-06-20 10:56:46 -0400 | [diff] [blame] | 173 | ${dict}= Create Dictionary |
DR695H | d979465 | 2019-07-19 18:20:40 -0400 | [diff] [blame] | 174 | ${data}= Templating.Apply Template policy ${POLICY_TEMPLATES}/FirewallPolicy_push.jinja ${dict} |
DR695H | 3440942 | 2019-06-20 10:56:46 -0400 | [diff] [blame] | 175 | ${resp}= Run Policy Put Request /pdp/api/pushPolicy ${data} |
| 176 | Should Be Equal As Strings ${resp.status_code} 200 |
Gary Wu | 76bc74f | 2018-03-22 13:25:49 -0700 | [diff] [blame] | 177 | |
Brian Freeman | c967dd6 | 2019-04-30 09:47:44 -0500 | [diff] [blame] | 178 | Validate the vFWCL Policy Old |
Gary Wu | 76bc74f | 2018-03-22 13:25:49 -0700 | [diff] [blame] | 179 | ${resp}= Run Drools Get Request /policy/pdp/engine/controllers/amsterdam/drools |
| 180 | Should Be Equal As Strings ${resp.status_code} 200 |
| 181 | ${resp}= Run Drools Get Request /policy/pdp/engine/controllers/amsterdam/drools/facts/closedloop-amsterdam/org.onap.policy.controlloop.Params |
| 182 | Should Be Equal As Strings ${resp.status_code} 200 |
Brian Freeman | e14d257 | 2019-04-29 16:20:21 -0500 | [diff] [blame] | 183 | |
Brian Freeman | 55b96e2 | 2019-05-08 20:49:45 -0500 | [diff] [blame] | 184 | Validate the vFWCL Policy |
| 185 | ${resp}= Run Policy Pap Get Request /policy/pap/v1/pdps |
Brian Freeman | c967dd6 | 2019-04-30 09:47:44 -0500 | [diff] [blame] | 186 | Log Received response from policy ${resp.text} |
| 187 | Should Be Equal As Strings ${resp.status_code} 200 |
Brian Freeman | e14d257 | 2019-04-29 16:20:21 -0500 | [diff] [blame] | 188 | |
| 189 | Create vFirewall Monitoring Policy |
| 190 | ${dict}= Create Dictionary |
DR695H | d979465 | 2019-07-19 18:20:40 -0400 | [diff] [blame] | 191 | Templating.Create Environment policy ${GLOBAL_TEMPLATE_FOLDER} |
| 192 | ${data}= Templating.Apply Template policy ${POLICY_TEMPLATES}/vFirewall_policy_monitoring_input_tosca.jinja ${dict} |
Brian Freeman | 55b96e2 | 2019-05-08 20:49:45 -0500 | [diff] [blame] | 193 | ${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] | 194 | Should Be Equal As Strings ${resp.status_code} 200 |
| 195 | |
Brian Freeman | 88fbb99 | 2019-05-17 17:46:56 -0500 | [diff] [blame] | 196 | Create vFirewall Operational Policy |
DR695H | 3440942 | 2019-06-20 10:56:46 -0400 | [diff] [blame] | 197 | [Arguments] ${resource_id} |
| 198 | ${dict}= Create Dictionary RESOURCE_ID=${resource_id} |
DR695H | d979465 | 2019-07-19 18:20:40 -0400 | [diff] [blame] | 199 | Templating.Create Environment policy ${GLOBAL_TEMPLATE_FOLDER} |
DR695H | 3440942 | 2019-06-20 10:56:46 -0400 | [diff] [blame] | 200 | ${content_data} OperatingSystem.Get File ${POLICY_TEMPLATES}/vFirewall_policy_operational_content.yaml |
| 201 | ${content_data}= Replace String Using Regexp ${content_data} __RESOURCE_ID__ ${resource_id} |
| 202 | ${encoded_content_data}= Evaluate urllib.quote_plus('''${content_data}''') urllib |
| 203 | ${content_dictionary}= Create Dictionary URL_ENCODED_CONTENT ${encoded_content_data} |
DR695H | d979465 | 2019-07-19 18:20:40 -0400 | [diff] [blame] | 204 | ${data_2}= Templating.Apply Template policy ${POLICY_TEMPLATES}/vFirewall_policy_operational_url_enc_content_input.jinja ${content_dictionary} |
DR695H | 8e7028b | 2019-07-10 10:13:58 -0400 | [diff] [blame] | 205 | Log ${data_2} |
DR695H | 3440942 | 2019-06-20 10:56:46 -0400 | [diff] [blame] | 206 | ${resp}= Run Policy Api Post Request /policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies ${data_2} |
| 207 | Should Be Equal As Strings ${resp.status_code} 200 |
| 208 | [Return] ${resp.json()['policy-version']} |
Brian Freeman | 88fbb99 | 2019-05-17 17:46:56 -0500 | [diff] [blame] | 209 | |
Brian Freeman | e14d257 | 2019-04-29 16:20:21 -0500 | [diff] [blame] | 210 | Push vFirewall Policies To PDP Group |
DR695H | 3440942 | 2019-06-20 10:56:46 -0400 | [diff] [blame] | 211 | [Arguments] ${op_policy_version} |
| 212 | ${dict}= Create Dictionary OP_POLICY_VERSION=${op_policy_version} |
DR695H | d979465 | 2019-07-19 18:20:40 -0400 | [diff] [blame] | 213 | Templating.Create Environment policy ${GLOBAL_TEMPLATE_FOLDER} |
| 214 | ${data}= Templating.Apply Template policy ${POLICY_TEMPLATES}/vFirewall_push.jinja ${dict} |
DR695H | 3440942 | 2019-06-20 10:56:46 -0400 | [diff] [blame] | 215 | ${resp}= Run Policy Pap Post Request /policy/pap/v1/pdps/policies ${data} |
| 216 | Should Be Equal As Strings ${resp.status_code} 200 |
Brian Freeman | e14d257 | 2019-04-29 16:20:21 -0500 | [diff] [blame] | 217 | |
Bilal A | 461aa5b | 2019-05-06 14:00:57 -0400 | [diff] [blame] | 218 | Run Policy API Healthcheck |
| 219 | [Documentation] Runs Policy Api Health check |
| 220 | ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD} |
| 221 | Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} |
Sylvain Desbureaux | 2e33ff6 | 2019-05-15 14:41:18 +0200 | [diff] [blame] | 222 | ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} |
Bilal A | 461aa5b | 2019-05-06 14:00:57 -0400 | [diff] [blame] | 223 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 224 | ${resp}= Get Request policy /policy/api/v1/healthcheck headers=${headers} |
| 225 | Log Received response from policy ${resp.text} |
| 226 | Should Be Equal As Strings ${resp.status_code} 200 |
| 227 | Should Be Equal As Strings ${resp.json()['code']} 200 |
| 228 | |
| 229 | Run Policy PAP Healthcheck |
| 230 | [Documentation] Runs Policy PAP Health check |
| 231 | ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD} |
| 232 | Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} |
Sylvain Desbureaux | 2e33ff6 | 2019-05-15 14:41:18 +0200 | [diff] [blame] | 233 | ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} |
Bilal A | 461aa5b | 2019-05-06 14:00:57 -0400 | [diff] [blame] | 234 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 235 | ${resp}= Get Request policy /policy/pap/v1/healthcheck headers=${headers} |
| 236 | Log Received response from policy ${resp.text} |
| 237 | Should Be Equal As Strings ${resp.status_code} 200 |
| 238 | Should Be Equal As Strings ${resp.json()['code']} 200 |
| 239 | |
| 240 | Run Policy Distribution Healthcheck |
| 241 | [Documentation] Runs Policy Distribution Health check |
| 242 | ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD} |
| 243 | Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_DISTRIBUTION_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} |
Sylvain Desbureaux | 2e33ff6 | 2019-05-15 14:41:18 +0200 | [diff] [blame] | 244 | ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_DISTRIBUTION_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} |
Bilal A | 461aa5b | 2019-05-06 14:00:57 -0400 | [diff] [blame] | 245 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 246 | ${resp}= Get Request policy /healthcheck headers=${headers} |
| 247 | Log Received response from policy ${resp.text} |
| 248 | Should Be Equal As Strings ${resp.status_code} 200 |
| 249 | Should Be Equal As Strings ${resp.json()['code']} 200 |
| 250 | |
| 251 | Run Policy XACML PDP Healthcheck |
| 252 | [Documentation] Runs Policy Xacml PDP Health check |
| 253 | ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD} |
| 254 | Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PDPX_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} |
| 255 | ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PDPX_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} |
| 256 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 257 | ${resp}= Get Request policy /policy/pdpx/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 | |
| 262 | Run Policy APEX PDP Healthcheck |
| 263 | [Documentation] Runs Policy Apex PDP Health check |
| 264 | ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD} |
| 265 | Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_APEX_PDP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} |
Sylvain Desbureaux | 2e33ff6 | 2019-05-15 14:41:18 +0200 | [diff] [blame] | 266 | ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_APEX_PDP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} |
Bilal A | 461aa5b | 2019-05-06 14:00:57 -0400 | [diff] [blame] | 267 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 268 | ${resp}= Get Request policy /policy/apex-pdp/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 | |