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