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 *** |
mrichomme | d7855e2 | 2020-04-07 17:03:46 +0200 | [diff] [blame] | 13 | ${POLICY_NEW_HEALTHCHECK_PATH} /policy/pap/v1/components/healthcheck |
mrichomme | 455d399 | 2020-04-03 14:56:40 +0200 | [diff] [blame] | 14 | ${POLICY_NEW_HEALTHCHECK_ENDPOINT} ${GLOBAL_POLICY_SERVER_PROTOCOL}://${GLOBAL_INJECTED_POLICY_PAP_IP_ADDR}:${GLOBAL_POLICY_HEALTHCHECK_PORT} |
DR695H | 3440942 | 2019-06-20 10:56:46 -0400 | [diff] [blame] | 15 | ${POLICY_TEMPLATES} policy |
Bilal A | 461aa5b | 2019-05-06 14:00:57 -0400 | [diff] [blame] | 16 | ${POLICY_API_IP} ${GLOBAL_INJECTED_POLICY_API_IP_ADDR} |
| 17 | ${POLICY_PAP_IP} ${GLOBAL_INJECTED_POLICY_PAP_IP_ADDR} |
Bilal A | 461aa5b | 2019-05-06 14:00:57 -0400 | [diff] [blame] | 18 | ${POLICY_PDPX_IP} ${GLOBAL_INJECTED_POLICY_PDPX_IP_ADDR} |
Bilal A | 461aa5b | 2019-05-06 14:00:57 -0400 | [diff] [blame] | 19 | ${POLICY_HEALTHCHECK_USERNAME} ${GLOBAL_POLICY_HEALTHCHECK_USERNAME} |
| 20 | ${POLICY_HEALTHCHECK_PASSWORD} ${GLOBAL_POLICY_HEALTHCHECK_PASSWORD} |
Nagendra90287 | 0488953 | 2020-09-04 15:44:45 +0530 | [diff] [blame] | 21 | ${json_path_policy} /var/opt/ONAP/robot/assets/policy/ |
| 22 | ${POLICY_GET_POLICY_URI} /policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0/policies/operational.modifyconfig/versions/1.0.0 |
| 23 | ${POLICY_CREATE_POLICY_URI} /policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0/policies |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 24 | |
Brian Freeman | 88fbb99 | 2019-05-17 17:46:56 -0500 | [diff] [blame] | 25 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 26 | *** Keywords *** |
| 27 | |
| 28 | Run Policy Health Check |
Pamela Dragosh | 0adce51 | 2020-08-25 13:18:02 -0400 | [diff] [blame] | 29 | [Documentation] Runs Policy Health Check |
mrichomme | 455d399 | 2020-04-03 14:56:40 +0200 | [diff] [blame] | 30 | ${auth}= Create List ${GLOBAL_POLICY_HEALTHCHECK_USERNAME} ${GLOBAL_POLICY_HEALTHCHECK_PASSWORD} |
| 31 | Log Creating session ${POLICY_NEW_HEALTHCHECK_ENDPOINT} |
| 32 | ${session}= Create Session policy ${POLICY_NEW_HEALTHCHECK_ENDPOINT} auth=${auth} |
| 33 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
mrichomme | d7855e2 | 2020-04-07 17:03:46 +0200 | [diff] [blame] | 34 | ${resp}= Get Request policy ${POLICY_NEW_HEALTHCHECK_PATH} headers=${headers} |
mrichomme | 455d399 | 2020-04-03 14:56:40 +0200 | [diff] [blame] | 35 | Log Received response from policy ${resp.text} |
| 36 | Should Be Equal As Strings ${resp.status_code} 200 |
| 37 | Should Be True ${resp.json()['healthy']} |
| 38 | |
Brian Freeman | 55b96e2 | 2019-05-08 20:49:45 -0500 | [diff] [blame] | 39 | Run Policy Pap Get Request |
| 40 | [Documentation] Runs Policy Pap Get request |
| 41 | [Arguments] ${data_path} |
| 42 | ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD} |
| 43 | 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] | 44 | ${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] | 45 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 46 | ${resp}= Get Request policy ${data_path} headers=${headers} |
| 47 | Log Received response from Policy Pap ${resp.text} |
| 48 | [Return] ${resp} |
| 49 | |
Brian Freeman | 64c8205 | 2020-12-08 09:14:37 -0500 | [diff] [blame] | 50 | Run Policy Api Get Request |
| 51 | [Documentation] Runs Policy Api Get request |
| 52 | [Arguments] ${data_path} |
| 53 | ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD} |
| 54 | ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} |
| 55 | Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} |
| 56 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 57 | ${resp}= Get Request policy ${data_path} headers=${headers} |
| 58 | Log Received response from policy API ${resp.text} |
| 59 | [Return] ${resp} |
| 60 | |
Brian Freeman | 55b96e2 | 2019-05-08 20:49:45 -0500 | [diff] [blame] | 61 | Run Policy Api Post Request |
| 62 | [Documentation] Runs Policy Api Post request |
| 63 | [Arguments] ${data_path} ${data} |
| 64 | ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD} |
Sylvain Desbureaux | 2e33ff6 | 2019-05-15 14:41:18 +0200 | [diff] [blame] | 65 | ${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] | 66 | Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} |
| 67 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 68 | ${resp}= Post Request policy ${data_path} data=${data} headers=${headers} |
| 69 | Log Received response from policy ${resp.text} |
| 70 | [Return] ${resp} |
| 71 | |
Brian Freeman | 55b96e2 | 2019-05-08 20:49:45 -0500 | [diff] [blame] | 72 | Run Policy Pap Post Request |
| 73 | [Documentation] Runs Policy Pap Post request |
| 74 | [Arguments] ${data_path} ${data} |
| 75 | ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD} |
Sylvain Desbureaux | 2e33ff6 | 2019-05-15 14:41:18 +0200 | [diff] [blame] | 76 | ${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] | 77 | Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} |
| 78 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 79 | ${resp}= Post Request policy ${data_path} data=${data} headers=${headers} |
| 80 | Log Received response from policy ${resp.text} |
| 81 | [Return] ${resp} |
| 82 | |
Brian Freeman | e6c3d28 | 2019-09-30 14:20:02 -0500 | [diff] [blame] | 83 | Undeploy Policy |
| 84 | [Documentation] Runs Policy PAP Undeploy a Policy from PDP Groups |
| 85 | [Arguments] ${policy_name} |
| 86 | ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD} |
| 87 | ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} |
| 88 | Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} |
| 89 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 90 | ${resp}= Delete Request policy /policy/pap/v1/pdps/policies/${policy_name} headers=${headers} |
| 91 | Log Received response from policy ${resp.text} |
a.sreekumar | 5dc8c14 | 2021-02-18 16:57:46 +0000 | [diff] [blame] | 92 | Should Be Equal As Strings ${resp.status_code} 202 |
Brian Freeman | e6c3d28 | 2019-09-30 14:20:02 -0500 | [diff] [blame] | 93 | |
Brian Freeman | c967dd6 | 2019-04-30 09:47:44 -0500 | [diff] [blame] | 94 | Update vVFWCL Policy |
Brian Freeman | 0d866b5 | 2019-05-08 20:30:14 -0500 | [diff] [blame] | 95 | [Arguments] ${resource_id} |
DR695H | 8e7028b | 2019-07-10 10:13:58 -0400 | [diff] [blame] | 96 | Log Create vFWCL Monitoring Policy |
Brian Freeman | bb58461 | 2020-05-05 09:07:15 -0500 | [diff] [blame] | 97 | Create vFirewall Monitoring Policy ${resource_id} |
Brian Freeman | c967dd6 | 2019-04-30 09:47:44 -0500 | [diff] [blame] | 98 | Sleep 5s |
DR695H | 8e7028b | 2019-07-10 10:13:58 -0400 | [diff] [blame] | 99 | Log Create vFWCL Operational Policy |
Brian Freeman | 7594828 | 2019-05-14 20:44:46 -0500 | [diff] [blame] | 100 | ${op_policy_version}= Create vFirewall Operational Policy ${resource_id} |
Brian Freeman | c967dd6 | 2019-04-30 09:47:44 -0500 | [diff] [blame] | 101 | Sleep 5s |
DR695H | 8e7028b | 2019-07-10 10:13:58 -0400 | [diff] [blame] | 102 | Log Push vFWCL To PDP Group |
Brian Freeman | 7594828 | 2019-05-14 20:44:46 -0500 | [diff] [blame] | 103 | Push vFirewall Policies To PDP Group ${op_policy_version} |
Brian Freeman | c967dd6 | 2019-04-30 09:47:44 -0500 | [diff] [blame] | 104 | Sleep 20s |
DR695H | 8e7028b | 2019-07-10 10:13:58 -0400 | [diff] [blame] | 105 | Log Validate vFWCL Policy |
Gary Wu | 76bc74f | 2018-03-22 13:25:49 -0700 | [diff] [blame] | 106 | Validate the vFWCL Policy |
| 107 | |
Brian Freeman | 55b96e2 | 2019-05-08 20:49:45 -0500 | [diff] [blame] | 108 | Validate the vFWCL Policy |
| 109 | ${resp}= Run Policy Pap Get Request /policy/pap/v1/pdps |
Brian Freeman | 64c8205 | 2020-12-08 09:14:37 -0500 | [diff] [blame] | 110 | Log Received response from policy PAP ${resp.text} |
| 111 | Should Be Equal As Strings ${resp.status_code} 200 |
| 112 | ${resp}= Run Policy Api Get Request /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2 |
| 113 | Log Received response from policy API policytypes ${resp.text} |
Brian Freeman | c967dd6 | 2019-04-30 09:47:44 -0500 | [diff] [blame] | 114 | Should Be Equal As Strings ${resp.status_code} 200 |
Brian Freeman | e14d257 | 2019-04-29 16:20:21 -0500 | [diff] [blame] | 115 | |
| 116 | Create vFirewall Monitoring Policy |
Brian Freeman | bb58461 | 2020-05-05 09:07:15 -0500 | [diff] [blame] | 117 | [Arguments] ${resource_id} |
| 118 | ${dict}= Create Dictionary RESOURCE_ID=${resource_id} |
DR695H | d979465 | 2019-07-19 18:20:40 -0400 | [diff] [blame] | 119 | Templating.Create Environment policy ${GLOBAL_TEMPLATE_FOLDER} |
| 120 | ${data}= Templating.Apply Template policy ${POLICY_TEMPLATES}/vFirewall_policy_monitoring_input_tosca.jinja ${dict} |
Pamela Dragosh | 0adce51 | 2020-08-25 13:18:02 -0400 | [diff] [blame] | 121 | ${resp}= Run Policy Api Post Request /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/policies ${data} |
Brian Freeman | e14d257 | 2019-04-29 16:20:21 -0500 | [diff] [blame] | 122 | Should Be Equal As Strings ${resp.status_code} 200 |
| 123 | |
Brian Freeman | 88fbb99 | 2019-05-17 17:46:56 -0500 | [diff] [blame] | 124 | Create vFirewall Operational Policy |
DR695H | 3440942 | 2019-06-20 10:56:46 -0400 | [diff] [blame] | 125 | [Arguments] ${resource_id} |
| 126 | ${dict}= Create Dictionary RESOURCE_ID=${resource_id} |
DR695H | d979465 | 2019-07-19 18:20:40 -0400 | [diff] [blame] | 127 | Templating.Create Environment policy ${GLOBAL_TEMPLATE_FOLDER} |
Brian Freeman | df0ca46 | 2020-05-06 15:10:06 -0500 | [diff] [blame] | 128 | ${data_2}= Templating.Apply Template policy ${POLICY_TEMPLATES}/vFirewall_policy_operational_content_input.jinja ${dict} |
DR695H | 8e7028b | 2019-07-10 10:13:58 -0400 | [diff] [blame] | 129 | Log ${data_2} |
Brian Freeman | df0ca46 | 2020-05-06 15:10:06 -0500 | [diff] [blame] | 130 | ${resp}= Run Policy Api Post Request /policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0/policies ${data_2} |
DR695H | 3440942 | 2019-06-20 10:56:46 -0400 | [diff] [blame] | 131 | Should Be Equal As Strings ${resp.status_code} 200 |
Brian Freeman | df0ca46 | 2020-05-06 15:10:06 -0500 | [diff] [blame] | 132 | [Return] ${resp.json()['version']} |
Brian Freeman | 88fbb99 | 2019-05-17 17:46:56 -0500 | [diff] [blame] | 133 | |
Brian Freeman | 64c8205 | 2020-12-08 09:14:37 -0500 | [diff] [blame] | 134 | Update vFWCL Operational and Monitoring Policies |
| 135 | [Documentation] Undeploy, Delete and Create Operational and Monitoring policies for vFWCL |
| 136 | [Arguments] ${model_invariant_id} |
| 137 | Run Keyword And Ignore Error Run Undeploy vFW Monitoring Policy |
mrichomme | d168a9a | 2020-12-16 10:24:33 +0100 | [diff] [blame] | 138 | Run Keyword And Ignore Error Run Undeploy Policy |
Brian Freeman | 64c8205 | 2020-12-08 09:14:37 -0500 | [diff] [blame] | 139 | # Need to wait a little for undeploy |
| 140 | Validate the vFWCL Policy |
| 141 | Run Keyword and Ignore Error Run Delete vFW Monitoring Policy |
| 142 | Run Keyword And Ignore Error Run Delete vFW Operational Policy |
| 143 | Update vVFWCL Policy ${model_invariant_id} |
| 144 | |
Brian Freeman | e14d257 | 2019-04-29 16:20:21 -0500 | [diff] [blame] | 145 | Push vFirewall Policies To PDP Group |
DR695H | 3440942 | 2019-06-20 10:56:46 -0400 | [diff] [blame] | 146 | [Arguments] ${op_policy_version} |
| 147 | ${dict}= Create Dictionary OP_POLICY_VERSION=${op_policy_version} |
DR695H | d979465 | 2019-07-19 18:20:40 -0400 | [diff] [blame] | 148 | Templating.Create Environment policy ${GLOBAL_TEMPLATE_FOLDER} |
| 149 | ${data}= Templating.Apply Template policy ${POLICY_TEMPLATES}/vFirewall_push.jinja ${dict} |
DR695H | 3440942 | 2019-06-20 10:56:46 -0400 | [diff] [blame] | 150 | ${resp}= Run Policy Pap Post Request /policy/pap/v1/pdps/policies ${data} |
a.sreekumar | 5dc8c14 | 2021-02-18 16:57:46 +0000 | [diff] [blame] | 151 | Should Be Equal As Strings ${resp.status_code} 202 |
Nagendra90287 | 0488953 | 2020-09-04 15:44:45 +0530 | [diff] [blame] | 152 | |
| 153 | Run Create Policy Post Request |
| 154 | [Documentation] Runs Create Policy Post request |
| 155 | #[Arguments] ${data} |
| 156 | ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD} |
| 157 | ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} |
| 158 | Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} |
| 159 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 160 | ${json_policy} Get Binary File ${json_path_policy}create_policy.json |
| 161 | ${resp}= Post Request policy ${POLICY_CREATE_POLICY_URI} data=${json_policy} headers=${headers} |
| 162 | Log Received response from policy ${resp.text} |
| 163 | [Return] ${resp} |
| 164 | Should Be Equal As Strings ${resp.status_code} 200 |
| 165 | |
| 166 | Run Get Policy Get Request |
| 167 | [Documentation] Runs Get Policy request |
| 168 | #[Arguments] ${data} |
| 169 | ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD} |
| 170 | ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} |
| 171 | Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} |
| 172 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 173 | ${resp}= Get Request policy ${POLICY_GET_POLICY_URI} headers=${headers} |
| 174 | Log Received response from policy ${resp.text} |
| 175 | [Return] ${resp} |
| 176 | Should Be Equal As Strings ${resp.status_code} 200 |
| 177 | |
| 178 | Run Deploy Policy Pap Post Request |
| 179 | [Documentation] Runs Deploy Policy Pap Post request |
| 180 | #[Arguments] ${data_path} ${data} |
| 181 | ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD} |
| 182 | ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} |
| 183 | Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} |
| 184 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 185 | ${json_deploy} Get Binary File ${json_path_policy}deploy_policy.json |
| 186 | ${resp}= Post Request policy /policy/pap/v1/pdps/policies data=${json_deploy} headers=${headers} |
| 187 | Log Received response from policy ${resp.text} |
| 188 | [Return] ${resp} |
a.sreekumar | 5dc8c14 | 2021-02-18 16:57:46 +0000 | [diff] [blame] | 189 | Should Be Equal As Strings ${resp.status_code} 202 |
Nagendra90287 | 0488953 | 2020-09-04 15:44:45 +0530 | [diff] [blame] | 190 | |
mrichomme | d168a9a | 2020-12-16 10:24:33 +0100 | [diff] [blame] | 191 | Run Undeploy Policy |
Nagendra90287 | 0488953 | 2020-09-04 15:44:45 +0530 | [diff] [blame] | 192 | [Documentation] Runs Policy PAP Undeploy a Policy from PDP Groups |
| 193 | #[Arguments] ${policy_name} |
| 194 | ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD} |
| 195 | ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} |
| 196 | Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} |
| 197 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 198 | ${resp}= Delete Request policy /policy/pap/v1/pdps/policies/operational.modifyconfig headers=${headers} |
| 199 | Log Received response from policy ${resp.text} |
a.sreekumar | 5dc8c14 | 2021-02-18 16:57:46 +0000 | [diff] [blame] | 200 | Should Be Equal As Strings ${resp.status_code} 202 |
Nagendra90287 | 0488953 | 2020-09-04 15:44:45 +0530 | [diff] [blame] | 201 | |
Brian Freeman | 64c8205 | 2020-12-08 09:14:37 -0500 | [diff] [blame] | 202 | Run Undeploy vFW Monitoring Policy |
| 203 | [Documentation] Runs Policy PAP Undeploy vFW Monitoring Policy from PDP Groups |
| 204 | #[Arguments] ${policy_name} |
| 205 | ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD} |
| 206 | ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} |
| 207 | Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} |
| 208 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 209 | ${resp}= Delete Request policy /policy/pap/v1/pdps/policies/onap.vfirewall.tca headers=${headers} |
| 210 | Log Received response from policy ${resp.text} |
a.sreekumar | 5dc8c14 | 2021-02-18 16:57:46 +0000 | [diff] [blame] | 211 | Should Be Equal As Strings ${resp.status_code} 202 |
Brian Freeman | 64c8205 | 2020-12-08 09:14:37 -0500 | [diff] [blame] | 212 | |
| 213 | |
| 214 | Run Delete vFW Monitoring Policy |
| 215 | [Documentation] Runs Policy API Undeploy a Monitoring Policy |
| 216 | #[Arguments] ${policy_name} |
| 217 | ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD} |
| 218 | ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} |
| 219 | Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} |
| 220 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 221 | ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/policies/onap.vfirewall.tca/versions/1.0.0 headers=${headers} |
| 222 | Log Received response from policy ${resp.text} |
| 223 | Should Be Equal As Strings ${resp.status_code} 200 |
| 224 | |
Brian Freeman | 4e737eb | 2020-12-11 14:03:57 -0500 | [diff] [blame] | 225 | Run Delete vFW Operational Policy |
| 226 | [Documentation] Runs Policy API Delete Operational Policy |
| 227 | #[Arguments] ${policy_name} |
| 228 | ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD} |
| 229 | ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} |
| 230 | Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} |
| 231 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 232 | ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0/policies/operational.modifyconfig/versions/1.0.0 headers=${headers} |
| 233 | Log Received response from policy ${resp.text} |
| 234 | Should Be Equal As Strings ${resp.status_code} 200 |
Nagendra90287 | 0488953 | 2020-09-04 15:44:45 +0530 | [diff] [blame] | 235 | |
| 236 | Run Delete Policy Request |
| 237 | [Documentation] Runs Policy Delete request |
| 238 | #[Arguments] ${data_path} ${data} |
jhh | b91ba0f | 2020-09-10 11:58:10 -0500 | [diff] [blame] | 239 | ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD} |
| 240 | ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} |
| 241 | Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} |
| 242 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
Nagendra90287 | 0488953 | 2020-09-04 15:44:45 +0530 | [diff] [blame] | 243 | ${resp}= Delete Request policy ${POLICY_GET_POLICY_URI} headers=${headers} |
| 244 | Log Received response from policy ${resp.text} |
| 245 | [Return] ${resp} |
| 246 | Should Be Equal As Strings ${resp.status_code} 200 |