DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Testing openstack. |
| 3 | Library OperatingSystem |
| 4 | Library SSHLibrary |
| 5 | Library RequestsLibrary |
| 6 | Library JSONUtils |
| 7 | Library OpenstackLibrary |
| 8 | Library HEATUtils |
| 9 | Library Collections |
| 10 | Resource ../../resources/openstack/keystone_interface.robot |
| 11 | Resource ../../resources/openstack/nova_interface.robot |
| 12 | Resource ../../resources/openstack/heat_interface.robot |
| 13 | Resource ../../resources/ssh/files.robot |
| 14 | Resource ../../resources/ssh/processes.robot |
| 15 | Resource ../appc_interface.robot |
| 16 | Resource packet_generator_interface.robot |
| 17 | Resource validate_common.robot |
| 18 | |
| 19 | |
| 20 | *** Variables *** |
| 21 | ${ASSETS} ${EXECDIR}/robot/assets/ |
| 22 | |
| 23 | *** Keywords *** |
| 24 | Validate Firewall Stack |
| 25 | [Documentation] Identifies the firewall servers in the VFW Stack in the GLOBAL_OPENSTACK_SERVICE_REGION |
jf9860 | 3b22a2d | 2017-03-01 19:43:28 -0500 | [diff] [blame] | 26 | [Arguments] ${STACK_NAME} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 27 | Run Openstack Auth Request auth |
| 28 | ${stack_info}= Wait for Stack to Be Deployed auth ${STACK_NAME} |
| 29 | ${stack_id}= Get From Dictionary ${stack_info} id |
jf9860 | 3b22a2d | 2017-03-01 19:43:28 -0500 | [diff] [blame] | 30 | ${server_list}= Get Openstack Servers auth |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 31 | |
| 32 | ${vpg_unprotected_ip}= Get From Dictionary ${stack_info} vpg_private_ip_0 |
| 33 | ${vsn_protected_ip}= Get From Dictionary ${stack_info} vsn_private_ip_0 |
| 34 | ${vpg_name_0}= Get From Dictionary ${stack_info} vpg_name_0 |
jf9860 | 3b22a2d | 2017-03-01 19:43:28 -0500 | [diff] [blame] | 35 | ${vfw_public_ip}= Get Server Ip ${server_list} ${stack_info} vfw_name_0 network_name=public |
| 36 | ${vpg_public_ip}= Get Server Ip ${server_list} ${stack_info} vpg_name_0 network_name=public |
| 37 | ${vsn_public_ip}= Get Server Ip ${server_list} ${stack_info} vsn_name_0 network_name=public |
| 38 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 39 | Wait For Server ${vfw_public_ip} |
| 40 | Wait For Server ${vpg_public_ip} |
| 41 | Wait For Server ${vsn_public_ip} |
| 42 | Log Accessed all servers |
jf9860 | 3b22a2d | 2017-03-01 19:43:28 -0500 | [diff] [blame] | 43 | Wait For Firewall ${vfw_public_ip} |
| 44 | Wait For Packet Generator ${vpg_public_ip} |
| 45 | Wait For Packet Sink ${vsn_public_ip} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 46 | Log All server processes up |
jf9860 | b85b164 | 2017-03-02 11:24:11 -0500 | [diff] [blame] | 47 | ${vpg_oam_ip}= Get From Dictionary ${stack_info} vpg_private_ip_1 |
| 48 | ${appc}= Create Mount Point In APPC ${vpg_name_0} ${vpg_oam_ip} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 49 | |
| 50 | # Following hack was implemented because the stack doesn't always come up clean |
| 51 | # It was found that rebooting the servers at this point did not improve the |
jf9860 | 3b22a2d | 2017-03-01 19:43:28 -0500 | [diff] [blame] | 52 | # chances of the packets flowing to the SNK |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 53 | #${status} ${data}= Run Keyword And Ignore Error Wait For Packets ${vpg_public_ip} ${vpg_unprotected_ip} ${vsn_protected_ip} ${vsn_public_ip} |
| 54 | #Return From Keyword if '${status}' == 'PASS' |
| 55 | #Close All Connections |
jf9860 | 3b22a2d | 2017-03-01 19:43:28 -0500 | [diff] [blame] | 56 | #Find And Reboot The Server ${stack_info} ${server_list} vfw_name_0 |
| 57 | #Find And Reboot The Server ${stack_info} ${server_list} vpg_name_0 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 58 | #Find And Reboot The Server ${stack_info} ${server_list} vsn_name_0 |
jf9860 | 3b22a2d | 2017-03-01 19:43:28 -0500 | [diff] [blame] | 59 | ## Gives some time for servers to shutdown |
| 60 | #Sleep 10s |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 61 | #Wait For Server ${vfw_public_ip} |
| 62 | #Wait For Server ${vpg_public_ip} |
| 63 | #Wait For Server ${vsn_public_ip} |
| 64 | |
| 65 | Wait For Packets ${vpg_public_ip} ${vpg_unprotected_ip} ${vsn_protected_ip} ${vsn_public_ip} |
jf9860 | 3b22a2d | 2017-03-01 19:43:28 -0500 | [diff] [blame] | 66 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 67 | Wait For Packets |
| 68 | [Documentation] Final vfw validation that packets are flowing from the pgn VM to the snk VM |
jf9860 | 3b22a2d | 2017-03-01 19:43:28 -0500 | [diff] [blame] | 69 | [Arguments] ${vpg_public_ip} ${vpg_unprotected_ip} ${vsn_protected_ip} ${vsn_public_ip} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 70 | ${resp}= Enable Stream ${vpg_public_ip} |
| 71 | Should Be Equal As Strings ${resp.status_code} 200 |
jf9860 | 3b22a2d | 2017-03-01 19:43:28 -0500 | [diff] [blame] | 72 | ${syslog_message}= Catenate UDP: short packet: From ${vpg_unprotected_ip}:.* to ${vsn_protected_ip}:.* |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 73 | Tail File on Host Until ${vsn_public_ip} UDP: /var/log/syslog ${syslog_message} timeout=120s |
jf9860 | 3b22a2d | 2017-03-01 19:43:28 -0500 | [diff] [blame] | 74 | Disable All Streams ${vpg_public_ip} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 75 | |
| 76 | |
| 77 | Wait For Firewall |
| 78 | [Documentation] Wait for the defined firewall processes to come up |
jf9860 | 3b22a2d | 2017-03-01 19:43:28 -0500 | [diff] [blame] | 79 | [Arguments] ${ip} |
| 80 | Wait for Process on Host ./vpp_measurement_reporter ${ip} |
| 81 | Wait for Process on Host vpp -c /etc/vpp/startup.conf ${ip} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 82 | |
| 83 | Wait For Packet Generator |
| 84 | [Documentation] Wait for the defined packet generator processes to come up |
jf9860 | 3b22a2d | 2017-03-01 19:43:28 -0500 | [diff] [blame] | 85 | [Arguments] ${ip} |
| 86 | Wait for Process on Host vpp -c /etc/vpp/startup.conf ${ip} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 87 | 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 |
jf9860 | 3b22a2d | 2017-03-01 19:43:28 -0500 | [diff] [blame] | 88 | Run Keyword And Ignore Error Wait for Process on Host run_traffic_fw_demo.sh ${ip} timeout=60s |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 89 | Pkill Process On Host "/bin/bash ./run_traffic_fw_demo.sh" ${ip} |
jf9860 | 3b22a2d | 2017-03-01 19:43:28 -0500 | [diff] [blame] | 90 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 91 | Wait For Packet Sink |
| 92 | [Documentation] Wait for the defined packet sink processes to come up |
| 93 | [Arguments] ${ip} |
jf9860 | 3b22a2d | 2017-03-01 19:43:28 -0500 | [diff] [blame] | 94 | Log noting to check on ${ip} |