DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation The main interface for interacting with SDN-GC. It handles low level stuff like managing the http request library and SDN-GC required fields |
| 3 | Library RequestsLibrary |
DR695H | 18872bc | 2019-06-13 16:16:52 -0400 | [diff] [blame] | 4 | Library ONAPLibrary.Utilities |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 5 | Library SeleniumLibrary |
DR695H | 8a61013 | 2019-07-01 16:16:02 -0400 | [diff] [blame] | 6 | Library OperatingSystem |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 7 | Library Collections |
| 8 | Library String |
DR695H | f6948fa | 2019-07-11 18:03:00 -0400 | [diff] [blame] | 9 | Library ONAPLibrary.ServiceMapping WITH NAME ServiceMapping |
DR695H | cccad65 | 2019-09-16 13:21:47 -0400 | [diff] [blame] | 10 | Library ONAPLibrary.PreloadData WITH NAME PreloadData |
DR695H | a6ce951 | 2019-07-19 14:25:43 -0400 | [diff] [blame] | 11 | Library ONAPLibrary.Templating WITH NAME Templating |
DR695H | f0ff3b8 | 2019-07-19 11:08:13 -0400 | [diff] [blame] | 12 | Library ONAPLibrary.SDNC WITH NAME SDNC |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 13 | Resource global_properties.robot |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 14 | Resource browser_setup.robot |
| 15 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 16 | |
| 17 | *** Variables *** |
| 18 | ${PRELOAD_VNF_TOPOLOGY_OPERATION_PATH} /operations/VNF-API:preload-vnf-topology-operation |
DR695H | 8a61013 | 2019-07-01 16:16:02 -0400 | [diff] [blame] | 19 | ${PRELOAD_NETWORK_TOPOLOGY_OPERATION_PATH} /operations/VNF-API:preload-network-topology-operation |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 20 | ${PRELOAD_VNF_CONFIG_PATH} /config/VNF-API:preload-vnfs/vnf-preload-list |
Brian Freeman | 059963c | 2019-10-24 09:55:40 -0500 | [diff] [blame] | 21 | ${PRELOAD_GRA_TOPOLOGY_OPERATION_PATH} /operations/GENERIC-RESOURCE-API:preload-vf-module-topology-operation |
| 22 | ${PRELOAD_GRA_CONFIG_PATH} /config/GENERIC-RESOURCE-API:preload-information |
DR695H | 8a61013 | 2019-07-01 16:16:02 -0400 | [diff] [blame] | 23 | ${PRELOAD_TOPOLOGY_OPERATION_BODY} sdnc |
DR695H | 87b84d0 | 2019-08-02 17:18:13 -0400 | [diff] [blame] | 24 | ${SDNC_INDEX_PATH} /restconf |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 25 | ${SDNCGC_HEALTHCHECK_OPERATION_PATH} /operations/SLI-API:healthcheck |
DR695H | 87b84d0 | 2019-08-02 17:18:13 -0400 | [diff] [blame] | 26 | ${SDNC_REST_ENDPOINT} ${GLOBAL_SDNC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SDNC_IP_ADDR}:${GLOBAL_SDNC_REST_PORT} |
| 27 | ${SDNC_ADMIN_ENDPOINT} ${GLOBAL_SDNC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SDNC_PORTAL_IP_ADDR}:${GLOBAL_SDNC_ADMIN_PORT} |
| 28 | ${SDNC_ADMIN_SIGNUP_URL} ${SDNC_ADMIN_ENDPOINT}/signup |
| 29 | ${SDNC_ADMIN_LOGIN_URL} ${SDNC_ADMIN_ENDPOINT}/login |
| 30 | ${SDNC_ADMIN_VNF_PROFILE_URL} ${SDNC_ADMIN_ENDPOINT}/mobility/getVnfProfile |
deswali07 | dd30425 | 2020-09-10 15:47:47 +0530 | [diff] [blame] | 31 | ${GRAPI_SIPath} ${SDNC_INDEX_PATH}/config/GENERIC-RESOURCE-API:services/service/${GR_SI} |
| 32 | ${Data_GRAPI} { "service": [ { "service-instance-id": "GRSIdummy123" } ] } |
| 33 | ${GR_SI} GRSIdummy123 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 34 | |
| 35 | *** Keywords *** |
DR695H | 87b84d0 | 2019-08-02 17:18:13 -0400 | [diff] [blame] | 36 | Run SDNC Health Check |
| 37 | [Documentation] Runs an SDNC healthcheck |
| 38 | ${resp}= SDNC.Run Post Request ${SDNC_REST_ENDPOINT} ${SDNC_INDEX PATH}${SDNCGC_HEALTHCHECK_OPERATION_PATH} data=${None} auth=${GLOBAL_SDNC_AUTHENTICATION} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 39 | Should Be Equal As Strings ${resp.status_code} 200 |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 40 | Should Be Equal As Strings ${resp.json()['output']['response-code']} 200 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 41 | |
deswali07 | dd30425 | 2020-09-10 15:47:47 +0530 | [diff] [blame] | 42 | Run SDNC Health Check Generic Resource API |
| 43 | [Documentation] Runs an GENERIC-RESOURCE-API API check for SDNC healthcheck |
| 44 | ${delete_response} Run SDNC Delete Request ${GRAPI_SIPath} |
| 45 | #Put Dummy data |
| 46 | ${Put_resp}= SDNC.Run Put Request ${SDNC_REST_ENDPOINT} ${GRAPI_SIPath} data=${Data_GRAPI} auth=${GLOBAL_SDNC_AUTHENTICATION} |
| 47 | Should Be Equal As Strings ${Put_resp.status_code} 201 |
| 48 | #Get request and validation |
| 49 | ${resp}= SDNC.Run Get Request ${SDNC_REST_ENDPOINT} ${GRAPI_SIPath} auth=${GLOBAL_SDNC_AUTHENTICATION} |
| 50 | Should Be Equal As Strings ${resp.status_code} 200 |
| 51 | ${res_body}= Convert to string ${resp.content} |
| 52 | Should contain ${res_body} ${GR_SI} |
| 53 | #Delete Dummy Data |
| 54 | ${delete_response} Run SDNC Delete Request ${GRAPI_SIPath} |
| 55 | Should Be Equal As Strings ${delete_response.status_code} 200 |
| 56 | |
| 57 | Run SDNC Delete Request |
| 58 | [Documentation] Runs an SDNC Delete Request |
| 59 | [Arguments] ${URL} |
| 60 | Disable Warnings |
| 61 | ${session}= Create Session SDNC ${SDNC_REST_ENDPOINT} auth=${GLOBAL_SDNC_AUTHENTICATION} |
| 62 | ${headers}= Create Dictionary Accept=*/* Accept-Encoding=gzip, deflate, br Connection=keep-alive |
| 63 | ${resp}= Delete Request SDNC ${URL} data=${None} headers=${headers} |
| 64 | [Return] ${resp} |
| 65 | |
DR695H | 8a61013 | 2019-07-01 16:16:02 -0400 | [diff] [blame] | 66 | Preload Vcpe Networks |
| 67 | Preload Network cpe_public 10.2.0.2 10.2.0.1 |
| 68 | Preload Network cpe_signal 10.4.0.2 10.4.0.1 |
| 69 | Preload Network brg_bng 10.3.0.2 10.3.0.1 |
| 70 | Preload Network bng_mux 10.1.0.10 10.1.0.1 |
| 71 | Preload Network mux_gw 10.5.0.10 10.5.0.1 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 72 | |
DR695H | 8a61013 | 2019-07-01 16:16:02 -0400 | [diff] [blame] | 73 | Preload Network |
| 74 | [Arguments] ${network_role} ${subnet_start_ip} ${subnet_gateway} |
| 75 | ${name_suffix}= Generate Timestamp |
| 76 | ${network_name}= Catenate SEPARATOR=_ net ${network_role} ${name_suffix} |
| 77 | ${subnet_name}= Catenate SEPARATOR=_ net ${network_role} subnet ${name_suffix} |
| 78 | ${parameters}= Create Dictionary network_role=${network_role} service_type=vCPE network_type=Generic NeutronNet network_name=${network_name} subnet_start_ip=${subnet_start_ip} subnet_gateway=${subnet_gateway} |
DR695H | a6ce951 | 2019-07-19 14:25:43 -0400 | [diff] [blame] | 79 | Templating.Create Environment sdnc ${GLOBAL_TEMPLATE_FOLDER} |
| 80 | ${data}= Templating.Apply Template sdnc ${PRELOAD_TOPOLOGY_OPERATION_BODY}/template.network.jinja ${parameters} |
DR695H | 87b84d0 | 2019-08-02 17:18:13 -0400 | [diff] [blame] | 81 | ${post_resp}= SDNC.Run Post Request ${SDNC_REST_ENDPOINT} ${SDNC_INDEX_PATH}${PRELOAD_NETWORK_TOPOLOGY_OPERATION_PATH} data=${data} auth=${GLOBAL_SDNC_AUTHENTICATION} |
DR695H | 8a61013 | 2019-07-01 16:16:02 -0400 | [diff] [blame] | 82 | [Return] ${network_name} ${subnet_name} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 83 | |
DR695H | 8a61013 | 2019-07-01 16:16:02 -0400 | [diff] [blame] | 84 | Preload Vcpe vGW |
| 85 | [Arguments] ${brg_mac} ${cpe_network_name} ${cpe_subnet_name} ${mux_gw_net} ${mux_gw_subnet} |
| 86 | ${name_suffix}= Generate Timestamp |
DR695H | 97fec22 | 2019-07-15 13:32:20 -0400 | [diff] [blame] | 87 | ${parameters}= Create Dictionary pub_key=${GLOBAL_INJECTED_PUBLIC_KEY} brg_mac=${brg_mac} cpe_public_net=${cpe_network_name} cpe_public_subnet=${cpe_subnet_name} mux_gw_net=${mux_gw_net} mux_gw_subnet=${mux_gw_subnet} suffix=${name_suffix} oam_onap_net=oam_network_2No2 oam_onap_subnet=oam_network_2No2 public_net_id=${GLOBAL_INJECTED_PUBLIC_NET_ID} |
DR695H | a6ce951 | 2019-07-19 14:25:43 -0400 | [diff] [blame] | 88 | Templating.Create Environment sdnc ${GLOBAL_TEMPLATE_FOLDER} |
| 89 | ${data}= Templating.Apply Template sdnc ${PRELOAD_TOPOLOGY_OPERATION_BODY}/template.vcpe_vgw_vfmodule.jinja ${parameters} |
DR695H | 87b84d0 | 2019-08-02 17:18:13 -0400 | [diff] [blame] | 90 | ${post_resp}= SDNC.Run Post Request ${SDNC_REST_ENDPOINT} ${SDNC_INDEX_PATH}${PRELOAD_VNF_TOPOLOGY_OPERATION_PATH} data=${data} auth=${GLOBAL_SDNC_AUTHENTICATION} |
DR695H | 8a61013 | 2019-07-01 16:16:02 -0400 | [diff] [blame] | 91 | |
| 92 | Preload Vcpe vGW Gra |
| 93 | [Arguments] ${brg_mac} ${cpe_public_network_name} ${cpe_public_subnet_name} ${mux_gw_net} ${mux_gw_subnet} |
| 94 | ${name_suffix}= Generate Timestamp |
DR695H | 97fec22 | 2019-07-15 13:32:20 -0400 | [diff] [blame] | 95 | ${parameters}= Create Dictionary pub_key=${GLOBAL_INJECTED_PUBLIC_KEY} brg_mac=${brg_mac} cpe_public_net=${cpe_public_network_name} cpe_public_subnet=${cpe_public_subnet_name} mux_gw_net=${mux_gw_net} mux_gw_subnet=${mux_gw_subnet} suffix=${name_suffix} oam_onap_net=oam_network_2No2 oam_onap_subnet=oam_network_2No2 public_net_id=${GLOBAL_INJECTED_PUBLIC_NET_ID} |
DR695H | a6ce951 | 2019-07-19 14:25:43 -0400 | [diff] [blame] | 96 | Templating.Create Environment sdnc ${GLOBAL_TEMPLATE_FOLDER} |
| 97 | ${data}= Templating.Apply Template sdnc ${PRELOAD_TOPOLOGY_OPERATION_BODY}/template.vcpe_gwgra_vfmodule.jinja ${parameters} |
Brian Freeman | 059963c | 2019-10-24 09:55:40 -0500 | [diff] [blame] | 98 | ${post_resp}= SDNC.Run Post Request ${SDNC_REST_ENDPOINT} ${SDNC_INDEX_PATH}${PRELOAD_GRA_TOPOLOGY_OPERATION_PATH} data=${data} auth=${GLOBAL_SDNC_AUTHENTICATION} |
DR695H | 8a61013 | 2019-07-01 16:16:02 -0400 | [diff] [blame] | 99 | |
| 100 | Preload Generic VfModule |
| 101 | [Arguments] ${service_instance_id} ${vnf_model} ${model_customization_name} ${short_model_customization_name} ${cpe_public_network_name}=None ${cpe_public_subnet_name}=None ${cpe_signal_network_name}=None ${cpe_signal_subnet_name}=None |
| 102 | ${name_suffix}= Generate Timestamp |
DR695H | 8a61013 | 2019-07-01 16:16:02 -0400 | [diff] [blame] | 103 | ${vfmodule_name}= Catenate SEPARATOR=_ vf ${short_model_customization_name} ${name_suffix} |
| 104 | #TODO this became a mess, need to fix |
DR695H | 97fec22 | 2019-07-15 13:32:20 -0400 | [diff] [blame] | 105 | ${parameters}= Create Dictionary pub_key=${GLOBAL_INJECTED_PUBLIC_KEY} suffix=${name_suffix} mr_ip_addr=${GLOBAL_INJECTED_MR_IP_ADDR} mr_ip_port=${GLOBAL_MR_SERVER_PORT} |
mrichomme | 3256fa2 | 2020-03-09 11:23:35 +0100 | [diff] [blame] | 106 | Set To Dictionary ${parameters} oam_onap_net=oam_network_2No2 oam_onap_subnet=oam_network_2No2 cpe_public_net=${cpe_public_network_name} cpe_public_subnet=${cpe_public_subnet_name} |
DR695H | 8a61013 | 2019-07-01 16:16:02 -0400 | [diff] [blame] | 107 | Set To Dictionary ${parameters} cpe_signal_subnet=${cpe_signal_subnet_name} cpe_signal_net=${cpe_signal_network_name} public_net_id=${GLOBAL_INJECTED_PUBLIC_NET_ID} |
| 108 | # vnf_type and generic_vnf_type are identical |
mrichomme | 3256fa2 | 2020-03-09 11:23:35 +0100 | [diff] [blame] | 109 | Set To Dictionary ${parameters} vnf_type=${model_customization_name} generic_vnf_type=${model_customization_name} generic_vnf_name=${model_customization_name} vnf_name=${vfmodule_name} |
DR695H | 8a61013 | 2019-07-01 16:16:02 -0400 | [diff] [blame] | 110 | Set To Dictionary ${parameters} service_type=${service_instance_id} sdnc_oam_ip=${GLOBAL_INJECTED_SDNC_IP_ADDR} |
DR695H | 87b84d0 | 2019-08-02 17:18:13 -0400 | [diff] [blame] | 111 | ${post_resp}= SDNC.Preload Vfmodule ${SDNC_REST_ENDPOINT} ${SDNC_INDEX_PATH}${PRELOAD_VNF_TOPOLOGY_OPERATION_PATH} ${GLOBAL_TEMPLATE_FOLDER} ${PRELOAD_TOPOLOGY_OPERATION_BODY}/template.vcpe_infra_vfmodule.jinja ${parameters} |
DR695H | 8a61013 | 2019-07-01 16:16:02 -0400 | [diff] [blame] | 112 | [Return] ${post_resp} |
mrichomme | 3256fa2 | 2020-03-09 11:23:35 +0100 | [diff] [blame] | 113 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 114 | Preload Vnf |
DR695H | 581981e | 2019-10-11 16:02:37 -0400 | [diff] [blame] | 115 | [Arguments] ${service_type_uuid} ${generic_vnf_name} ${generic_vnf_type} ${vf_module_name} ${vf_modules} ${vnf} ${uuid} ${service} ${server_id} |
Jerry Flood | 3a169a3 | 2017-12-01 12:39:10 -0500 | [diff] [blame] | 116 | ${base_vf_module_type}= Catenate |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 117 | ${closedloop_vf_module}= Create Dictionary |
DR695H | 102f320 | 2019-05-24 15:05:03 -0400 | [diff] [blame] | 118 | ServiceMapping.Set Directory default ${GLOBAL_SERVICE_MAPPING_DIRECTORY} |
DR695H | 1496bf5 | 2019-07-31 16:28:55 -0400 | [diff] [blame] | 119 | ${templates}= ServiceMapping.Get Service Template Mapping default ${service} ${vnf} |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 120 | :FOR ${vf_module} IN @{vf_modules} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 121 | \ ${vf_module_type}= Get From Dictionary ${vf_module} name |
Brian Freeman | 12ff184 | 2019-02-13 13:54:48 -0500 | [diff] [blame] | 122 | # need to pass in vnf_index if non-zero |
| 123 | \ ${dict} Run Keyword If "${generic_vnf_name}".endswith('0') Get From Mapping With Index ${templates} ${vf_module} 0 |
DR695H | 67afaca | 2019-07-23 17:13:23 -0400 | [diff] [blame] | 124 | ... ELSE IF "${generic_vnf_name}".endswith('1') Get From Mapping With Index ${templates} ${vf_module} 1 |
| 125 | ... ELSE IF "${generic_vnf_name}".endswith('2') Get From Mapping With Index ${templates} ${vf_module} 2 |
| 126 | ... ELSE Get From Mapping ${templates} ${vf_module} |
mrichomme | 3256fa2 | 2020-03-09 11:23:35 +0100 | [diff] [blame] | 127 | # skip this iteration if no template |
Brian Freeman | ea834f7 | 2019-04-22 14:34:02 -0500 | [diff] [blame] | 128 | \ ${test_dict_length} = Get Length ${dict} |
| 129 | \ Continue For Loop If ${test_dict_length} == 0 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 130 | \ ${filename}= Get From Dictionary ${dict} template |
| 131 | \ ${base_vf_module_type}= Set Variable If '${dict['isBase']}' == 'true' ${vf_module_type} ${base_vf_module_type} |
| 132 | \ ${closedloop_vf_module}= Set Variable If '${dict['isBase']}' == 'false' ${vf_module} ${closedloop_vf_module} |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 133 | \ ${vf_name}= Update Module Name ${dict} ${vf_module_name} |
mrichomme | 3256fa2 | 2020-03-09 11:23:35 +0100 | [diff] [blame] | 134 | # Admin portal update no longer |
Brian Freeman | f38a834 | 2019-04-18 10:50:19 -0500 | [diff] [blame] | 135 | #\ Preload Vnf Profile ${vf_module_type} |
DR695H | 581981e | 2019-10-11 16:02:37 -0400 | [diff] [blame] | 136 | \ Preload One Vnf Topology ${service_type_uuid} ${generic_vnf_name} ${generic_vnf_type} ${vf_name} ${vf_module_type} ${service} ${filename} ${uuid} ${server_id} |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 137 | [Return] ${base_vf_module_type} ${closedloop_vf_module} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 138 | |
Brian Freeman | 059963c | 2019-10-24 09:55:40 -0500 | [diff] [blame] | 139 | Preload Gra |
| 140 | [Arguments] ${service_type_uuid} ${generic_vnf_name} ${generic_vnf_type} ${vf_module_name} ${vf_modules} ${vnf} ${uuid} ${service} ${server_id} |
| 141 | ${base_vf_module_type}= Catenate |
| 142 | ${closedloop_vf_module}= Create Dictionary |
| 143 | ServiceMapping.Set Directory default ${GLOBAL_SERVICE_MAPPING_DIRECTORY} |
| 144 | ${templates}= ServiceMapping.Get Service Template Mapping default ${service} ${vnf} |
| 145 | :FOR ${vf_module} IN @{vf_modules} |
| 146 | \ ${vf_module_type}= Get From Dictionary ${vf_module} name |
| 147 | # need to pass in vnf_index if non-zero |
| 148 | \ ${dict} Run Keyword If "${generic_vnf_name}".endswith('0') Get From Mapping With Index ${templates} ${vf_module} 0 |
| 149 | ... ELSE IF "${generic_vnf_name}".endswith('1') Get From Mapping With Index ${templates} ${vf_module} 1 |
| 150 | ... ELSE IF "${generic_vnf_name}".endswith('2') Get From Mapping With Index ${templates} ${vf_module} 2 |
| 151 | ... ELSE Get From Mapping ${templates} ${vf_module} |
| 152 | # skip this iteration if no template |
| 153 | \ ${test_dict_length} = Get Length ${dict} |
| 154 | \ Continue For Loop If ${test_dict_length} == 0 |
| 155 | \ ${filename}= Get From Dictionary ${dict} template |
| 156 | \ ${base_vf_module_type}= Set Variable If '${dict['isBase']}' == 'true' ${vf_module_type} ${base_vf_module_type} |
| 157 | \ ${closedloop_vf_module}= Set Variable If '${dict['isBase']}' == 'false' ${vf_module} ${closedloop_vf_module} |
| 158 | \ ${vf_name}= Update Module Name ${dict} ${vf_module_name} |
| 159 | \ Preload One Gra Topology ${service_type_uuid} ${generic_vnf_name} ${generic_vnf_type} ${vf_name} ${vf_module_type} ${service} ${filename} ${uuid} ${server_id} |
| 160 | [Return] ${base_vf_module_type} ${closedloop_vf_module} |
| 161 | |
| 162 | |
| 163 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 164 | Update Module Name |
| 165 | [Arguments] ${dict} ${vf_module_name} |
| 166 | Return From Keyword If 'prefix' not in ${dict} ${vf_module_name} |
| 167 | Return From Keyword If '${dict['prefix']}' == '' ${vf_module_name} |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 168 | ${name}= Replace String ${vf_module_name} Vfmodule_ ${dict['prefix']} |
| 169 | [Return] ${name} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 170 | |
Brian Freeman | 12ff184 | 2019-02-13 13:54:48 -0500 | [diff] [blame] | 171 | Get From Mapping With Index |
| 172 | [Documentation] Retrieve the appropriate prelad template entry for the passed vf_module |
| 173 | [Arguments] ${templates} ${vf_module} ${vnf_index}=0 |
| 174 | ${vf_module_name}= Get From DIctionary ${vf_module} name |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 175 | :FOR ${template} IN @{templates} |
Brian Freeman | 12ff184 | 2019-02-13 13:54:48 -0500 | [diff] [blame] | 176 | \ Return From Keyword If '${template['name_pattern']}' in '${vf_module_name}' and ('${template['vnf_index']}' == '${vnf_index}') ${template} |
Brian Freeman | 37daa80 | 2019-04-26 12:06:11 -0500 | [diff] [blame] | 177 | ${result}= Create Dictionary |
| 178 | [Return] ${result} |
Brian Freeman | 12ff184 | 2019-02-13 13:54:48 -0500 | [diff] [blame] | 179 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 180 | Get From Mapping |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 181 | [Documentation] Retrieve the appropriate prelad template entry for the passed vf_module |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 182 | [Arguments] ${templates} ${vf_module} |
| 183 | ${vf_module_name}= Get From DIctionary ${vf_module} name |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 184 | :FOR ${template} IN @{templates} |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 185 | \ Return From Keyword If '${template['name_pattern']}' in '${vf_module_name}' ${template} |
Brian Freeman | 37daa80 | 2019-04-26 12:06:11 -0500 | [diff] [blame] | 186 | ${result}= Create Dictionary |
| 187 | [Return] ${result} |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 188 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 189 | Preload One Vnf Topology |
DR695H | 581981e | 2019-10-11 16:02:37 -0400 | [diff] [blame] | 190 | [Arguments] ${service_type_uuid} ${generic_vnf_name} ${generic_vnf_type} ${vf_module_name} ${vf_module_type} ${service} ${filename} ${uuid} ${server_id} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 191 | Return From Keyword If '${filename}' == '' |
DR695H | 581981e | 2019-10-11 16:02:37 -0400 | [diff] [blame] | 192 | ${parameters}= Get Template Parameters ${generic_vnf_name} ${filename} ${uuid} ${service} ${server_id} |
Jerry Flood | 81d33fb | 2017-11-21 16:21:21 -0500 | [diff] [blame] | 193 | Set To Dictionary ${parameters} generic_vnf_name=${generic_vnf_name} generic_vnf_type=${generic_vnf_type} service_type=${service_type_uuid} vf_module_name=${vf_module_name} vf_module_type=${vf_module_type} |
DR695H | a6ce951 | 2019-07-19 14:25:43 -0400 | [diff] [blame] | 194 | Templating.Create Environment sdnc ${GLOBAL_TEMPLATE_FOLDER} |
| 195 | ${data}= Templating.Apply Template sdnc ${PRELOAD_TOPOLOGY_OPERATION_BODY}/preload.jinja ${parameters} |
DR695H | 87b84d0 | 2019-08-02 17:18:13 -0400 | [diff] [blame] | 196 | ${post_resp}= SDNC.Run Post Request ${SDNC_REST_ENDPOINT} ${SDNC_INDEX_PATH}${PRELOAD_VNF_TOPOLOGY_OPERATION_PATH} data=${data} auth=${GLOBAL_SDNC_AUTHENTICATION} |
DR695H | 3148028 | 2019-07-12 18:34:15 -0400 | [diff] [blame] | 197 | Should Be Equal As Strings ${post_resp.json()['output']['response-code']} 200 |
DR695H | 87b84d0 | 2019-08-02 17:18:13 -0400 | [diff] [blame] | 198 | ${get_resp}= SDNC.Run Get Request ${SDNC_REST_ENDPOINT} ${SDNC_INDEX_PATH}${PRELOAD_VNF_CONFIG_PATH}/${vf_module_name}/${vf_module_type} auth=${GLOBAL_SDNC_AUTHENTICATION} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 199 | |
Brian Freeman | 059963c | 2019-10-24 09:55:40 -0500 | [diff] [blame] | 200 | |
| 201 | Preload One Gra Topology |
| 202 | [Arguments] ${service_type_uuid} ${generic_vnf_name} ${generic_vnf_type} ${vf_module_name} ${vf_module_type} ${service} ${filename} ${uuid} ${server_id} |
| 203 | Return From Keyword If '${filename}' == '' |
| 204 | ${parameters}= Get Template Parameters ${generic_vnf_name} ${filename} ${uuid} ${service} ${server_id} gr_api |
| 205 | Set To Dictionary ${parameters} generic_vnf_name=${generic_vnf_name} generic_vnf_type=${generic_vnf_type} service_type=${service_type_uuid} vf_module_name=${vf_module_name} vf_module_type=${vf_module_type} |
| 206 | Templating.Create Environment sdnc ${GLOBAL_TEMPLATE_FOLDER} |
| 207 | ${data}= Templating.Apply Template sdnc ${PRELOAD_TOPOLOGY_OPERATION_BODY}/preload.GRA.jinja ${parameters} |
| 208 | ${post_resp}= SDNC.Run Post Request ${SDNC_REST_ENDPOINT} ${SDNC_INDEX_PATH}${PRELOAD_GRA_TOPOLOGY_OPERATION_PATH} data=${data} auth=${GLOBAL_SDNC_AUTHENTICATION} |
| 209 | Should Be Equal As Strings ${post_resp.json()['output']['response-code']} 200 |
| 210 | ${get_resp}= SDNC.Run Get Request ${SDNC_REST_ENDPOINT} ${SDNC_INDEX_PATH}${PRELOAD_GRA_CONFIG_PATH}/preload-list/${vf_module_name}/vf-module auth=${GLOBAL_SDNC_AUTHENTICATION} |
| 211 | Should Be Equal As Strings ${get_resp.status_code} 200 |
| 212 | |
| 213 | |
| 214 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 215 | Get Template Parameters |
Brian Freeman | 059963c | 2019-10-24 09:55:40 -0500 | [diff] [blame] | 216 | [Arguments] ${generic_vnf_name} ${template} ${uuid} ${service} ${server_id} ${api_type}=vnf_api |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 217 | ${hostid}= Get Substring ${uuid} -4 |
Brian Freeman | 5918652 | 2020-04-15 13:02:07 -0500 | [diff] [blame] | 218 | # in Azure the ONAP OAM network is a /24 on 10.0.200 so 10.0 CIDR is too short |
| 219 | # ecompnet should be 200 if AKS |
| 220 | # Check GLOBAL VARIABLE for Openstack OAM Network 3RD_OCTET and if specified use it instead of |
| 221 | # dyanmic ecompnet (Decompnet) |
| 222 | ${Decompnet}= Evaluate (${GLOBAL_BUILD_NUMBER}%128)+128 |
| 223 | ${ecompnet}= Set Variable If "${GLOBAL_INJECTED_OPENSTACK_OAM_NETWORK_3RD_OCTET}"=="${EMPTY}" ${Decompnet} ${GLOBAL_INJECTED_OPENSTACK_OAM_NETWORK_3RD_OCTET} |
DR695H | 2d8bd80 | 2019-08-02 10:56:54 -0400 | [diff] [blame] | 224 | ${valuemap}= Get Globally Injected Parameters |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 225 | # update the value map with unique values. |
DR695H | 581981e | 2019-10-11 16:02:37 -0400 | [diff] [blame] | 226 | Set To Dictionary ${valuemap} uuid=${uuid} hostid=${hostid} ecompnet=${ecompnet} generic_vnf_name=${generic_vnf_name} server_id=${server_id} |
Jerry Flood | 81d33fb | 2017-11-21 16:21:21 -0500 | [diff] [blame] | 227 | |
| 228 | # |
| 229 | # Mash together the defaults dict with the test case dict to create the set of |
| 230 | # preload parameters |
| 231 | # |
DR695H | cccad65 | 2019-09-16 13:21:47 -0400 | [diff] [blame] | 232 | PreloadData.Set Directory preload ./demo/preload_data |
| 233 | ${defaults}= PreloadData.Get Default Preload Data preload |
| 234 | ${template}= PreloadData.Get Preload Data preload ${service} ${template} |
Jerry Flood | 81d33fb | 2017-11-21 16:21:21 -0500 | [diff] [blame] | 235 | # add all of the defaults to template... |
| 236 | @{keys}= Get Dictionary Keys ${defaults} |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 237 | :FOR ${key} IN @{keys} |
Jerry Flood | 81d33fb | 2017-11-21 16:21:21 -0500 | [diff] [blame] | 238 | \ ${value}= Get From Dictionary ${defaults} ${key} |
| 239 | \ Set To Dictionary ${template} ${key} ${value} |
| 240 | |
| 241 | # |
| 242 | # Get the vnf_parameters to preload |
| 243 | # |
Brian Freeman | 059963c | 2019-10-24 09:55:40 -0500 | [diff] [blame] | 244 | ${vnf_parameters}= Run Keyword If '${api_type}'=='gr_api' Resolve GRA Parameters Into Array ${valuemap} ${template} |
| 245 | ... ELSE Resolve VNF Parameters Into Array ${valuemap} ${template} |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 246 | ${vnf_parameters_json}= Evaluate json.dumps(${vnf_parameters}) json |
Jerry Flood | 81d33fb | 2017-11-21 16:21:21 -0500 | [diff] [blame] | 247 | ${parameters}= Create Dictionary vnf_parameters=${vnf_parameters_json} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 248 | [Return] ${parameters} |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 249 | |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 250 | Resolve VNF Parameters Into Array |
Jerry Flood | 81d33fb | 2017-11-21 16:21:21 -0500 | [diff] [blame] | 251 | [Arguments] ${valuemap} ${from} |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 252 | ${vnf_parameters}= Create List |
| 253 | ${keys}= Get Dictionary Keys ${from} |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 254 | :FOR ${key} IN @{keys} |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 255 | \ ${value}= Get From Dictionary ${from} ${key} |
DR695H | a6ce951 | 2019-07-19 14:25:43 -0400 | [diff] [blame] | 256 | \ ${value}= Templating.Template String ${value} ${valuemap} |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 257 | \ ${parameter}= Create Dictionary vnf-parameter-name=${key} vnf-parameter-value=${value} |
| 258 | \ Append To List ${vnf_parameters} ${parameter} |
| 259 | [Return] ${vnf_parameters} |
| 260 | |
Brian Freeman | 059963c | 2019-10-24 09:55:40 -0500 | [diff] [blame] | 261 | Resolve GRA Parameters Into Array |
| 262 | [Arguments] ${valuemap} ${from} |
| 263 | ${vnf_parameters}= Create List |
| 264 | ${keys}= Get Dictionary Keys ${from} |
| 265 | :FOR ${key} IN @{keys} |
| 266 | \ ${value}= Get From Dictionary ${from} ${key} |
| 267 | \ ${value}= Templating.Template String ${value} ${valuemap} |
| 268 | \ ${parameter}= Create Dictionary name=${key} value=${value} |
| 269 | \ Append To List ${vnf_parameters} ${parameter} |
| 270 | [Return] ${vnf_parameters} |
| 271 | |
| 272 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 273 | Preload Vnf Profile |
| 274 | [Arguments] ${vnf_name} |
DR695H | 87b84d0 | 2019-08-02 17:18:13 -0400 | [diff] [blame] | 275 | Login To SDNC Admin GUI |
| 276 | Go To ${SDNC_ADMIN_VNF_PROFILE_URL} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 277 | Click Button xpath=//button[@data-target='#add_vnf_profile'] |
| 278 | Input Text xpath=//input[@id='nf_vnf_type'] ${vnf_name} |
| 279 | Input Text xpath=//input[@id='nf_availability_zone_count'] 999 |
| 280 | Input Text xpath=//input[@id='nf_equipment_role'] robot-ete-test |
| 281 | Click Button xpath=//button[contains(.,'Submit')] |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 282 | Page Should Contain VNF Profile |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 283 | Input Text xpath=//div[@id='vnf_profile_filter']//input ${vnf_name} |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 284 | Page Should Contain ${vnf_name} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 285 | |
| 286 | Delete Vnf Profile |
| 287 | [Arguments] ${vnf_name} |
DR695H | 87b84d0 | 2019-08-02 17:18:13 -0400 | [diff] [blame] | 288 | Login To SDNC Admin GUI |
| 289 | Go To ${SDNC_ADMIN_VNF_PROFILE_URL} |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 290 | Page Should Contain VNF Profile |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 291 | Input Text xpath=//div[@id='vnf_profile_filter']//input ${vnf_name} |
| 292 | Page Should Contain ${vnf_name} |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 293 | Click Button xpath=//button[contains(@onclick, '${vnf_name}')] |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 294 | Page Should Contain Are you sure you want to delete VNF_PROFILE |
| 295 | Click Button xpath=//button[contains(text(), 'Yes')] |
| 296 | Page Should Not Contain ${vnf_name} |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 297 | |
DR695H | 87b84d0 | 2019-08-02 17:18:13 -0400 | [diff] [blame] | 298 | Login To SDNC Admin GUI |
| 299 | [Documentation] Login To SDNC Admin GUI |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 300 | ## Setup Browser is now being managed by the test case |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 301 | ## Setup Browser |
DR695H | 87b84d0 | 2019-08-02 17:18:13 -0400 | [diff] [blame] | 302 | Go To ${SDNC_ADMIN_SIGNUP_URL} |
Jerry Flood | 81d33fb | 2017-11-21 16:21:21 -0500 | [diff] [blame] | 303 | ##Maximize Browser Window |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 304 | Set Selenium Speed ${GLOBAL_SELENIUM_DELAY} |
| 305 | Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT} |
DR695H | 87b84d0 | 2019-08-02 17:18:13 -0400 | [diff] [blame] | 306 | Log Logging in to ${SDNC_ADMIN_LOGIN_URL} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 307 | Handle Proxy Warning |
| 308 | Title Should Be AdminPortal |
DR695H | 18872bc | 2019-06-13 16:16:52 -0400 | [diff] [blame] | 309 | ${uuid}= Generate UUID4 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 310 | ${shortened_uuid}= Evaluate str("${uuid}")[:12] |
| 311 | ${email}= Catenate ${shortened_uuid}@robotete.com |
| 312 | Input Text xpath=//input[@id='nf_email'] ${email} |
| 313 | Input Password xpath=//input[@id='nf_password'] ${shortened_uuid} |
| 314 | Click Button xpath=//button[@type='submit'] |
| 315 | Wait Until Page Contains User created 20s |
DR695H | 87b84d0 | 2019-08-02 17:18:13 -0400 | [diff] [blame] | 316 | Go To ${SDNC_ADMIN_LOGIN_URL} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 317 | Input Text xpath=//input[@id='email'] ${email} |
| 318 | Input Password xpath=//input[@id='password'] ${shortened_uuid} |
| 319 | Click Button xpath=//button[@type='submit'] |
| 320 | Title Should Be SDN-C AdminPortal |
DR695H | 87b84d0 | 2019-08-02 17:18:13 -0400 | [diff] [blame] | 321 | Log Logged in to ${SDNC_ADMIN_LOGIN_URL} |
stark, steven | ea4af0c | 2019-08-28 16:11:53 -0700 | [diff] [blame] | 322 | |
| 323 | Create Preload From JSON |
| 324 | [Documentation] Fill vf-module parameters in an already created preload json file. |
| 325 | [Arguments] ${preload_file} ${api_type} ${vf_module_name} ${vf_module_type} ${vnf_name} ${generic_vnf_type} |
| 326 | Log To Console Uploading ${preload_file} to SDNC |
| 327 | |
Brian Freeman | 059963c | 2019-10-24 09:55:40 -0500 | [diff] [blame] | 328 | ${preload_vnf}= Run keyword if "${api_type}"=="gr_api" Preload GR API ${vf_module_name} ${vf_module_type} ${vnf_name} ${generic_vnf_type} ${preload_file} |
| 329 | ... ELSE Preload VNF API ${vf_module_name} ${vf_module_type} ${vnf_name} ${generic_vnf_type} ${preload_file} |
stark, steven | ea4af0c | 2019-08-28 16:11:53 -0700 | [diff] [blame] | 330 | |
Brian Freeman | 059963c | 2019-10-24 09:55:40 -0500 | [diff] [blame] | 331 | ${uri}= Set Variable If "${api_type}"=="gr_api" ${SDNC_INDEX_PATH}${PRELOAD_GRA_TOPOLOGY_OPERATION_PATH} ${SDNC_INDEX_PATH}${PRELOAD_VNF_TOPOLOGY_OPERATION_PATH} |
stark, steven | ea4af0c | 2019-08-28 16:11:53 -0700 | [diff] [blame] | 332 | |
| 333 | ${post_resp}= SDNC.Run Post Request ${SDNC_REST_ENDPOINT} ${uri} data=${preload_vnf} auth=${GLOBAL_SDNC_AUTHENTICATION} |
| 334 | Should Be Equal As Strings ${post_resp.json()['output']['response-code']} 200 |
| 335 | [Return] ${post_resp} |
| 336 | |
| 337 | Preload GR API |
| 338 | [Documentation] Retrieves a preload JSON file and fills in service instance values. |
| 339 | [Arguments] ${vnf_name} ${vnf_type} ${generic_vnf_name} ${generic_vnf_type} ${preload_path} |
| 340 | |
| 341 | ${json}= OperatingSystem.Get File ${preload_path} |
| 342 | ${object}= Evaluate json.loads('''${json}''') json |
| 343 | ${req_dict} Create Dictionary vnf-name=${generic_vnf_name} vnf-type=${generic_vnf_type} |
| 344 | set to dictionary ${object["input"]["preload-vf-module-topology-information"]} vnf-topology-identifier-structure=${req_dict} |
| 345 | ${req_dict_new} Create Dictionary vf-module-name=${vnf_name} |
| 346 | set to dictionary ${object["input"]["preload-vf-module-topology-information"]["vf-module-topology"]} vf-module-topology-identifier=${req_dict_new} |
| 347 | ${req_json} Evaluate json.dumps(${object}) json |
| 348 | [Return] ${req_json} |
| 349 | |
| 350 | Preload VNF API |
| 351 | [Documentation] Retrieves a preload JSON file and fills in service instance values. |
| 352 | [Arguments] ${vnf_name} ${vnf_type} ${generic_vnf_name} ${generic_vnf_type} ${preload_path} |
| 353 | |
| 354 | ${json}= OperatingSystem.Get File ${preload_path} |
| 355 | ${object}= Evaluate json.loads('''${json}''') json |
| 356 | ${req_dict} Create Dictionary vnf-name=${vnf_name} vnf-type=${vnf_type} generic-vnf-type=${generic_vnf_type} generic-vnf-name=${generic_vnf_name} |
| 357 | set to dictionary ${object["input"]["vnf-topology-information"]} vnf-topology-identifier=${req_dict} |
| 358 | |
| 359 | ${req_json} Evaluate json.dumps(${object}) json |
| 360 | [Return] ${req_json} |