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 |
| 10 | Library ONAPLibrary.PreloadData WITH NAME Preload |
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 |
| 20 | ${PRELOAD_GR_TOPOLOGY_OPERATION_PATH} /operations/GENERIC-RESOURCE-API:preload-vf-module-topology-operation |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 21 | ${PRELOAD_VNF_CONFIG_PATH} /config/VNF-API:preload-vnfs/vnf-preload-list |
DR695H | 8a61013 | 2019-07-01 16:16:02 -0400 | [diff] [blame] | 22 | ${PRELOAD_TOPOLOGY_OPERATION_BODY} sdnc |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 23 | ${SDNGC_INDEX_PATH} /restconf |
| 24 | ${SDNCGC_HEALTHCHECK_OPERATION_PATH} /operations/SLI-API:healthcheck |
DR695H | bf5a3a3 | 2017-06-30 13:09:57 -0400 | [diff] [blame] | 25 | ${SDNGC_REST_ENDPOINT} ${GLOBAL_SDNGC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SDNC_IP_ADDR}:${GLOBAL_SDNGC_REST_PORT} |
Gary Wu | 251aa68 | 2018-07-30 15:22:20 -0700 | [diff] [blame] | 26 | ${SDNGC_ADMIN_ENDPOINT} ${GLOBAL_SDNGC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_SDNC_PORTAL_IP_ADDR}:${GLOBAL_SDNGC_ADMIN_PORT} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 27 | ${SDNGC_ADMIN_SIGNUP_URL} ${SDNGC_ADMIN_ENDPOINT}/signup |
| 28 | ${SDNGC_ADMIN_LOGIN_URL} ${SDNGC_ADMIN_ENDPOINT}/login |
| 29 | ${SDNGC_ADMIN_VNF_PROFILE_URL} ${SDNGC_ADMIN_ENDPOINT}/mobility/getVnfProfile |
| 30 | |
| 31 | *** Keywords *** |
| 32 | Run SDNGC Health Check |
| 33 | [Documentation] Runs an SDNGC healthcheck |
DR695H | 3148028 | 2019-07-12 18:34:15 -0400 | [diff] [blame] | 34 | ${auth}= Create List ${GLOBAL_SDNGC_USERNAME} ${GLOBAL_SDNGC_PASSWORD} |
DR695H | f0ff3b8 | 2019-07-19 11:08:13 -0400 | [diff] [blame] | 35 | ${resp}= SDNC.Run Post Request ${SDNGC_REST_ENDPOINT} ${SDNGC_INDEX PATH}${SDNCGC_HEALTHCHECK_OPERATION_PATH} data=${None} auth=${auth} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 36 | Should Be Equal As Strings ${resp.status_code} 200 |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 37 | Should Be Equal As Strings ${resp.json()['output']['response-code']} 200 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 38 | |
DR695H | 8a61013 | 2019-07-01 16:16:02 -0400 | [diff] [blame] | 39 | Preload Vcpe Networks |
| 40 | Preload Network cpe_public 10.2.0.2 10.2.0.1 |
| 41 | Preload Network cpe_signal 10.4.0.2 10.4.0.1 |
| 42 | Preload Network brg_bng 10.3.0.2 10.3.0.1 |
| 43 | Preload Network bng_mux 10.1.0.10 10.1.0.1 |
| 44 | Preload Network mux_gw 10.5.0.10 10.5.0.1 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 45 | |
DR695H | 8a61013 | 2019-07-01 16:16:02 -0400 | [diff] [blame] | 46 | Preload Network |
| 47 | [Arguments] ${network_role} ${subnet_start_ip} ${subnet_gateway} |
| 48 | ${name_suffix}= Generate Timestamp |
| 49 | ${network_name}= Catenate SEPARATOR=_ net ${network_role} ${name_suffix} |
| 50 | ${subnet_name}= Catenate SEPARATOR=_ net ${network_role} subnet ${name_suffix} |
| 51 | ${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] | 52 | Templating.Create Environment sdnc ${GLOBAL_TEMPLATE_FOLDER} |
| 53 | ${data}= Templating.Apply Template sdnc ${PRELOAD_TOPOLOGY_OPERATION_BODY}/template.network.jinja ${parameters} |
DR695H | 3148028 | 2019-07-12 18:34:15 -0400 | [diff] [blame] | 54 | ${auth}= Create List ${GLOBAL_SDNGC_USERNAME} ${GLOBAL_SDNGC_PASSWORD} |
DR695H | f0ff3b8 | 2019-07-19 11:08:13 -0400 | [diff] [blame] | 55 | ${post_resp}= SDNC.Run Post Request ${SDNGC_REST_ENDPOINT} ${SDNGC_INDEX_PATH}${PRELOAD_NETWORK_TOPOLOGY_OPERATION_PATH} data=${data} auth=${auth} |
DR695H | 8a61013 | 2019-07-01 16:16:02 -0400 | [diff] [blame] | 56 | [Return] ${network_name} ${subnet_name} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 57 | |
DR695H | 8a61013 | 2019-07-01 16:16:02 -0400 | [diff] [blame] | 58 | Preload Vcpe vGW |
| 59 | [Arguments] ${brg_mac} ${cpe_network_name} ${cpe_subnet_name} ${mux_gw_net} ${mux_gw_subnet} |
| 60 | ${name_suffix}= Generate Timestamp |
DR695H | 97fec22 | 2019-07-15 13:32:20 -0400 | [diff] [blame] | 61 | ${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] | 62 | Templating.Create Environment sdnc ${GLOBAL_TEMPLATE_FOLDER} |
| 63 | ${data}= Templating.Apply Template sdnc ${PRELOAD_TOPOLOGY_OPERATION_BODY}/template.vcpe_vgw_vfmodule.jinja ${parameters} |
DR695H | 3148028 | 2019-07-12 18:34:15 -0400 | [diff] [blame] | 64 | ${auth}= Create List ${GLOBAL_SDNGC_USERNAME} ${GLOBAL_SDNGC_PASSWORD} |
DR695H | f0ff3b8 | 2019-07-19 11:08:13 -0400 | [diff] [blame] | 65 | ${post_resp}= SDNC.Run Post Request ${SDNGC_REST_ENDPOINT} ${SDNGC_INDEX_PATH}${PRELOAD_VNF_TOPOLOGY_OPERATION_PATH} data=${data} auth=${auth} |
DR695H | 8a61013 | 2019-07-01 16:16:02 -0400 | [diff] [blame] | 66 | |
| 67 | Preload Vcpe vGW Gra |
| 68 | [Arguments] ${brg_mac} ${cpe_public_network_name} ${cpe_public_subnet_name} ${mux_gw_net} ${mux_gw_subnet} |
| 69 | ${name_suffix}= Generate Timestamp |
DR695H | 97fec22 | 2019-07-15 13:32:20 -0400 | [diff] [blame] | 70 | ${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] | 71 | Templating.Create Environment sdnc ${GLOBAL_TEMPLATE_FOLDER} |
| 72 | ${data}= Templating.Apply Template sdnc ${PRELOAD_TOPOLOGY_OPERATION_BODY}/template.vcpe_gwgra_vfmodule.jinja ${parameters} |
DR695H | 3148028 | 2019-07-12 18:34:15 -0400 | [diff] [blame] | 73 | ${auth}= Create List ${GLOBAL_SDNGC_USERNAME} ${GLOBAL_SDNGC_PASSWORD} |
DR695H | f0ff3b8 | 2019-07-19 11:08:13 -0400 | [diff] [blame] | 74 | ${post_resp}= SDNC.Run Post Request ${SDNGC_REST_ENDPOINT} ${SDNGC_INDEX_PATH}${PRELOAD_GR_TOPOLOGY_OPERATION_PATH} data=${data} auth=${auth} |
DR695H | 8a61013 | 2019-07-01 16:16:02 -0400 | [diff] [blame] | 75 | |
| 76 | Preload Generic VfModule |
| 77 | [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 |
| 78 | ${name_suffix}= Generate Timestamp |
DR695H | 8a61013 | 2019-07-01 16:16:02 -0400 | [diff] [blame] | 79 | ${vfmodule_name}= Catenate SEPARATOR=_ vf ${short_model_customization_name} ${name_suffix} |
| 80 | #TODO this became a mess, need to fix |
DR695H | 97fec22 | 2019-07-15 13:32:20 -0400 | [diff] [blame] | 81 | ${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} |
DR695H | 8a61013 | 2019-07-01 16:16:02 -0400 | [diff] [blame] | 82 | 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} |
| 83 | 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} |
| 84 | # vnf_type and generic_vnf_type are identical |
| 85 | 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} |
| 86 | Set To Dictionary ${parameters} service_type=${service_instance_id} sdnc_oam_ip=${GLOBAL_INJECTED_SDNC_IP_ADDR} |
DR695H | f0ff3b8 | 2019-07-19 11:08:13 -0400 | [diff] [blame] | 87 | ${post_resp}= SDNC.Preload Vfmodule ${SDNGC_REST_ENDPOINT} ${SDNGC_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] | 88 | [Return] ${post_resp} |
| 89 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 90 | Preload Vnf |
| 91 | [Arguments] ${service_type_uuid} ${generic_vnf_name} ${generic_vnf_type} ${vf_module_name} ${vf_modules} ${service} ${uuid} |
Jerry Flood | 3a169a3 | 2017-12-01 12:39:10 -0500 | [diff] [blame] | 92 | ${base_vf_module_type}= Catenate |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 93 | ${closedloop_vf_module}= Create Dictionary |
DR695H | 102f320 | 2019-05-24 15:05:03 -0400 | [diff] [blame] | 94 | ServiceMapping.Set Directory default ${GLOBAL_SERVICE_MAPPING_DIRECTORY} |
DR695H | a6ce951 | 2019-07-19 14:25:43 -0400 | [diff] [blame] | 95 | ${templates}= ServiceMapping.Get Service Template Mapping default ${service} ${generic_vnf_type} |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 96 | :FOR ${vf_module} IN @{vf_modules} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 97 | \ ${vf_module_type}= Get From Dictionary ${vf_module} name |
Brian Freeman | 12ff184 | 2019-02-13 13:54:48 -0500 | [diff] [blame] | 98 | # need to pass in vnf_index if non-zero |
| 99 | \ ${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^] | 100 | ... ELSE IF "${generic_vnf_name}".endswith('1') Get From Mapping With Index ${templates} ${vf_module} 1 |
| 101 | ... ELSE IF "${generic_vnf_name}".endswith('2') Get From Mapping With Index ${templates} ${vf_module} 2 |
| 102 | ... ELSE Get From Mapping ${templates} ${vf_module} |
Brian Freeman | ea834f7 | 2019-04-22 14:34:02 -0500 | [diff] [blame] | 103 | # skip this iteration if no template |
| 104 | \ ${test_dict_length} = Get Length ${dict} |
| 105 | \ Continue For Loop If ${test_dict_length} == 0 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 106 | \ ${filename}= Get From Dictionary ${dict} template |
| 107 | \ ${base_vf_module_type}= Set Variable If '${dict['isBase']}' == 'true' ${vf_module_type} ${base_vf_module_type} |
| 108 | \ ${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] | 109 | \ ${vf_name}= Update Module Name ${dict} ${vf_module_name} |
Brian Freeman | f38a834 | 2019-04-18 10:50:19 -0500 | [diff] [blame] | 110 | # Admin portal update no longer |
| 111 | #\ Preload Vnf Profile ${vf_module_type} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 112 | \ Preload One Vnf Topology ${service_type_uuid} ${generic_vnf_name} ${generic_vnf_type} ${vf_name} ${vf_module_type} ${service} ${filename} ${uuid} |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 113 | [Return] ${base_vf_module_type} ${closedloop_vf_module} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 114 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 115 | Update Module Name |
| 116 | [Arguments] ${dict} ${vf_module_name} |
| 117 | Return From Keyword If 'prefix' not in ${dict} ${vf_module_name} |
| 118 | Return From Keyword If '${dict['prefix']}' == '' ${vf_module_name} |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 119 | ${name}= Replace String ${vf_module_name} Vfmodule_ ${dict['prefix']} |
| 120 | [Return] ${name} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 121 | |
Brian Freeman | 12ff184 | 2019-02-13 13:54:48 -0500 | [diff] [blame] | 122 | Get From Mapping With Index |
| 123 | [Documentation] Retrieve the appropriate prelad template entry for the passed vf_module |
| 124 | [Arguments] ${templates} ${vf_module} ${vnf_index}=0 |
| 125 | ${vf_module_name}= Get From DIctionary ${vf_module} name |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 126 | :FOR ${template} IN @{templates} |
Brian Freeman | 12ff184 | 2019-02-13 13:54:48 -0500 | [diff] [blame] | 127 | \ 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] | 128 | ${result}= Create Dictionary |
| 129 | [Return] ${result} |
Brian Freeman | 12ff184 | 2019-02-13 13:54:48 -0500 | [diff] [blame] | 130 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 131 | Get From Mapping |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 132 | [Documentation] Retrieve the appropriate prelad template entry for the passed vf_module |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 133 | [Arguments] ${templates} ${vf_module} |
| 134 | ${vf_module_name}= Get From DIctionary ${vf_module} name |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 135 | :FOR ${template} IN @{templates} |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 136 | \ Return From Keyword If '${template['name_pattern']}' in '${vf_module_name}' ${template} |
Brian Freeman | 37daa80 | 2019-04-26 12:06:11 -0500 | [diff] [blame] | 137 | ${result}= Create Dictionary |
| 138 | [Return] ${result} |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 139 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 140 | Preload One Vnf Topology |
| 141 | [Arguments] ${service_type_uuid} ${generic_vnf_name} ${generic_vnf_type} ${vf_module_name} ${vf_module_type} ${service} ${filename} ${uuid} |
| 142 | Return From Keyword If '${filename}' == '' |
DR695H | f6948fa | 2019-07-11 18:03:00 -0400 | [diff] [blame] | 143 | ${parameters}= Get Template Parameters ${generic_vnf_name} ${filename} ${uuid} ${service} |
Jerry Flood | 81d33fb | 2017-11-21 16:21:21 -0500 | [diff] [blame] | 144 | 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] | 145 | Templating.Create Environment sdnc ${GLOBAL_TEMPLATE_FOLDER} |
| 146 | ${data}= Templating.Apply Template sdnc ${PRELOAD_TOPOLOGY_OPERATION_BODY}/preload.jinja ${parameters} |
DR695H | 3148028 | 2019-07-12 18:34:15 -0400 | [diff] [blame] | 147 | ${auth}= Create List ${GLOBAL_SDNGC_USERNAME} ${GLOBAL_SDNGC_PASSWORD} |
DR695H | f0ff3b8 | 2019-07-19 11:08:13 -0400 | [diff] [blame] | 148 | ${post_resp}= SDNC.Run Post Request ${SDNGC_REST_ENDPOINT} ${SDNGC_INDEX_PATH}${PRELOAD_VNF_TOPOLOGY_OPERATION_PATH} data=${data} auth=${auth} |
DR695H | 3148028 | 2019-07-12 18:34:15 -0400 | [diff] [blame] | 149 | Should Be Equal As Strings ${post_resp.json()['output']['response-code']} 200 |
| 150 | ${auth}= Create List ${GLOBAL_SDNGC_USERNAME} ${GLOBAL_SDNGC_PASSWORD} |
DR695H | f0ff3b8 | 2019-07-19 11:08:13 -0400 | [diff] [blame] | 151 | ${get_resp}= SDNC.Run Get Request ${SDNGC_REST_ENDPOINT} ${SDNGC_INDEX_PATH}${PRELOAD_VNF_CONFIG_PATH}/${vf_module_name}/${vf_module_type} auth=${auth} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 152 | |
| 153 | Get Template Parameters |
DR695H | f6948fa | 2019-07-11 18:03:00 -0400 | [diff] [blame] | 154 | [Arguments] ${generic_vnf_name} ${template} ${uuid} ${service} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 155 | ${uuid}= Catenate ${uuid} |
| 156 | ${hostid}= Get Substring ${uuid} -4 |
Jerry Flood | 81d33fb | 2017-11-21 16:21:21 -0500 | [diff] [blame] | 157 | ${ecompnet}= Evaluate (${GLOBAL_BUILD_NUMBER}%128)+128 |
| 158 | |
| 159 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 160 | # Initialize the value map with the properties generated from the Robot VM /opt/config folder |
Jerry Flood | 81d33fb | 2017-11-21 16:21:21 -0500 | [diff] [blame] | 161 | ${valuemap}= Copy Dictionary ${GLOBAL_INJECTED_PROPERTIES} |
| 162 | |
| 163 | # These should be deprecated by the above.... |
Jerry Flood | 028e185 | 2017-03-16 16:44:17 -0400 | [diff] [blame] | 164 | Set To Dictionary ${valuemap} artifacts_version=${GLOBAL_INJECTED_ARTIFACTS_VERSION} |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 165 | Set To Dictionary ${valuemap} network=${GLOBAL_INJECTED_NETWORK} |
Jerry Flood | d750315 | 2017-10-09 16:33:00 -0400 | [diff] [blame] | 166 | Set To Dictionary ${valuemap} public_net_id=${GLOBAL_INJECTED_PUBLIC_NET_ID} |
| 167 | Set To Dictionary ${valuemap} cloud_env=${GLOBAL_INJECTED_CLOUD_ENV} |
Jerry Flood | 81d33fb | 2017-11-21 16:21:21 -0500 | [diff] [blame] | 168 | Set To Dictionary ${valuemap} install_script_version=${GLOBAL_INJECTED_SCRIPT_VERSION} |
Jerry Flood | d750315 | 2017-10-09 16:33:00 -0400 | [diff] [blame] | 169 | Set To Dictionary ${valuemap} vm_image_name=${GLOBAL_INJECTED_VM_IMAGE_NAME} |
Jerry Flood | 81d33fb | 2017-11-21 16:21:21 -0500 | [diff] [blame] | 170 | Set To Dictionary ${valuemap} vm_flavor_name=${GLOBAL_INJECTED_VM_FLAVOR} |
| 171 | |
| 172 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 173 | # update the value map with unique values. |
Bin Yang | 326219a | 2018-05-31 05:35:33 +0000 | [diff] [blame] | 174 | Set To Dictionary ${valuemap} uuid=${uuid} hostid=${hostid} ecompnet=${ecompnet} generic_vnf_name=${generic_vnf_name} |
Jerry Flood | 81d33fb | 2017-11-21 16:21:21 -0500 | [diff] [blame] | 175 | |
| 176 | # |
| 177 | # Mash together the defaults dict with the test case dict to create the set of |
| 178 | # preload parameters |
| 179 | # |
DR695H | f6948fa | 2019-07-11 18:03:00 -0400 | [diff] [blame] | 180 | Preload.Set Directory preload ./demo/preload_data |
| 181 | ${defaults}= Get Default Preload Data preload |
| 182 | ${template}= Get Preload Data preload ${service} ${template} |
Jerry Flood | 81d33fb | 2017-11-21 16:21:21 -0500 | [diff] [blame] | 183 | # add all of the defaults to template... |
| 184 | @{keys}= Get Dictionary Keys ${defaults} |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 185 | :FOR ${key} IN @{keys} |
Jerry Flood | 81d33fb | 2017-11-21 16:21:21 -0500 | [diff] [blame] | 186 | \ ${value}= Get From Dictionary ${defaults} ${key} |
| 187 | \ Set To Dictionary ${template} ${key} ${value} |
| 188 | |
| 189 | # |
| 190 | # Get the vnf_parameters to preload |
| 191 | # |
| 192 | ${vnf_parameters}= Resolve VNF Parameters Into Array ${valuemap} ${template} |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 193 | ${vnf_parameters_json}= Evaluate json.dumps(${vnf_parameters}) json |
Jerry Flood | 81d33fb | 2017-11-21 16:21:21 -0500 | [diff] [blame] | 194 | ${parameters}= Create Dictionary vnf_parameters=${vnf_parameters_json} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 195 | [Return] ${parameters} |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 196 | |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 197 | Resolve VNF Parameters Into Array |
Jerry Flood | 81d33fb | 2017-11-21 16:21:21 -0500 | [diff] [blame] | 198 | [Arguments] ${valuemap} ${from} |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 199 | ${vnf_parameters}= Create List |
| 200 | ${keys}= Get Dictionary Keys ${from} |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 201 | :FOR ${key} IN @{keys} |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 202 | \ ${value}= Get From Dictionary ${from} ${key} |
DR695H | a6ce951 | 2019-07-19 14:25:43 -0400 | [diff] [blame] | 203 | \ ${value}= Templating.Template String ${value} ${valuemap} |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 204 | \ ${parameter}= Create Dictionary vnf-parameter-name=${key} vnf-parameter-value=${value} |
| 205 | \ Append To List ${vnf_parameters} ${parameter} |
| 206 | [Return] ${vnf_parameters} |
| 207 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 208 | Preload Vnf Profile |
| 209 | [Arguments] ${vnf_name} |
| 210 | Login To SDNGC Admin GUI |
| 211 | Go To ${SDNGC_ADMIN_VNF_PROFILE_URL} |
| 212 | Click Button xpath=//button[@data-target='#add_vnf_profile'] |
| 213 | Input Text xpath=//input[@id='nf_vnf_type'] ${vnf_name} |
| 214 | Input Text xpath=//input[@id='nf_availability_zone_count'] 999 |
| 215 | Input Text xpath=//input[@id='nf_equipment_role'] robot-ete-test |
| 216 | Click Button xpath=//button[contains(.,'Submit')] |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 217 | Page Should Contain VNF Profile |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 218 | Input Text xpath=//div[@id='vnf_profile_filter']//input ${vnf_name} |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 219 | Page Should Contain ${vnf_name} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 220 | |
| 221 | Delete Vnf Profile |
| 222 | [Arguments] ${vnf_name} |
| 223 | Login To SDNGC Admin GUI |
| 224 | Go To ${SDNGC_ADMIN_VNF_PROFILE_URL} |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 225 | Page Should Contain VNF Profile |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 226 | Input Text xpath=//div[@id='vnf_profile_filter']//input ${vnf_name} |
| 227 | Page Should Contain ${vnf_name} |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 228 | Click Button xpath=//button[contains(@onclick, '${vnf_name}')] |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 229 | Page Should Contain Are you sure you want to delete VNF_PROFILE |
| 230 | Click Button xpath=//button[contains(text(), 'Yes')] |
| 231 | Page Should Not Contain ${vnf_name} |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 232 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 233 | Login To SDNGC Admin GUI |
| 234 | [Documentation] Login To SDNGC Admin GUI |
Jerry Flood | d40619e | 2017-08-24 09:38:48 -0400 | [diff] [blame] | 235 | ## Setup Browser is now being managed by the test case |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 236 | ## Setup Browser |
| 237 | Go To ${SDNGC_ADMIN_SIGNUP_URL} |
Jerry Flood | 81d33fb | 2017-11-21 16:21:21 -0500 | [diff] [blame] | 238 | ##Maximize Browser Window |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 239 | Set Selenium Speed ${GLOBAL_SELENIUM_DELAY} |
| 240 | Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT} |
| 241 | Log Logging in to ${SDNGC_ADMIN_LOGIN_URL} |
| 242 | Handle Proxy Warning |
| 243 | Title Should Be AdminPortal |
DR695H | 18872bc | 2019-06-13 16:16:52 -0400 | [diff] [blame] | 244 | ${uuid}= Generate UUID4 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 245 | ${shortened_uuid}= Evaluate str("${uuid}")[:12] |
| 246 | ${email}= Catenate ${shortened_uuid}@robotete.com |
| 247 | Input Text xpath=//input[@id='nf_email'] ${email} |
| 248 | Input Password xpath=//input[@id='nf_password'] ${shortened_uuid} |
| 249 | Click Button xpath=//button[@type='submit'] |
| 250 | Wait Until Page Contains User created 20s |
| 251 | Go To ${SDNGC_ADMIN_LOGIN_URL} |
| 252 | Input Text xpath=//input[@id='email'] ${email} |
| 253 | Input Password xpath=//input[@id='password'] ${shortened_uuid} |
| 254 | Click Button xpath=//button[@type='submit'] |
| 255 | Title Should Be SDN-C AdminPortal |
Brian Freeman | 12ff184 | 2019-02-13 13:54:48 -0500 | [diff] [blame] | 256 | Log Logged in to ${SDNGC_ADMIN_LOGIN_URL} |