Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Policy ONAP CSIT Test cases |
| 3 | Library String |
| 4 | Library HttpLibrary.HTTP |
| 5 | LIbrary Process |
| 6 | Library BuiltIn |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 7 | Library ONAPLibrary.Templating |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 8 | Resource policy_interface.robot |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 9 | |
| 10 | *** Variables *** |
| 11 | ${RESOURCE_PATH_CREATE} /pdp/api/createPolicy |
| 12 | ${RESOURCE_PATH_CREATE_PUSH} /pdp/api/pushPolicy |
| 13 | ${RESOURCE_PATH_CREATE_DELETE} /pdp/api/deletePolicy |
| 14 | ${RESOURCE_PATH_GET_CONFIG} /pdp/api/getConfig |
HOCKLA | 3e332f4 | 2019-02-20 09:32:19 -0600 | [diff] [blame] | 15 | ${RESOURCE_PATH_LISTPOLICY} /pdp/api/listPolicy |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 16 | ${CREATE_CONFIG_VFW_TEMPLATE} configpolicy_vFW_R1.jinja |
| 17 | ${CREATE_CONFIG_VDNS_TEMPLATE} configpolicy_vDNS_R1.jinja |
| 18 | ${CREATE_CONFIG_VCPE_TEMPLATE} configpolicy_vCPE_R1.jinja |
| 19 | ${CREATE_OPS_VFW_TEMPLATE} opspolicy_VFW_R1.jinja |
| 20 | ${CREATE_OOF_HPA_TEMPLATE} oofpolicy_HPA_R1.jinja |
| 21 | ${CREATE_SDNC_VFW_TEMPLATE} sdncnamingpolicy_vFW.jinja |
| 22 | ${CREATE_SDNC_VPG_TEMPLATE} sdncnamingpolicy_vPG.jinja |
| 23 | ${PUSH_POLICY_TEMPLATE} pushpolicy.jinja |
| 24 | ${MULTIPLE_PUSH_POLICY_TEMPLATE} multiple_pushpolicy.jinja |
| 25 | ${MULTIPLE_UNPUSH_POLICY_TEMPLATE} multiple_unpushpolicy.jinja |
| 26 | ${CREATE_OPS_VDNS_TEMPLATE} opspolicy_VDNS_R1.jinja |
| 27 | ${DEL_POLICY_TEMPLATE} deletepolicy.jinja |
| 28 | ${GETCONFIG_TEMPLATE} getconfigpolicy.jinja |
| 29 | ${GETOOF_TEMPLATE} getoofpolicy.jinja |
| 30 | ${LISTPOLICY_TEMPLATE} listpolicy.jinja |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 31 | ${CONFIG_POLICY_VFW_NAME} vFirewall |
| 32 | ${CONFIG_POLICY_VFW_TYPE} MicroService |
| 33 | ${CONFIG_POLICY_VDNS_NAME} vLoadBalancer |
| 34 | ${CONFIG_POLICY_VDNS_TYPE} MicroService |
| 35 | ${OPS_POLICY_VFW_NAME} vFirewall |
| 36 | ${OPS_POLICY_VFW_TYPE} BRMS_PARAM |
| 37 | ${OPS_POLICY_VDNS_NAME} vLoadBalancer |
| 38 | ${OPS_POLICY_VDNS_TYPE} BRMS_PARAM |
| 39 | ${CONFIG_POLICY_VCPE_NAME} vCPE |
| 40 | ${CONFIG_POLICY_VCPE_TYPE} MicroService |
| 41 | ${OPS_POLICY_VCPE_NAME} vCPE |
| 42 | ${OPS_POLICY_VCPE_TYPE} BRMS_PARAM |
| 43 | ${OPS_POLICY_VOLTE_NAME} VoLTE |
| 44 | ${OPS_POLICY_VOLTE_TYPE} BRMS_PARAM |
| 45 | ${OOF_POLICY_HPA_NAME} HPA |
| 46 | ${OOF_POLICY_HPA_TYPE} Optimization |
| 47 | ${SDNC_POLICY_VFW_NAME} ONAP_vFW_Naming |
| 48 | ${SDNC_POLICY_VPG_NAME} ONAP_vPG_Naming |
HOCKLA | 092093d | 2019-04-05 13:00:50 -0500 | [diff] [blame] | 49 | ${MULTIPLE_PUSH_POLICY_NAME1} com.testBase1 |
| 50 | ${MULTIPLE_PUSH_POLICY_NAME2} com.testBase2 |
| 51 | ${MULTIPLE_PUSH_POLICY_NAME3} com.testBase3 |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 52 | ${file_path} ../testsuite/robot/assets/templates/ControlLoopDemo__closedLoopControlName.drl |
| 53 | ${RESOURCE_PATH_UPLOAD} /pdp/api/policyEngineImport?importParametersJson=%7B%22serviceName%22%3A%22Manyu456%22%2C%20%22serviceType%22%3A%22BRMSPARAM%22%7D |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 54 | ${CREATE_OPS_VCPE_TEMPLATE} opspolicy_vCPE_R1.jinja |
| 55 | ${CREATE_OPS_VOLTE_TEMPLATE} opspolicy_vOLTE_R1.jinja |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 56 | |
| 57 | |
| 58 | *** Test Cases *** |
| 59 | Policy Health check |
| 60 | Run Policy Health Check |
| 61 | |
| 62 | VFW Config Policy |
| 63 | ${CONFIG_POLICY_VFW_NAME}= Create Config VFW Policy |
| 64 | Push Config Policy ${CONFIG_POLICY_VFW_NAME} ${CONFIG_POLICY_VFW_TYPE} |
| 65 | #VFW Policy Tests |
| 66 | |
| 67 | VDNS Config Policy |
| 68 | ${CONFIG_POLICY_VDNS_NAME}= Create Config VDNS Policy |
| 69 | Push Config Policy ${CONFIG_POLICY_VDNS_NAME} ${CONFIG_POLICY_VDNS_TYPE} |
| 70 | #VDNS Policy Tests |
| 71 | |
| 72 | VCPE Config Policy |
| 73 | ${CONFIG_POLICY_VCPE_NAME}= Create Config VCPE Policy |
| 74 | Push Config Policy ${CONFIG_POLICY_VCPE_NAME} ${CONFIG_POLICY_VCPE_TYPE} |
| 75 | #VCPE Policy Tests |
| 76 | |
| 77 | VFW Ops Policy |
| 78 | ${OPS_POLICY_VFW_NAME}= Create Ops VFW Policy |
| 79 | Push Ops Policy ${OPS_POLICY_VFW_NAME} ${OPS_POLICY_VFW_TYPE} |
| 80 | |
| 81 | VDNS Ops Policy |
| 82 | ${OPS_POLICY_VDNS_NAME}= Create Ops VDNS Policy |
| 83 | Push Ops Policy ${OPS_POLICY_VDNS_NAME} ${OPS_POLICY_VDNS_TYPE} |
| 84 | |
| 85 | VCPE Ops Policy |
| 86 | ${OPS_POLICY_VCPE_NAME}= Create Ops VCPE Policy |
| 87 | Push Ops Policy ${OPS_POLICY_VCPE_NAME} ${OPS_POLICY_VCPE_TYPE} |
| 88 | |
| 89 | VOLTE Ops Policy |
| 90 | ${OPS_POLICY_VOLTE_NAME}= Create Ops VOLTE Policy |
| 91 | Push Ops Policy ${OPS_POLICY_VOLTE_NAME} ${OPS_POLICY_VOLTE_TYPE} |
| 92 | #VOLTE Policy Tests |
| 93 | |
| 94 | VFW SDNC Naming Policy |
| 95 | ${SDNC_POLICY_VFW_NAME}= Create VFW SDNC Naming Policy |
| 96 | Push Config Policy ${SDNC_POLICY_VFW_NAME} ${CONFIG_POLICY_VFW_TYPE} |
| 97 | #VFW Policy Tests |
| 98 | |
| 99 | VPG SDNC Naming Policy |
| 100 | ${SDNC_POLICY_VPG_NAME}= Create VPG SDNC Naming Policy |
| 101 | Push Config Policy ${SDNC_POLICY_VPG_NAME} ${CONFIG_POLICY_VFW_TYPE} |
| 102 | #VPG Policy Tests |
| 103 | |
| 104 | HPA OOF Policy |
| 105 | ${OOF_POLICY_HPA_NAME}= Create OOF HPA Policy |
| 106 | Push Config Policy ${OOF_POLICY_HPA_NAME} ${OOF_POLICY_HPA_TYPE} |
| 107 | #HPA Policy Tests |
| 108 | |
| 109 | VFW Get Configs Policy |
| 110 | Sleep 5s |
| 111 | Get Configs VFW Policy |
| 112 | |
| 113 | VDNS Get Configs Policy |
| 114 | Sleep 5s |
| 115 | Get Configs VDNS Policy |
| 116 | |
| 117 | VCPE Get Configs Policy |
| 118 | Sleep 5s |
| 119 | Get Configs VCPE Policy |
| 120 | |
| 121 | HPA Get OOF Policy |
| 122 | Sleep 5s |
| 123 | Get OOF HPA Policy |
| 124 | |
HOCKLA | 3e332f4 | 2019-02-20 09:32:19 -0600 | [diff] [blame] | 125 | ListPolicy |
| 126 | ListPolicy test com.Config_Sample.1.xml |
| 127 | |
HOCKLA | 092093d | 2019-04-05 13:00:50 -0500 | [diff] [blame] | 128 | Multiple Push Policy |
| 129 | ${MULTIPLE_PUSH_POLICY_NAME1}= Create Ops VDNS Policy |
| 130 | ${MULTIPLE_PUSH_POLICY_NAME2}= Create Ops VDNS Policy |
| 131 | ${MULTIPLE_PUSH_POLICY_NAME3}= Create Ops VDNS Policy |
| 132 | Push Multiple Policy test ${MULTIPLE_PUSH_POLICY_NAME1} ${MULTIPLE_PUSH_POLICY_NAME2} ${MULTIPLE_PUSH_POLICY_NAME3} ${OPS_POLICY_VDNS_TYPE} |
| 133 | Sleep 5s |
| 134 | Delete Multiple Policy test ${MULTIPLE_PUSH_POLICY_NAME1} ${MULTIPLE_PUSH_POLICY_NAME2} ${MULTIPLE_PUSH_POLICY_NAME3} ${OPS_POLICY_VDNS_TYPE} |
| 135 | |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 136 | *** Keywords *** |
| 137 | |
| 138 | VFW Policy Tests |
| 139 | ${CONFIG_POLICY_VFW_NAME}= Create Config VFW Policy |
| 140 | Push Config Policy ${CONFIG_POLICY_VFW_NAME} ${CONFIG_POLICY_VFW_TYPE} |
| 141 | Get Configs VFW Policy |
| 142 | ${OPS_POLICY_VFW_NAME}= Create Ops VFW Policy |
| 143 | Push Ops Policy ${OPS_POLICY_VFW_NAME} ${OPS_POLICY_VFW_TYPE} |
| 144 | ${SDNC_POLICY_VFW_NAME}= Create VFW SDNC Naming Policy |
| 145 | Push Config Policy ${CONFIG_POLICY_VFW_NAME} ${CONFIG_POLICY_VFW_TYPE} |
| 146 | |
| 147 | VDNS Policy Tests |
| 148 | ${CONFIG_POLICY_VDNS_NAME}= Create Config VDNS Policy |
| 149 | Push Config Policy ${CONFIG_POLICY_VDNS_NAME} ${CONFIG_POLICY_VDNS_TYPE} |
| 150 | Get Configs VDNS Policy |
| 151 | ${OPS_POLICY_VDNS_NAME}= Create Ops VDNS Policy |
| 152 | Push Ops Policy ${OPS_POLICY_VDNS_NAME} ${OPS_POLICY_VDNS_TYPE} |
| 153 | |
| 154 | VCPE Policy Tests |
| 155 | ${CONFIG_POLICY_VCPE_NAME}= Create Config VCPE Policy |
| 156 | Push Config Policy ${CONFIG_POLICY_VCPE_NAME} ${CONFIG_POLICY_VCPE_TYPE} |
| 157 | Get Configs VCPE Policy |
| 158 | ${OPS_POLICY_VCPE_NAME}= Create Ops VCPE Policy |
| 159 | Push Ops Policy ${OPS_POLICY_VCPE_NAME} ${OPS_POLICY_VCPE_TYPE} |
| 160 | |
| 161 | VPG Policy Tests |
| 162 | ${SDNC_POLICY_VPG_NAME}= Create VPG SDNC Naming Policy |
| 163 | Push Config Policy ${SDNC_POLICY_VPG_NAME} ${CONFIG_POLICY_VFW_TYPE} |
| 164 | |
| 165 | VOLTE Policy Tests |
| 166 | ${OPS_POLICY_VOLTE_NAME}= Create Ops VOLTE Policy |
| 167 | Push Ops Policy ${OPS_POLICY_VOLTE_NAME} ${OPS_POLICY_VOLTE_TYPE} |
| 168 | |
| 169 | HPA Policy Tests |
| 170 | ${OOF_POLICY_HPA_NAME}= Create OOF HPA Policy |
| 171 | Push Config Policy ${OOF_POLICY_HPA_NAME} ${OOF_POLICY_HPA_TYPE} |
| 172 | Get OOF HPA Policy |
| 173 | |
| 174 | Get Configs VFW Policy |
| 175 | [Documentation] Get Config Policy for VFW |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 176 | Create Environment policy ${CURDIR} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 177 | ${getconfigpolicy}= Catenate .*${CONFIG_POLICY_VFW_NAME}* |
| 178 | ${configpolicy_name}= Create Dictionary config_policy_name=${getconfigpolicy} |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 179 | ${output} = Apply Template policy ${GETCONFIG_TEMPLATE} ${configpolicy_name} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 180 | ${get_resp} = Run Policy Get Configs Request ${RESOURCE_PATH_GET_CONFIG} ${output} |
| 181 | Should Be Equal As Strings ${get_resp.status_code} 200 |
| 182 | |
| 183 | Create OOF HPA Policy |
| 184 | [Documentation] Create OOF Policy |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 185 | Create Environment policy ${CURDIR} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 186 | ${randompolicyname} = Create Policy Name |
| 187 | ${policyname1}= Catenate com.${randompolicyname}_HPA |
| 188 | ${OOF_POLICY_HPA_NAME}= Set Test Variable ${policyname1} |
| 189 | ${hpapolicy}= Create Dictionary policy_name=${policyname1} |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 190 | ${output} = Apply Template policy ${CREATE_OOF_HPA_TEMPLATE} ${hpapolicy} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 191 | ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} |
| 192 | Log ${put_resp} |
| 193 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 194 | [Return] ${policyname1} |
| 195 | |
| 196 | Get OOF HPA Policy |
| 197 | [Documentation] Get OOF Policy for HPA |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 198 | Create Environment policy ${CURDIR} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 199 | ${gethpapolicy}= Catenate .*${OOF_POLICY_HPA_NAME}* |
| 200 | ${hpapolicy_name}= Create Dictionary oof_policy_name=${gethpapolicy} |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 201 | ${output} = Apply Template policy ${GETOOF_TEMPLATE} ${hpapolicy_name} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 202 | ${get_resp} = Run Policy Get Configs Request ${RESOURCE_PATH_GET_CONFIG} ${output} |
| 203 | Should Be Equal As Strings ${get_resp.status_code} 200 |
| 204 | |
| 205 | Create Config VFW Policy |
| 206 | [Documentation] Create Config Policy |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 207 | Create Environment policy ${CURDIR} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 208 | ${randompolicyname} = Create Policy Name |
| 209 | ${policyname1}= Catenate com.${randompolicyname}_vFirewall |
| 210 | ${CONFIG_POLICY_VFW_NAME}= Set Test Variable ${policyname1} |
| 211 | ${configpolicy}= Create Dictionary policy_name=${policyname1} |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 212 | ${output} = Apply Template policy ${CREATE_CONFIG_VFW_TEMPLATE} ${configpolicy} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 213 | ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} |
| 214 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 215 | [Return] ${policyname1} |
| 216 | |
| 217 | Create VPG SDNC Naming Policy |
| 218 | [Documentation] Create VPG SDNC Naming Policy |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 219 | Create Environment policy ${CURDIR} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 220 | ${randompolicyname} = Create Policy Name |
| 221 | ${policyname1}= Catenate com.${randompolicyname}_ONAP_vPG_Naming |
| 222 | ${SDNC_POLICY_VPG_NAME}= Set Test Variable ${policyname1} |
| 223 | ${sdncpolicy}= Create Dictionary policy_name=${policyname1} |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 224 | ${output} = Apply Template policy ${CREATE_SDNC_VPG_TEMPLATE} ${sdncpolicy} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 225 | ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} |
| 226 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 227 | [Return] ${policyname1} |
| 228 | |
| 229 | Create VFW SDNC Naming Policy |
| 230 | [Documentation] Create VFW SDNC Naming Policy |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 231 | Create Environment policy ${CURDIR} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 232 | ${randompolicyname} = Create Policy Name |
| 233 | ${policyname1}= Catenate com.${randompolicyname}_ONAP_vFW_Naming |
| 234 | ${SDNC_POLICY_VFW_NAME}= Set Test Variable ${policyname1} |
| 235 | ${sdncpolicy}= Create Dictionary policy_name=${policyname1} |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 236 | ${output} = Apply Template policy ${CREATE_SDNC_VFW_TEMPLATE} ${sdncpolicy} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 237 | ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} |
| 238 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 239 | [Return] ${policyname1} |
| 240 | |
| 241 | Create Policy Name |
| 242 | [Documentation] Generate Policy Name |
| 243 | [Arguments] ${prefix}=CSIT_ |
| 244 | ${random}= Generate Random String 15 [LOWER][NUMBERS] |
| 245 | ${policyname}= Catenate ${prefix}${random} |
| 246 | [Return] ${policyname} |
| 247 | |
| 248 | Create Ops VFW Policy |
| 249 | [Documentation] Create Operational Policy |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 250 | Create Environment policy ${CURDIR} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 251 | ${randompolicyname} = Create Policy Name |
| 252 | ${policyname1}= Catenate com.${randompolicyname}_vFirewall |
| 253 | ${OPS_POLICY_VFW_NAME}= Set Test Variable ${policyname1} |
| 254 | ${dict}= Create Dictionary policy_name=${policyname1} |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 255 | ${output} = Apply Template policy ${CREATE_OPS_VFW_TEMPLATE} ${dict} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 256 | ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} |
| 257 | Log ${put_resp} |
| 258 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 259 | [Return] ${policyname1} |
| 260 | |
| 261 | Push Ops Policy |
| 262 | [Documentation] Push Ops Policy |
| 263 | [Arguments] ${policyname} ${policytype} |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 264 | Create Environment policy ${CURDIR} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 265 | ${dict}= Create Dictionary policy_name=${policyname} policy_type=${policytype} |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 266 | ${output} = Apply Template policy ${PUSH_POLICY_TEMPLATE} ${dict} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 267 | ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE_PUSH} ${output} |
| 268 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 269 | |
| 270 | Push Config Policy |
| 271 | [Documentation] Push Config Policy |
| 272 | [Arguments] ${policyname} ${policytype} |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 273 | Create Environment policy ${CURDIR} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 274 | ${dict}= Create Dictionary policy_name=${policyname} policy_type=${policytype} |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 275 | ${output} = Apply Template policy ${PUSH_POLICY_TEMPLATE} ${dict} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 276 | ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE_PUSH} ${output} |
| 277 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 278 | |
| 279 | Delete Ops Policy |
| 280 | [Documentation] Delete Config Policy |
| 281 | [Arguments] ${policy_name} |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 282 | Create Environment policy ${CURDIR} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 283 | ${policyname3}= Catenate com.Config_BRMS_Param_${policyname}.1.xml |
| 284 | ${dict}= Create Dictionary policy_name=${policyname3} |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 285 | ${output} = Apply Template policy ${DEL_POLICY_TEMPLATE} ${dict} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 286 | ${put_resp} = Run Policy Delete Request ${RESOURCE_PATH_CREATE_DELETE} ${output} |
| 287 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 288 | |
| 289 | Delete Config Policy |
| 290 | [Documentation] Delete Ops Policy |
| 291 | [Arguments] ${policy_name} |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 292 | Create Environment policy ${CURDIR} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 293 | ${policyname3}= Catenate com.Config_MS_com.${policy_name}.1.xml |
| 294 | ${dict}= Create Dictionary policy_name=${policyname3} |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 295 | ${output} = Apply Template policy ${DEL_POLICY_TEMPLATE} ${dict} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 296 | ${put_resp} = Run Policy Delete Request ${RESOURCE_PATH_CREATE_DELETE} ${output} |
| 297 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 298 | |
| 299 | Delete OOF Policy |
| 300 | [Documentation] Delete OOF Policy |
| 301 | [Arguments] ${policy_name} |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 302 | Create Environment policy ${CURDIR} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 303 | ${policyname3}= Catenate com.Config_OOF_${policy_name}.1.xml |
| 304 | ${dict}= Create Dictionary policy_name=${policyname3} |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 305 | ${output} = Apply Template policy ${DEL_POLICY_TEMPLATE} ${dict} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 306 | ${put_resp} = Run Policy Delete Request ${RESOURCE_PATH_CREATE_DELETE} ${output} |
| 307 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 308 | |
| 309 | Get Configs VDNS Policy |
| 310 | [Documentation] Get Config Policy for VDNS |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 311 | Create Environment policy ${CURDIR} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 312 | ${getconfigpolicy}= Catenate .*${CONFIG_POLICY_VDNS_NAME}* |
| 313 | ${configpolicy_name}= Create Dictionary config_policy_name=${getconfigpolicy} |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 314 | ${output} = Apply Template policy ${GETCONFIG_TEMPLATE} ${configpolicy_name} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 315 | ${get_resp} = Run Policy Get Configs Request ${RESOURCE_PATH_GET_CONFIG} ${output} |
| 316 | Should Be Equal As Strings ${get_resp.status_code} 200 |
| 317 | |
| 318 | Create Config VDNS Policy |
| 319 | [Documentation] Create Config Policy |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 320 | Create Environment policy ${CURDIR} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 321 | ${randompolicyname} = Create Policy Name |
| 322 | ${policyname1}= Catenate com.${randompolicyname}_vLoadBalancer |
| 323 | ${CONFIG_POLICY_VDNS_NAME}= Set Test Variable ${policyname1} |
| 324 | ${configpolicy}= Create Dictionary policy_name=${policyname1} |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 325 | ${output} = Apply Template policy ${CREATE_CONFIG_VDNS_TEMPLATE} ${configpolicy} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 326 | ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} |
| 327 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 328 | [Return] ${policyname1} |
| 329 | |
| 330 | Create Ops VDNS Policy |
| 331 | [Documentation] Create Operational Policy |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 332 | Create Environment policy ${CURDIR} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 333 | ${randompolicyname} = Create Policy Name |
| 334 | ${policyname1}= Catenate com.${randompolicyname}_vLoadBalancer |
| 335 | ${OPS_POLICY_VDNS_NAME}= Set Test Variable ${policyname1} |
| 336 | ${dict}= Create Dictionary policy_name=${policyname1} |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 337 | ${output} = Apply Template policy ${CREATE_OPS_VDNS_TEMPLATE} ${dict} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 338 | ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} |
| 339 | Log ${put_resp} |
| 340 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 341 | [Return] ${policyname1} |
| 342 | |
| 343 | Create Config VCPE Policy |
| 344 | [Documentation] Create Config Policy |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 345 | Create Environment policy ${CURDIR} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 346 | ${randompolicyname} = Create Policy Name |
| 347 | ${policyname1}= Catenate com.${randompolicyname}_vCPE |
| 348 | ${CONFIG_POLICY_VCPE_NAME}= Set Test Variable ${policyname1} |
| 349 | ${configpolicy}= Create Dictionary policy_name=${policyname1} |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 350 | ${output} = Apply Template policy ${CREATE_CONFIG_VCPE_TEMPLATE} ${configpolicy} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 351 | ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} |
| 352 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 353 | [Return] ${policyname1} |
| 354 | |
| 355 | Get Configs VCPE Policy |
| 356 | [Documentation] Get Config Policy for VCPE |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 357 | Create Environment policy ${CURDIR} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 358 | ${getconfigpolicy}= Catenate .*${CONFIG_POLICY_VCPE_NAME}* |
| 359 | ${configpolicy_name}= Create Dictionary config_policy_name=${getconfigpolicy} |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 360 | ${output} = Apply Template policy ${GETCONFIG_TEMPLATE} ${configpolicy_name} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 361 | ${get_resp} = Run Policy Get Configs Request ${RESOURCE_PATH_GET_CONFIG} ${output} |
| 362 | Should Be Equal As Strings ${get_resp.status_code} 200 |
| 363 | |
| 364 | Create Ops vCPE Policy |
| 365 | [Documentation] Create Operational Policy |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 366 | Create Environment policy ${CURDIR} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 367 | ${randompolicyname} = Create Policy Name |
| 368 | ${policyname1}= Catenate com.${randompolicyname}_vCPE |
| 369 | ${OPS_POLICY_VCPE_NAME}= Set Test Variable ${policyname1} |
| 370 | ${dict}= Create Dictionary policy_name=${policyname1} |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 371 | ${output} = Apply Template policy ${CREATE_OPS_VCPE_TEMPLATE} ${dict} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 372 | ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} |
| 373 | Log ${put_resp} |
| 374 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 375 | [Return] ${policyname1} |
| 376 | |
| 377 | Create Ops VolTE Policy |
| 378 | [Documentation] Create Operational Policy |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 379 | Create Environment policy ${CURDIR} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 380 | ${randompolicyname} = Create Policy Name |
| 381 | ${policyname1}= Catenate com.${randompolicyname}_VoLTE |
| 382 | ${dict}= Create Dictionary policy_name=${policyname1} |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 383 | ${output} = Apply Template policy ${CREATE_OPS_VOLTE_TEMPLATE} ${dict} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 384 | ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} |
| 385 | Log ${put_resp} |
| 386 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 387 | [Return] ${policyname1} |
| 388 | |
| 389 | Upload DRL file |
| 390 | [Documentation] Upload DRL file1 |
| 391 | ${file_data}= Get Binary File ${file_path} |
| 392 | ${files}= Create Dictionary file=${file_data} |
| 393 | #${CONFIG_POLICY_VDNS_NAME}= Set Test Variable ${policyname1} |
| 394 | # ${files2} = {'file': open('../testsuite/robot/assets/templates/ControlLoopDemo__closedLoopControlName.drl', 'rb')} |
| 395 | # ${files}= Create Dictionary file ${file_data} |
| 396 | ${put_resp} = Run Policy Post form Request ${RESOURCE_PATH_UPLOAD} ${files} |
| 397 | Should Be Equal As Strings ${put_resp.status_code} 200 |
HOCKLA | 3e332f4 | 2019-02-20 09:32:19 -0600 | [diff] [blame] | 398 | |
| 399 | ListPolicy test |
| 400 | [Documentation] Listing Config Policies |
| 401 | [Arguments] ${policy_name} |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 402 | Create Environment policy ${CURDIR} |
HOCKLA | 3e332f4 | 2019-02-20 09:32:19 -0600 | [diff] [blame] | 403 | ${dict}= Create Dictionary policy_name=${policy_name} |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 404 | ${output} = Apply Template policy ${LISTPOLICY_TEMPLATE} ${dict} |
HOCKLA | 3e332f4 | 2019-02-20 09:32:19 -0600 | [diff] [blame] | 405 | ${put_resp} = policy_interface.Run Policy Post Request ${RESOURCE_PATH_LISTPOLICY} ${output} |
| 406 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 407 | |
HOCKLA | 092093d | 2019-04-05 13:00:50 -0500 | [diff] [blame] | 408 | Push Multiple Policy test |
| 409 | [Documentation] Push Multiple Policy |
| 410 | [Arguments] ${policyname1} ${policyname2} ${policyname3} ${policytype} |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 411 | Create Environment policy ${CURDIR} |
HOCKLA | 092093d | 2019-04-05 13:00:50 -0500 | [diff] [blame] | 412 | ${dict}= Create Dictionary policy_name1=${policyname1} policy_name2=${policyname2} policy_name3=${policyname3} policy_type=${policytype} |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 413 | ${output} = Apply Template policy ${MULTIPLE_PUSH_POLICY_TEMPLATE} ${dict} |
HOCKLA | 092093d | 2019-04-05 13:00:50 -0500 | [diff] [blame] | 414 | ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE_PUSH} ${output} |
| 415 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 416 | |
| 417 | Delete Multiple Policy test |
| 418 | [Documentation] Delete Multiple Policy |
| 419 | [Arguments] ${policyname1} ${policyname2} ${policyname3} ${policytype} |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 420 | Create Environment policy ${CURDIR} |
HOCKLA | 092093d | 2019-04-05 13:00:50 -0500 | [diff] [blame] | 421 | ${dict}= Create Dictionary policy_name1=${policyname1} policy_name2=${policyname2} policy_name3=${policyname3} policy_type=${policytype} |
DR695H | 1a207a4 | 2019-06-20 17:20:56 -0400 | [diff] [blame] | 422 | ${output} = Apply Template policy ${MULTIPLE_UNPUSH_POLICY_TEMPLATE} ${dict} |
HOCKLA | 092093d | 2019-04-05 13:00:50 -0500 | [diff] [blame] | 423 | ${put_resp} = Run Policy Delete Request ${RESOURCE_PATH_CREATE_DELETE} ${output} |
| 424 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 425 | |