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 |
| 7 | Resource policy_interface.robot |
| 8 | Resource json_templater.robot |
| 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 |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 16 | ${CREATE_CONFIG_VFW_TEMPLATE} ${CURDIR}/configpolicy_vFW_R1.template |
| 17 | ${CREATE_CONFIG_VDNS_TEMPLATE} ${CURDIR}/configpolicy_vDNS_R1.template |
| 18 | ${CREATE_CONFIG_VCPE_TEMPLATE} ${CURDIR}/configpolicy_vCPE_R1.template |
| 19 | ${CREATE_OPS_VFW_TEMPLATE} ${CURDIR}/opspolicy_VFW_R1.template |
| 20 | ${CREATE_OOF_HPA_TEMPLATE} ${CURDIR}/oofpolicy_HPA_R1.template |
| 21 | ${CREATE_SDNC_VFW_TEMPLATE} ${CURDIR}/sdncnamingpolicy_vFW.template |
| 22 | ${CREATE_SDNC_VPG_TEMPLATE} ${CURDIR}/sdncnamingpolicy_vPG.template |
| 23 | ${PUSH_POLICY_TEMPLATE} ${CURDIR}/pushpolicy.template |
HOCKLA | 092093d | 2019-04-05 13:00:50 -0500 | [diff] [blame] | 24 | ${MULTIPLE_PUSH_POLICY_TEMPLATE} ${CURDIR}/multiple_pushpolicy.template |
| 25 | ${MULTIPLE_UNPUSH_POLICY_TEMPLATE} ${CURDIR}/multiple_unpushpolicy.template |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 26 | ${CREATE_OPS_VDNS_TEMPLATE} ${CURDIR}/opspolicy_VDNS_R1.template |
| 27 | ${DEL_POLICY_TEMPLATE} ${CURDIR}/deletepolicy.template |
| 28 | ${GETCONFIG_TEMPLATE} ${CURDIR}/getconfigpolicy.template |
| 29 | ${GETOOF_TEMPLATE} ${CURDIR}/getoofpolicy.template |
HOCKLA | 3e332f4 | 2019-02-20 09:32:19 -0600 | [diff] [blame] | 30 | ${LISTPOLICY_TEMPLATE} ${CURDIR}/listpolicy.template |
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 |
| 54 | ${CREATE_OPS_VCPE_TEMPLATE} ${CURDIR}/opspolicy_vCPE_R1.template |
| 55 | ${CREATE_OPS_VOLTE_TEMPLATE} ${CURDIR}/opspolicy_vOLTE_R1.template |
| 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 |
| 176 | ${getconfigpolicy}= Catenate .*${CONFIG_POLICY_VFW_NAME}* |
| 177 | ${configpolicy_name}= Create Dictionary config_policy_name=${getconfigpolicy} |
| 178 | ${output} = Fill JSON Template File ${GETCONFIG_TEMPLATE} ${configpolicy_name} |
| 179 | ${get_resp} = Run Policy Get Configs Request ${RESOURCE_PATH_GET_CONFIG} ${output} |
| 180 | Should Be Equal As Strings ${get_resp.status_code} 200 |
| 181 | |
| 182 | Create OOF HPA Policy |
| 183 | [Documentation] Create OOF Policy |
| 184 | ${randompolicyname} = Create Policy Name |
| 185 | ${policyname1}= Catenate com.${randompolicyname}_HPA |
| 186 | ${OOF_POLICY_HPA_NAME}= Set Test Variable ${policyname1} |
| 187 | ${hpapolicy}= Create Dictionary policy_name=${policyname1} |
| 188 | ${output} = Fill JSON Template File ${CREATE_OOF_HPA_TEMPLATE} ${hpapolicy} |
| 189 | ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} |
| 190 | Log ${put_resp} |
| 191 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 192 | [Return] ${policyname1} |
| 193 | |
| 194 | Get OOF HPA Policy |
| 195 | [Documentation] Get OOF Policy for HPA |
| 196 | ${gethpapolicy}= Catenate .*${OOF_POLICY_HPA_NAME}* |
| 197 | ${hpapolicy_name}= Create Dictionary oof_policy_name=${gethpapolicy} |
| 198 | ${output} = Fill JSON Template File ${GETOOF_TEMPLATE} ${hpapolicy_name} |
| 199 | ${get_resp} = Run Policy Get Configs Request ${RESOURCE_PATH_GET_CONFIG} ${output} |
| 200 | Should Be Equal As Strings ${get_resp.status_code} 200 |
| 201 | |
| 202 | Create Config VFW Policy |
| 203 | [Documentation] Create Config Policy |
| 204 | ${randompolicyname} = Create Policy Name |
| 205 | ${policyname1}= Catenate com.${randompolicyname}_vFirewall |
| 206 | ${CONFIG_POLICY_VFW_NAME}= Set Test Variable ${policyname1} |
| 207 | ${configpolicy}= Create Dictionary policy_name=${policyname1} |
| 208 | ${output} = Fill JSON Template File ${CREATE_CONFIG_VFW_TEMPLATE} ${configpolicy} |
| 209 | ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} |
| 210 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 211 | [Return] ${policyname1} |
| 212 | |
| 213 | Create VPG SDNC Naming Policy |
| 214 | [Documentation] Create VPG SDNC Naming Policy |
| 215 | ${randompolicyname} = Create Policy Name |
| 216 | ${policyname1}= Catenate com.${randompolicyname}_ONAP_vPG_Naming |
| 217 | ${SDNC_POLICY_VPG_NAME}= Set Test Variable ${policyname1} |
| 218 | ${sdncpolicy}= Create Dictionary policy_name=${policyname1} |
| 219 | ${output} = Fill JSON Template File ${CREATE_SDNC_VPG_TEMPLATE} ${sdncpolicy} |
| 220 | ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} |
| 221 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 222 | [Return] ${policyname1} |
| 223 | |
| 224 | Create VFW SDNC Naming Policy |
| 225 | [Documentation] Create VFW SDNC Naming Policy |
| 226 | ${randompolicyname} = Create Policy Name |
| 227 | ${policyname1}= Catenate com.${randompolicyname}_ONAP_vFW_Naming |
| 228 | ${SDNC_POLICY_VFW_NAME}= Set Test Variable ${policyname1} |
| 229 | ${sdncpolicy}= Create Dictionary policy_name=${policyname1} |
| 230 | ${output} = Fill JSON Template File ${CREATE_SDNC_VFW_TEMPLATE} ${sdncpolicy} |
| 231 | ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} |
| 232 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 233 | [Return] ${policyname1} |
| 234 | |
| 235 | Create Policy Name |
| 236 | [Documentation] Generate Policy Name |
| 237 | [Arguments] ${prefix}=CSIT_ |
| 238 | ${random}= Generate Random String 15 [LOWER][NUMBERS] |
| 239 | ${policyname}= Catenate ${prefix}${random} |
| 240 | [Return] ${policyname} |
| 241 | |
| 242 | Create Ops VFW Policy |
| 243 | [Documentation] Create Operational Policy |
| 244 | ${randompolicyname} = Create Policy Name |
| 245 | ${policyname1}= Catenate com.${randompolicyname}_vFirewall |
| 246 | ${OPS_POLICY_VFW_NAME}= Set Test Variable ${policyname1} |
| 247 | ${dict}= Create Dictionary policy_name=${policyname1} |
| 248 | ${output} = Fill JSON Template File ${CREATE_OPS_VFW_TEMPLATE} ${dict} |
| 249 | ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} |
| 250 | Log ${put_resp} |
| 251 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 252 | [Return] ${policyname1} |
| 253 | |
| 254 | Push Ops Policy |
| 255 | [Documentation] Push Ops Policy |
| 256 | [Arguments] ${policyname} ${policytype} |
| 257 | ${dict}= Create Dictionary policy_name=${policyname} policy_type=${policytype} |
| 258 | ${output} = Fill JSON Template File ${PUSH_POLICY_TEMPLATE} ${dict} |
| 259 | ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE_PUSH} ${output} |
| 260 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 261 | |
| 262 | Push Config Policy |
| 263 | [Documentation] Push Config Policy |
| 264 | [Arguments] ${policyname} ${policytype} |
| 265 | ${dict}= Create Dictionary policy_name=${policyname} policy_type=${policytype} |
| 266 | ${output} = Fill JSON Template File ${PUSH_POLICY_TEMPLATE} ${dict} |
| 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 | Delete Ops Policy |
| 271 | [Documentation] Delete Config Policy |
| 272 | [Arguments] ${policy_name} |
| 273 | ${policyname3}= Catenate com.Config_BRMS_Param_${policyname}.1.xml |
| 274 | ${dict}= Create Dictionary policy_name=${policyname3} |
| 275 | ${output} = Fill JSON Template ${DEL_POLICY_TEMPLATE} ${dict} |
| 276 | ${put_resp} = Run Policy Delete Request ${RESOURCE_PATH_CREATE_DELETE} ${output} |
| 277 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 278 | |
| 279 | Delete Config Policy |
| 280 | [Documentation] Delete Ops Policy |
| 281 | [Arguments] ${policy_name} |
| 282 | ${policyname3}= Catenate com.Config_MS_com.${policy_name}.1.xml |
| 283 | ${dict}= Create Dictionary policy_name=${policyname3} |
| 284 | ${output} = Fill JSON Template ${DEL_POLICY_TEMPLATE} ${dict} |
| 285 | ${put_resp} = Run Policy Delete Request ${RESOURCE_PATH_CREATE_DELETE} ${output} |
| 286 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 287 | |
| 288 | Delete OOF Policy |
| 289 | [Documentation] Delete OOF Policy |
| 290 | [Arguments] ${policy_name} |
| 291 | ${policyname3}= Catenate com.Config_OOF_${policy_name}.1.xml |
| 292 | ${dict}= Create Dictionary policy_name=${policyname3} |
| 293 | ${output} = Fill JSON Template ${DEL_POLICY_TEMPLATE} ${dict} |
| 294 | ${put_resp} = Run Policy Delete Request ${RESOURCE_PATH_CREATE_DELETE} ${output} |
| 295 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 296 | |
| 297 | Get Configs VDNS Policy |
| 298 | [Documentation] Get Config Policy for VDNS |
| 299 | ${getconfigpolicy}= Catenate .*${CONFIG_POLICY_VDNS_NAME}* |
| 300 | ${configpolicy_name}= Create Dictionary config_policy_name=${getconfigpolicy} |
| 301 | ${output} = Fill JSON Template File ${GETCONFIG_TEMPLATE} ${configpolicy_name} |
| 302 | ${get_resp} = Run Policy Get Configs Request ${RESOURCE_PATH_GET_CONFIG} ${output} |
| 303 | Should Be Equal As Strings ${get_resp.status_code} 200 |
| 304 | |
| 305 | Create Config VDNS Policy |
| 306 | [Documentation] Create Config Policy |
| 307 | ${randompolicyname} = Create Policy Name |
| 308 | ${policyname1}= Catenate com.${randompolicyname}_vLoadBalancer |
| 309 | ${CONFIG_POLICY_VDNS_NAME}= Set Test Variable ${policyname1} |
| 310 | ${configpolicy}= Create Dictionary policy_name=${policyname1} |
| 311 | ${output} = Fill JSON Template File ${CREATE_CONFIG_VDNS_TEMPLATE} ${configpolicy} |
| 312 | ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} |
| 313 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 314 | [Return] ${policyname1} |
| 315 | |
| 316 | Create Ops VDNS Policy |
| 317 | [Documentation] Create Operational Policy |
| 318 | ${randompolicyname} = Create Policy Name |
| 319 | ${policyname1}= Catenate com.${randompolicyname}_vLoadBalancer |
| 320 | ${OPS_POLICY_VDNS_NAME}= Set Test Variable ${policyname1} |
| 321 | ${dict}= Create Dictionary policy_name=${policyname1} |
| 322 | ${output} = Fill JSON Template File ${CREATE_OPS_VDNS_TEMPLATE} ${dict} |
| 323 | ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} |
| 324 | Log ${put_resp} |
| 325 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 326 | [Return] ${policyname1} |
| 327 | |
| 328 | Create Config VCPE Policy |
| 329 | [Documentation] Create Config Policy |
| 330 | ${randompolicyname} = Create Policy Name |
| 331 | ${policyname1}= Catenate com.${randompolicyname}_vCPE |
| 332 | ${CONFIG_POLICY_VCPE_NAME}= Set Test Variable ${policyname1} |
| 333 | ${configpolicy}= Create Dictionary policy_name=${policyname1} |
| 334 | ${output} = Fill JSON Template File ${CREATE_CONFIG_VCPE_TEMPLATE} ${configpolicy} |
| 335 | ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} |
| 336 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 337 | [Return] ${policyname1} |
| 338 | |
| 339 | Get Configs VCPE Policy |
| 340 | [Documentation] Get Config Policy for VCPE |
| 341 | ${getconfigpolicy}= Catenate .*${CONFIG_POLICY_VCPE_NAME}* |
| 342 | ${configpolicy_name}= Create Dictionary config_policy_name=${getconfigpolicy} |
| 343 | ${output} = Fill JSON Template File ${GETCONFIG_TEMPLATE} ${configpolicy_name} |
| 344 | ${get_resp} = Run Policy Get Configs Request ${RESOURCE_PATH_GET_CONFIG} ${output} |
| 345 | Should Be Equal As Strings ${get_resp.status_code} 200 |
| 346 | |
| 347 | Create Ops vCPE Policy |
| 348 | [Documentation] Create Operational Policy |
| 349 | ${randompolicyname} = Create Policy Name |
| 350 | ${policyname1}= Catenate com.${randompolicyname}_vCPE |
| 351 | ${OPS_POLICY_VCPE_NAME}= Set Test Variable ${policyname1} |
| 352 | ${dict}= Create Dictionary policy_name=${policyname1} |
| 353 | ${output} = Fill JSON Template File ${CREATE_OPS_VCPE_TEMPLATE} ${dict} |
| 354 | ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} |
| 355 | Log ${put_resp} |
| 356 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 357 | [Return] ${policyname1} |
| 358 | |
| 359 | Create Ops VolTE Policy |
| 360 | [Documentation] Create Operational Policy |
| 361 | ${randompolicyname} = Create Policy Name |
| 362 | ${policyname1}= Catenate com.${randompolicyname}_VoLTE |
| 363 | ${dict}= Create Dictionary policy_name=${policyname1} |
| 364 | ${output} = Fill JSON Template File ${CREATE_OPS_VOLTE_TEMPLATE} ${dict} |
| 365 | ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output} |
| 366 | Log ${put_resp} |
| 367 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 368 | [Return] ${policyname1} |
| 369 | |
| 370 | Upload DRL file |
| 371 | [Documentation] Upload DRL file1 |
| 372 | ${file_data}= Get Binary File ${file_path} |
| 373 | ${files}= Create Dictionary file=${file_data} |
| 374 | #${CONFIG_POLICY_VDNS_NAME}= Set Test Variable ${policyname1} |
| 375 | # ${files2} = {'file': open('../testsuite/robot/assets/templates/ControlLoopDemo__closedLoopControlName.drl', 'rb')} |
| 376 | # ${files}= Create Dictionary file ${file_data} |
| 377 | ${put_resp} = Run Policy Post form Request ${RESOURCE_PATH_UPLOAD} ${files} |
| 378 | Should Be Equal As Strings ${put_resp.status_code} 200 |
HOCKLA | 3e332f4 | 2019-02-20 09:32:19 -0600 | [diff] [blame] | 379 | |
| 380 | ListPolicy test |
| 381 | [Documentation] Listing Config Policies |
| 382 | [Arguments] ${policy_name} |
| 383 | ${dict}= Create Dictionary policy_name=${policy_name} |
| 384 | ${output} = Fill JSON Template File ${LISTPOLICY_TEMPLATE} ${dict} |
| 385 | ${put_resp} = policy_interface.Run Policy Post Request ${RESOURCE_PATH_LISTPOLICY} ${output} |
| 386 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 387 | |
HOCKLA | 092093d | 2019-04-05 13:00:50 -0500 | [diff] [blame] | 388 | Push Multiple Policy test |
| 389 | [Documentation] Push Multiple Policy |
| 390 | [Arguments] ${policyname1} ${policyname2} ${policyname3} ${policytype} |
| 391 | ${dict}= Create Dictionary policy_name1=${policyname1} policy_name2=${policyname2} policy_name3=${policyname3} policy_type=${policytype} |
| 392 | ${output} = Fill JSON Template File ${MULTIPLE_PUSH_POLICY_TEMPLATE} ${dict} |
| 393 | ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE_PUSH} ${output} |
| 394 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 395 | |
| 396 | Delete Multiple Policy test |
| 397 | [Documentation] Delete Multiple Policy |
| 398 | [Arguments] ${policyname1} ${policyname2} ${policyname3} ${policytype} |
| 399 | ${dict}= Create Dictionary policy_name1=${policyname1} policy_name2=${policyname2} policy_name3=${policyname3} policy_type=${policytype} |
| 400 | ${output} = Fill JSON Template File ${MULTIPLE_UNPUSH_POLICY_TEMPLATE} ${dict} |
| 401 | ${put_resp} = Run Policy Delete Request ${RESOURCE_PATH_CREATE_DELETE} ${output} |
| 402 | Should Be Equal As Strings ${put_resp.status_code} 200 |
| 403 | |