diff options
author | 2017-12-08 19:58:20 -0500 | |
---|---|---|
committer | 2017-12-08 19:58:34 -0500 | |
commit | b74b2d957d09b15ea75b3ddccc84293a26c213bb (patch) | |
tree | d84160fc9cfc5ea736cdf507a8c99f28fe4ce1b7 /robot/resources | |
parent | e31a7f33d74ea5080db331280381cfcbce975b37 (diff) |
Enable generic-vnf-name = host name
Issue-ID: TEST-72
Change-Id: I20b684725ba2b4dffbb063584f3f6dbf8b5ca528
Signed-off-by: Jerry Flood <jf9860@att.com>
Diffstat (limited to 'robot/resources')
5 files changed, 95 insertions, 12 deletions
diff --git a/robot/resources/aai/service_instance.robot b/robot/resources/aai/service_instance.robot index 31a4a610..8713313b 100644 --- a/robot/resources/aai/service_instance.robot +++ b/robot/resources/aai/service_instance.robot @@ -13,6 +13,7 @@ Library StringTemplater Resource ../json_templater.robot Resource ../stack_validation/validate_vlb.robot Resource ../stack_validation/validate_vfw.robot +Resource ../stack_validation/validate_vfwcl.robot Resource ../stack_validation/validate_vvg.robot Resource ../aai/aai_interface.robot @@ -100,6 +101,8 @@ Validate VF Module Run Keyword If '${stack_type}'=='vLB' Validate vLB Stack ${vf_module_name} Run Keyword If '${stack_type}'=='vFW' Validate Firewall Stack ${vf_module_name} Run Keyword If '${stack_type}'=='vVG' Validate vVG Stack ${vf_module_name} + Run Keyword If '${stack_type}'=='vPKG' Validate FirewallPKG Stack ${vf_module_name} + Run Keyword If '${stack_type}'=='vFWSNK' Validate FirewallSNK Stack ${vf_module_name} *** Keywords *** Create AAI Service Instance diff --git a/robot/resources/sdngc_interface.robot b/robot/resources/sdngc_interface.robot index 4282c795..c4dadc2d 100644 --- a/robot/resources/sdngc_interface.robot +++ b/robot/resources/sdngc_interface.robot @@ -122,8 +122,8 @@ Preload One Vnf Topology [Arguments] ${service_type_uuid} ${generic_vnf_name} ${generic_vnf_type} ${vf_module_name} ${vf_module_type} ${service} ${filename} ${uuid} ${servers} Return From Keyword If '${filename}' == '' ${data_template}= OperatingSystem.Get File ${PRELOAD_VNF_TOPOLOGY_OPERATION_BODY}/preload.template - ${parameters}= Get Template Parameters ${filename} ${uuid} ${servers} - 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} + ${robot_values}= Create Dictionary 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} + ${parameters}= Get Template Parameters ${filename} ${uuid} ${servers} ${robot_values} ${data}= Fill JSON Template ${data_template} ${parameters} ${put_resp}= Run SDNGC Post Request ${SDNGC_INDEX_PATH}${PRELOAD_VNF_TOPOLOGY_OPERATION_PATH} ${data} Should Be Equal As Strings ${put_resp.json()['output']['response-code']} 200 @@ -131,7 +131,7 @@ Preload One Vnf Topology Should Be Equal As Strings ${get_resp.status_code} 200 Get Template Parameters - [Arguments] ${template} ${uuid} ${servers} + [Arguments] ${template} ${uuid} ${servers} ${robot_values} ${rest} ${suite}= Split String From Right ${SUITE NAME} . 1 ${uuid}= Catenate ${uuid} ${hostid}= Get Substring ${uuid} -4 @@ -142,7 +142,11 @@ Get Template Parameters # Initialize the value map with the properties generated from the Robot VM /opt/config folder ${valuemap}= Copy Dictionary ${GLOBAL_INJECTED_PROPERTIES} - + ${robot_keys}= Get Dictionary Keys ${robot_values} + :for ${key} in @{robot_keys} + \ ${value}= Get From Dictionary ${robot_values} ${key} + \ Set To Dictionary ${valuemap} ${key} ${value} + # These should be deprecated by the above.... Set To Dictionary ${valuemap} artifacts_version=${GLOBAL_INJECTED_ARTIFACTS_VERSION} Set To Dictionary ${valuemap} network=${GLOBAL_INJECTED_NETWORK} @@ -175,7 +179,8 @@ Get Template Parameters # ${vnf_parameters}= Resolve VNF Parameters Into Array ${valuemap} ${template} ${vnf_parameters_json}= Evaluate json.dumps(${vnf_parameters}) json - ${parameters}= Create Dictionary vnf_parameters=${vnf_parameters_json} + ${parameters}= Copy Dictionary ${robot_values} + Set TO Dictionary ${parameters} vnf_parameters=${vnf_parameters_json} [Return] ${parameters} Resolve Values Into Dictionary diff --git a/robot/resources/stack_validation/validate_vfw.robot b/robot/resources/stack_validation/validate_vfw.robot index e1627202..40374da0 100644 --- a/robot/resources/stack_validation/validate_vfw.robot +++ b/robot/resources/stack_validation/validate_vfw.robot @@ -50,26 +50,26 @@ Validate Firewall Stack Wait For Packets [Documentation] Final vfw validation that packets are flowing from the pgn VM to the snk VM [Arguments] ${vpg_public_ip} ${vpg_unprotected_ip} ${vsn_protected_ip} ${vsn_public_ip} - ${resp}= Enable Stream ${vpg_public_ip} - Should Be Equal As Strings ${resp.status_code} 200 + #${resp}= Enable Stream ${vpg_public_ip} + #Should Be Equal As Strings ${resp.status_code} 200 ${syslog_message}= Catenate UDP: short packet: From ${vpg_unprotected_ip}:.* to ${vsn_protected_ip}:.* Tail File on Host Until ${vsn_public_ip} UDP: /var/log/syslog ${syslog_message} timeout=120s - Disable All Streams ${vpg_public_ip} + #Disable All Streams ${vpg_public_ip} Wait For Firewall [Documentation] Wait for the defined firewall processes to come up [Arguments] ${ip} - ##Wait for Process on Host ./vpp_measurement_reporter ${ip} + Wait for Process on Host ./vpp_measurement_reporter ${ip} Wait for Process on Host vpp -c /etc/vpp/startup.conf ${ip} Wait For Packet Generator [Documentation] Wait for the defined packet generator processes to come up [Arguments] ${ip} Wait for Process on Host vpp -c /etc/vpp/startup.conf ${ip} - ##Wait Until Keyword Succeeds 180s 5s Tail File on Host Until ${ip} Honeycomb /var/log/honeycomb/honeycomb.log - Honeycomb initialized options=-c +0 timeout=120s + Wait Until Keyword Succeeds 180s 5s Tail File on Host Until ${ip} Honeycomb /var/log/honeycomb/honeycomb.log Honeycomb initialized options=-c +0 timeout=120s Run Keyword And Ignore Error Wait for Process on Host run_traffic_fw_demo.sh ${ip} timeout=60s - Pkill Process On Host "/bin/bash ./run_traffic_fw_demo.sh" ${ip} + ##Pkill Process On Host "/bin/bash ./run_traffic_fw_demo.sh" ${ip} Wait For Packet Sink [Documentation] Wait for the defined packet sink processes to come up diff --git a/robot/resources/stack_validation/validate_vfwcl.robot b/robot/resources/stack_validation/validate_vfwcl.robot new file mode 100644 index 00000000..2671d453 --- /dev/null +++ b/robot/resources/stack_validation/validate_vfwcl.robot @@ -0,0 +1,69 @@ +*** Settings *** +Documentation Testing openstack. +Library OperatingSystem +Library SSHLibrary +Library RequestsLibrary +Library JSONUtils +Library OpenstackLibrary +Library HEATUtils +Library Collections +Resource ../../resources/openstack/keystone_interface.robot +Resource ../../resources/openstack/nova_interface.robot +Resource ../../resources/openstack/heat_interface.robot +Resource ../../resources/ssh/files.robot +Resource ../../resources/ssh/processes.robot +Resource ../appc_interface.robot +Resource packet_generator_interface.robot +Resource validate_common.robot +Resource validate_vfw.robot + + +*** Variables *** +${TV_VFW_PUBLIC_IP} +${TV_VSN_PUBLIC_IP} + +*** Keywords *** +Validate FirewallPKG Stack + [Documentation] Identifies and validates the firewall servers in the VFW Stack + [Arguments] ${STACK_NAME} + Run Openstack Auth Request auth + ${stack_info}= Wait for Stack to Be Deployed auth ${STACK_NAME} + ${stack_id}= Get From Dictionary ${stack_info} id + ${server_list}= Get Openstack Servers auth + + ${vpg_unprotected_ip}= Get From Dictionary ${stack_info} vpg_private_ip_0 + ${vsn_protected_ip}= Get From Dictionary ${stack_info} vsn_private_ip_0 + ${vpg_name_0}= Get From Dictionary ${stack_info} vpg_name_0 + ${vnf_id}= Get From Dictionary ${stack_info} vnf_id + + ${vpg_public_ip}= Get Server Ip ${server_list} ${stack_info} vpg_name_0 network_name=public + Wait For Server ${vpg_public_ip} + Log Accessed all servers + Wait For Packet Generator ${vpg_public_ip} + Log All server processes up + ${vpg_oam_ip}= Get From Dictionary ${stack_info} vpg_private_ip_1 + + ${appc}= Create Mount Point In APPC ${vnf_id} ${vpg_oam_ip} + Wait For Packets ${vpg_public_ip} ${vpg_unprotected_ip} ${vsn_protected_ip} ${TV_VSN_PUBLIC_IP} + +Validate FirewallSNK Stack + [Documentation] Identifies and validates the firewall servers in the VFW Stack + [Arguments] ${STACK_NAME} + Run Openstack Auth Request auth + ${stack_info}= Wait for Stack to Be Deployed auth ${STACK_NAME} + ${stack_id}= Get From Dictionary ${stack_info} id + ${server_list}= Get Openstack Servers auth + + ${vfw_public_ip}= Get Server Ip ${server_list} ${stack_info} vfw_name_0 network_name=public + ${vsn_public_ip}= Get Server Ip ${server_list} ${stack_info} vsn_name_0 network_name=public + + Wait For Server ${vfw_public_ip} + Log Accessed all servers + Wait For Firewall ${vfw_public_ip} + Wait For Packet Sink ${vsn_public_ip} + # Save for teh PKG validation + Set Test Variable ${TV_VFW_PUBLIC_IP} ${vfw_public_ip} + Set Test Variable ${TV_VSN_PUBLIC_IP} ${vsn_public_ip} + Log All server processes up + + diff --git a/robot/resources/test_templates/vnf_orchestration_test_template.robot b/robot/resources/test_templates/vnf_orchestration_test_template.robot index 2cef78ba..14bba6be 100644 --- a/robot/resources/test_templates/vnf_orchestration_test_template.robot +++ b/robot/resources/test_templates/vnf_orchestration_test_template.robot @@ -22,6 +22,7 @@ Library OpenstackLibrary Library ExtendedSelenium2Library Library UUID Library Collections +Library String @@ -66,8 +67,13 @@ Orchestrate VNF Validate Service Instance ${service_instance_id} ${service} ${customer_name} ${vnflist}= Get From Dictionary ${GLOBAL_SERVICE_VNF_MAPPING} ${service} ${vnfmap}= Create Dictionary + # For vFWLC closed loop test generic-vnf-name (${vnf_name} will be used as the FWL hostname so we + # now need to make it be a valid hostname :for ${vnf} in @{vnflist} - \ ${vnf_name}= Catenate Ete_${vnf}_${uuid} + \ ${shortuuid}= Catenate ${uuid} + \ ${shortuuid}= Replace String ${shortuuid} - ${SPACE} + \ ${shortuuid}= Get Substring ${shortuuid} -8 + \ ${vnf_name}= Catenate ${vnf}${shortuuid} \ ${vf_module_name}= Catenate Vfmodule_Ete_${vnf}_${uuid} \ ${vnf_type}= Get VNF Type ${catalog_resources} ${vnf} \ ${vf_module}= Get VF Module ${catalog_resources} ${vnf} |